Skip to content

Commit

Permalink
Add constraints call to requirements.txt
Browse files Browse the repository at this point in the history
Guard for misparsed line in setup.py
Add comments to constraints and setup to assist developers.
  • Loading branch information
david4096 committed Dec 9, 2016
1 parent 3b315a2 commit 4a68b68
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
21 changes: 20 additions & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# This file allows our dependencies to be against specific versions
# or git tags. Each line is similar to a requirements.txt line,
# except that when installing the dependencies, the constraints.txt
# is converted into the `dependency_links` of the setuptools
# packaging script. This allows us to maintain dependencies across
# repositories.
#
# For example, during development the we use the development version
# of the schemas with the line:
#
# git+git://github.com/ga4gh/ga4gh-schemas.git@master#egg=ga4gh_schemas
#
# When one has proposed a schema modification, they can change this
# constraint to point at the branch of their proposed change:
#
# git+git://github.com/david4096/schemas.git@protobuf31#egg=ga4gh_schemas
#
# Then, when the change has been accepted at the schemas repository
# you can change this to point back at the master branch!
git+git://github.com/david4096/ga4gh-client.git@protobuf31#egg=ga4gh_client
git+git://github.com/david4096/schemas.git@protobuf31#egg=ga4gh_schemas
git+git://github.com/david4096/schemas.git@protobuf31#egg=ga4gh_schemas
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
# these libraries are the set listed by pipdeptree -f -w
# that are dependencies of libraries listed in the next section

# Adding the constraints.txt allows you to choose a specific
# way to resolve our internal dependencies. During development,
# the constraints file will point at the current master branch
# of the respective module.
-c constraints.txt
ga4gh-common==0.0.5
ga4gh-schemas
ga4gh-client
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
continue
if line[0] == '#':
continue
pinnedVersion = line.split()[0]
install_requires.append(pinnedVersion)
if line.find('-c constraints.txt') == -1:
pinnedVersion = line.split()[0]
install_requires.append(pinnedVersion)

dependency_links = []
try:
Expand All @@ -32,8 +33,7 @@
continue
if line[0] == '#':
continue
if line.find('git') != -1:
dependency_links.append(line)
dependency_links.append(line)
except EnvironmentError:
print('No constraints file found, proceeding without '
'creating dependency links.')
Expand Down

0 comments on commit 4a68b68

Please sign in to comment.