Skip to content

Commit 6ef59f3

Browse files
committed
Merge pull request #132 from hammerlab/update-travis-config
Copied new travis config from Varcode
2 parents de7916e + 2ff9f12 commit 6ef59f3

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

.travis.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,38 @@ language: python
33
python:
44
- "2.7"
55
- "3.4"
6-
# Setup anaconda; see https://gist.github.com/dan-blanchard/7045057
76
before_install:
8-
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
9-
- chmod +x miniconda.sh
10-
- ./miniconda.sh -b
11-
- export PATH=/home/travis/miniconda/bin:$PATH
12-
- conda update --yes conda
7+
# Commands below copied from: http://conda.pydata.org/docs/travis.html
8+
# We do this conditionally because it saves us some downloading if the
9+
# version is the same.
10+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
11+
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
12+
else
13+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
14+
fi
15+
- bash miniconda.sh -b -p $HOME/miniconda
16+
- export PATH="$HOME/miniconda/bin:$PATH"
17+
# reset the shell's lookup table for program name to path mappings
18+
- hash -r
19+
- conda config --set always_yes yes --set changeps1 no
20+
- conda update -q conda
21+
# Useful for debugging any issues with conda
22+
- conda info -a
1323
addons:
1424
apt:
1525
packages:
26+
# install pandoc for use with pypandoc for converting the README
27+
# from markdown to RST
1628
- pandoc
1729
install:
18-
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy nose pandas matplotlib
30+
- >
31+
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
32+
numpy scipy nose pandas matplotlib
33+
- source activate test-environment
34+
- pip install pypandoc
1935
- pip install -r requirements.txt
2036
- pip install .
2137
- pip install coveralls
22-
# required for generating reStructuredText README
23-
- pip install pypandoc
2438
script:
2539
# human releases
2640
- pyensembl install --release 54 --species human

lint.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/bin/bash
22
set -o errexit
33

4+
5+
# disabling several categories of errors due to false positives in pylint,
6+
# see these issues:
7+
# - https://bitbucket.org/logilab/pylint/issues/701/false-positives-with-not-an-iterable-and
8+
# - https://bitbucket.org/logilab/pylint/issues/58
9+
410
find . -name '*.py' \
511
| xargs pylint \
612
--errors-only \
7-
--disable=print-statement
13+
--disable=print-statement,unsubscriptable-object,not-an-iterable,no-member
814

915
echo 'Passes pylint check'

pyensembl/ensembl_url_templates.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from __future__ import print_function, division, absolute_import
2525
from os.path import join
2626

27-
from six.moves.urllib_parse import urljoin
27+
from six.moves import urllib_parse
2828

2929
from .species import Species, find_species_by_name
3030
from .ensembl_release_versions import check_release_number
@@ -36,6 +36,7 @@
3636
# GTF annotation files: /pub/release-78/gtf/homo_sapiens/
3737
SPECIES_SUBDIR_TEMPLATE = "/pub/release-%(release)d/%(filetype)s/%(species)s/"
3838

39+
3940
def _species_subdir(
4041
ensembl_release,
4142
species="homo_sapiens",
@@ -51,6 +52,7 @@ def _species_subdir(
5152
"species": species,
5253
}
5354

55+
5456
def _normalize_release_properties(ensembl_release, species):
5557
"""
5658
Make sure a given release is valid, normalize it to be an integer,
@@ -65,6 +67,7 @@ def _normalize_release_properties(ensembl_release, species):
6567
# GTF annotation file example: Homo_sapiens.GTCh38.gtf.gz
6668
GTF_FILENAME_TEMPLATE = "%(Species)s.%(reference)s.%(release)d.gtf.gz"
6769

70+
6871
def make_gtf_url(ensembl_release, species, server=ENSEMBL_FTP_SERVER):
6972
"""
7073
Returns a URL and a filename, which can be joined together.
@@ -78,7 +81,7 @@ def make_gtf_url(ensembl_release, species, server=ENSEMBL_FTP_SERVER):
7881
filetype="gtf",
7982
server=server)
8083

81-
url_subdir = urljoin(server, subdir)
84+
url_subdir = urllib_parse.urljoin(server, subdir)
8285

8386
filename = GTF_FILENAME_TEMPLATE % {
8487
"Species": species.capitalize(),
@@ -91,6 +94,7 @@ def make_gtf_url(ensembl_release, species, server=ENSEMBL_FTP_SERVER):
9194
FASTA_DNA_CHROMOSOME_FILENAME_TEMPLATE = \
9295
"%(Species)s.%(reference)s.%(release)d.%(sequence_type)s.chromosome.%(contig)s.fa.gz"
9396

97+
9498
def make_fasta_dna_url(
9599
ensembl_release,
96100
species,
@@ -107,7 +111,7 @@ def make_fasta_dna_url(
107111
species=species,
108112
filetype="fasta",
109113
server=server,)
110-
server_subdir = urljoin(server, subdir)
114+
server_subdir = urllib_parse.urljoin(server, subdir)
111115

112116
server_sequence_subdir = join(server_subdir, "dna")
113117
filename = FASTA_DNA_CHROMOSOME_FILENAME_TEMPLATE % {
@@ -130,6 +134,7 @@ def make_fasta_dna_url(
130134
NEW_FASTA_FILENAME_TEMPLATE = \
131135
"%(Species)s.%(reference)s.%(sequence_type)s.all.fa.gz"
132136

137+
133138
def make_fasta_url(
134139
ensembl_release,
135140
species,
@@ -150,7 +155,7 @@ def make_fasta_url(
150155
filetype="fasta",
151156
server=server)
152157

153-
server_subdir = urljoin(server, subdir)
158+
server_subdir = urllib_parse.urljoin(server, subdir)
154159
server_sequence_subdir = join(server_subdir, sequence_type)
155160
if ensembl_release <= 75:
156161
filename = OLD_FASTA_FILENAME_TEMPLATE % {

0 commit comments

Comments
 (0)