Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
adapt setup.py to pip 20 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppodhajski authored Jun 8, 2020
1 parent fc7c083 commit 53b7253
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
version = 1.0.2
version = 1.0.3
name = rockets
summary = Rockets python client
url = https://github.com/BlueBrain/Rockets
Expand Down
22 changes: 9 additions & 13 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Copyright (c) 2018, Blue Brain Project
# Daniel Nachbaur <[email protected]>
# Pawel Podhajski <[email protected]>
#
# This file is part of Rockets <https://github.com/BlueBrain/Rockets>
#
Expand All @@ -23,25 +24,20 @@
"""setup.py"""
import os
from setuptools import setup

try: # for pip >= 10
from pip._internal.req import parse_requirements
from pip._internal.download import PipSession
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
from pip.download import PipSession
from optparse import Option
import pathlib
import pkg_resources

BASEDIR = os.path.dirname(os.path.abspath(__file__))


def parse_reqs(reqs_file):
''' parse the requirements '''
options = Option("--workaround")
options.skip_requirements_regex = None
options.isolated_mode = True
install_reqs = parse_requirements(reqs_file, options=options, session=PipSession())
return [str(ir.req) for ir in install_reqs]
install_reqs = list()
with pathlib.Path(reqs_file).open() as requirements_txt:
install_reqs = [str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)]
return install_reqs


REQS = parse_reqs(os.path.join(BASEDIR, "requirements.txt"))
Expand Down

0 comments on commit 53b7253

Please sign in to comment.