Skip to content

Commit

Permalink
Add constraints for private repos
Browse files Browse the repository at this point in the history
Add dependency links to setup py
Remove version pin from schemas and client requirements
Add protoc to travis for building schemas
Add guard if no constraints are found
  • Loading branch information
david4096 committed Dec 9, 2016
1 parent 9e0a3ad commit 9cb1876
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 11 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ sudo: false
cache:
directories:
- $HOME/.cache/pip
- /tmp/proto3.1.0

install:
- pip install pip --upgrade
# RDFLib requres html5lib; html5lib requires setuptools version 18.5 or above;
- pip install setuptools==25.1.0
- python setup.py sdist
- pip install dist/ga4gh*.tar.gz
- pip install dist/ga4gh*.tar.gz -c constraints.txt
# every installable in setup.py's entry_points should be tested here
- ga4gh_configtest --version
- ga4gh_server --version
Expand All @@ -21,9 +22,12 @@ install:
- ga4gh_repo --version

before_script:
- pip install -r dev-requirements.txt
- pip install -r dev-requirements.txt -c constraints.txt
- python scripts/build_test_data.py


before_install:
- bash tools/travis-install-protoc.sh 3.1.0
- export PATH=/tmp/proto3.1.0/bin:$PATH

# run_tests.py runs everything under the script: tag so only put commands
# under it that we want to run (and want to be able to run) as local tests
Expand Down
2 changes: 2 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git+git://github.com/david4096/ga4gh-client.git@protobuf31#egg=ga4gh_client
git+git://github.com/david4096/schemas.git@protobuf31#egg=ga4gh_schemas
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PyVCF==0.6.7
freezegun==0.3.6
guppy==0.1.10
snakefood==1.4
Sphinx==1.3.1
Sphinx==1.4.6

# Requirements for OIDC provider
pyaml==15.03.1
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
# that are dependencies of libraries listed in the next section

ga4gh-common==0.0.5
ga4gh-schemas==0.0.8
#ga4gh-client==0.0.3
git+git://github.com/david4096/ga4gh-client.git@protobuf31#egg=ga4gh-client
ga4gh-schemas
ga4gh-client

Werkzeug==0.11.5
MarkupSafe==0.23
Expand Down Expand Up @@ -41,7 +40,7 @@ pyjwkest==1.0.1
# prefix due to a setuptools bug.
Flask-Cors==2.0.1
Flask==0.10.1
protobuf==3.1
protobuf==3.1.0.post1
humanize==0.5.1
pysam==0.9.0
requests==2.7.0
Expand Down
20 changes: 17 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@
pinnedVersion = line.split()[0]
install_requires.append(pinnedVersion)

dependency_links = []
try:
with open("constraints.txt") as constraintsFile:
for line in constraintsFile:
line = line.strip()
if len(line) == 0:
continue
if line[0] == '#':
continue
if line.find('git') != -1:
dependency_links.append(line)
except EnvironmentError:
print('No constraints file found, proceeding without '
'creating dependency links.')

setup(
# END BOILERPLATE
name="ga4gh",
description="A reference implementation of the ga4gh API",
description="A reference implementation of the GA4GH API",
packages=["ga4gh", "ga4gh.server", "ga4gh.server.datamodel",
"ga4gh.server.templates"],
namespace_packages=["ga4gh"],
Expand All @@ -42,9 +56,9 @@
'ga4gh_repo=ga4gh.server.cli.repomanager:repo_main',
]
},
# BEGIN BOILERPLATE
long_description=long_description,
install_requires=install_requires,
dependency_links=dependency_links,
license='Apache License 2.0',
include_package_data=True,
author="Global Alliance for Genomics and Health",
Expand Down
29 changes: 29 additions & 0 deletions tools/travis-install-protoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# ensure that the specified version of protoc is installed in
# /tmp/proto$PROTO_VERSION/bin/protoc, which maybe cached

# bash tools/travis-install-protoc.sh 3.0.0-beta-3.1
#


# make bash more robust.
set -beEux -o pipefail

if [ $# != 1 ] ; then
echo "wrong # of args: $0 protoversion" >&2
exit 1
fi

PROTO_VERSION="$1"
PROTO_DIR="/tmp/proto$PROTO_VERSION"

# Can't check for presence of directory as cache auto-creates it.
if [ ! -f "$PROTO_DIR/bin/protoc" ]; then
wget -O - "https://github.com/google/protobuf/archive/v${PROTO_VERSION}.tar.gz" | tar xz -C /tmp
cd "/tmp/protobuf-${PROTO_VERSION}"
./autogen.sh
./configure --prefix="$PROTO_DIR" --disable-shared
make -j 4
make install
fi

0 comments on commit 9cb1876

Please sign in to comment.