diff --git a/constraints.txt b/constraints.txt index 311a753fd..247daa922 100644 --- a/constraints.txt +++ b/constraints.txt @@ -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 \ No newline at end of file +git+git://github.com/david4096/schemas.git@protobuf31#egg=ga4gh_schemas diff --git a/requirements.txt b/requirements.txt index f209ff2f2..84a79999e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index df44bdd06..af7ec72a5 100644 --- a/setup.py +++ b/setup.py @@ -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: @@ -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.')