Skip to content

Commit 528be62

Browse files
committed
minor fixes for Pypi deployment
1 parent 7488901 commit 528be62

File tree

5 files changed

+109
-93
lines changed

5 files changed

+109
-93
lines changed

.travis.yml

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
11
sudo: required
22
dist: trusty
3+
34
language: python
5+
46
python:
5-
- '2.7'
6-
- '3.5'
7+
- '2.7'
8+
- '3.6'
9+
710
before_install:
8-
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then export PYTHON_VERSION=2; wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
9-
-O $HOME/miniconda2.sh; fi
10-
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.5" ]]; then export PYTHON_VERSION=3; wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
11-
-O $HOME/miniconda3.sh; fi
12-
- chmod +x $HOME/miniconda${PYTHON_VERSION}.sh
13-
- "$HOME/miniconda${PYTHON_VERSION}.sh -b;"
14-
- export PATH=/home/travis/miniconda${PYTHON_VERSION}/bin:$PATH
15-
- conda update --yes conda
11+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then export PYTHON_VERSION=2; wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O $HOME/miniconda2.sh; fi
12+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then export PYTHON_VERSION=3; wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/miniconda3.sh; fi
13+
- chmod +x $HOME/miniconda${PYTHON_VERSION}.sh
14+
- "$HOME/miniconda${PYTHON_VERSION}.sh -b;"
15+
- export PATH=/home/travis/miniconda${PYTHON_VERSION}/bin:$PATH
16+
- conda update --yes conda
17+
1618
install:
17-
- conda install --yes python=${TRAVIS_PYTHON_VERSION} numpy future scipy matplotlib
18-
nose sphinx pep8 coverage mpi4py sympy
19-
- conda list
20-
- pip install --user coloredlogs
21-
- pip install --user travis-sphinx
22-
- sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
23-
dvipng
19+
- conda install --yes python=${TRAVIS_PYTHON_VERSION} numpy future scipy matplotlib nose sphinx pep8 coverage mpi4py sympy
20+
- conda list
21+
- pip install --user coloredlogs
22+
- pip install --user travis-sphinx
23+
- sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra dvipng
24+
2425
script:
25-
- "./docs/update_apidocs.sh"
26-
- mkdir data
27-
- which nosetests
28-
#- nosetests tests --with-coverage --cover-inclusive --cover-package=pySDC,tutorial --cover-html --cover-html-dir=target/doc/build/test_coverage
29-
- if [[ $PYTHON_VERSION == 3 ]]; then travis-sphinx build; fi
26+
- "./docs/update_apidocs.sh"
27+
- mkdir data
28+
- which nosetests
29+
#- nosetests tests --with-coverage --cover-inclusive --cover-package=pySDC,tutorial --cover-html --cover-html-dir=target/doc/build/test_coverage
30+
- if [[ $PYTHON_VERSION == 3 ]]; then travis-sphinx build; fi
31+
3032
after_success:
31-
- if [[ $PYTHON_VERSION == 3 ]]; then travis-sphinx deploy; fi
33+
- if [[ $PYTHON_VERSION == 3 ]]; then travis-sphinx deploy; fi
34+
3235
deploy:
33-
provider: pypi
34-
user: pancetta
35-
password:
36-
secure: id5Pg/GL/YdXFmbi5h4xLmmyv/0L8lj9Rlr7lFJBrHrmkHIlu78NgO+LnQsGvhSrZqdDvZwRzFFCKRLiDugp07rzfwM41ROPrcgwnSRuqnzG2sUecNulNGHHoqej/z8nG5Ss8k2+viMqpOjhhZoY3LR0D1nFxRzu3HtHs0MKpRc=
37-
on:
38-
tags: true
36+
- provider: pypi
37+
user: pancetta
38+
password:
39+
secure: id5Pg/GL/YdXFmbi5h4xLmmyv/0L8lj9Rlr7lFJBrHrmkHIlu78NgO+LnQsGvhSrZqdDvZwRzFFCKRLiDugp07rzfwM41ROPrcgwnSRuqnzG2sUecNulNGHHoqej/z8nG5Ss8k2+viMqpOjhhZoY3LR0D1nFxRzu3HtHs0MKpRc=
40+
on:
41+
tags: true
42+
condition: $TRAVIS_PYTHON_VERSION = "2.7"
43+
- provider: pypi
44+
user: pancetta
45+
password:
46+
secure: id5Pg/GL/YdXFmbi5h4xLmmyv/0L8lj9Rlr7lFJBrHrmkHIlu78NgO+LnQsGvhSrZqdDvZwRzFFCKRLiDugp07rzfwM41ROPrcgwnSRuqnzG2sUecNulNGHHoqej/z8nG5Ss8k2+viMqpOjhhZoY3LR0D1nFxRzu3HtHs0MKpRc=
47+
server: https://test.pypi.org/legacy/
48+
on:
49+
tags: false
50+
condition: $TRAVIS_PYTHON_VERSION = "2.7"

requirements-optional.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
matplotlib==1.5.3
21
mpi4py==2.0.0
3-
sympy==1.0

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ nose>=1.3.7
22
numpy>=1.9.3
33
scipy>=0.17.1
44
future>=0.15.2
5-
matplotlib>=1.5.0
5+
matplotlib>=1.5.3
6+
sympy>=1.0
67
pep8
78
coloredlogs

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
author='Robert Speck',
1313
author_email='[email protected]',
1414
url="http://www.parallelintime.org/pySDC/",
15-
download_url = "https://github.com/Parallel-in-Time/pySDC/archive/v2.0.tar.gz",
15+
# download_url = "https://github.com/Parallel-in-Time/pySDC/archive/v2.0.tar.gz",
1616

1717
packages=find_packages(),
1818

@@ -25,8 +25,9 @@
2525
'numpy>=1.9.3',
2626
'scipy>=0.17.1',
2727
'future>=0.15.2',
28-
'matplotlib>=1.5.0',
28+
'matplotlib>=1.5.3',
2929
'coloredlogs',
30-
'pep8'
30+
'pep8',
31+
'sympy>=1.0'
3132
],
3233
)
Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import filecmp
2-
from shutil import copyfile
1+
import pip
32

43
from tutorial.step_6.A_classic_vs_multigrid_controller import main as main_A
54
from tutorial.step_6.B_odd_temporal_distribution import main as main_B
@@ -13,59 +12,64 @@ def test_B():
1312
main_B()
1413

1514
def test_C():
16-
cwd = 'tutorial/step_6'
17-
main_C(cwd)
18-
19-
with open('step_6_C1_out.txt', 'r') as file1:
20-
with open('step_6_A_out.txt', 'r') as file2:
21-
diff = set(file1).difference(file2)
22-
diff.discard('\n')
23-
for line in diff:
24-
assert 'iterations' not in line, 'ERROR: iteration counts differ between MPI and nonMPI for even ' \
25-
'distribution of time-steps'
26-
27-
with open('step_6_C2_out.txt', 'r') as file1:
28-
with open('step_6_B_out.txt', 'r') as file2:
29-
diff = set(file1).difference(file2)
30-
diff.discard('\n')
31-
for line in diff:
32-
assert 'iterations' not in line, 'ERROR: iteration counts differ between MPI and nonMPI for odd distribution ' \
33-
'of time-steps'
34-
35-
diff_MPI = []
36-
with open("step_6_C1_out.txt") as f:
37-
for line in f:
38-
if "Diff" in line:
39-
diff_MPI.append(float(line.split()[1]))
40-
41-
diff_nonMPI = []
42-
with open("step_6_A_out.txt") as f:
43-
for line in f:
44-
if "Diff" in line:
45-
diff_nonMPI.append(float(line.split()[1]))
46-
47-
assert len(diff_MPI) == len(diff_nonMPI), 'ERROR: got different number of results form MPI and nonMPI for even ' \
48-
'distribution of time-steps'
49-
50-
for i, j in zip(diff_MPI, diff_nonMPI):
51-
assert abs(i-j) < 6E-11, 'ERROR: difference between MPI and nonMPI results is too large for even ' \
52-
'distributions of time-steps, got %s' %abs(i - j)
53-
54-
diff_MPI = []
55-
with open("step_6_C2_out.txt") as f:
56-
for line in f:
57-
if "Diff" in line:
58-
diff_MPI.append(float(line.split()[1]))
59-
60-
diff_nonMPI = []
61-
with open("step_6_B_out.txt") as f:
62-
for line in f:
63-
if "Diff" in line:
64-
diff_nonMPI.append(float(line.split()[1]))
65-
66-
assert len(diff_MPI) == len(diff_nonMPI), 'ERROR: got different number of results form MPI and nonMPI for odd ' \
67-
'distribution of time-steps'
68-
69-
for i, j in zip(diff_MPI, diff_nonMPI):
70-
assert abs(i - j) < 6E-11, 'ERROR: difference between MPI and nonMPI results is too large for odd ' \
71-
'distributions of time-steps, got %s' %abs(i - j)
15+
installed_packages = pip.get_installed_distributions()
16+
flat_installed_packages = [package.project_name for package in installed_packages]
17+
18+
if "mpi4py" in flat_installed_packages:
19+
20+
cwd = 'tutorial/step_6'
21+
main_C(cwd)
22+
23+
with open('step_6_C1_out.txt', 'r') as file1:
24+
with open('step_6_A_out.txt', 'r') as file2:
25+
diff = set(file1).difference(file2)
26+
diff.discard('\n')
27+
for line in diff:
28+
assert 'iterations' not in line, 'ERROR: iteration counts differ between MPI and nonMPI for even ' \
29+
'distribution of time-steps'
30+
31+
with open('step_6_C2_out.txt', 'r') as file1:
32+
with open('step_6_B_out.txt', 'r') as file2:
33+
diff = set(file1).difference(file2)
34+
diff.discard('\n')
35+
for line in diff:
36+
assert 'iterations' not in line, 'ERROR: iteration counts differ between MPI and nonMPI for odd distribution ' \
37+
'of time-steps'
38+
39+
diff_MPI = []
40+
with open("step_6_C1_out.txt") as f:
41+
for line in f:
42+
if "Diff" in line:
43+
diff_MPI.append(float(line.split()[1]))
44+
45+
diff_nonMPI = []
46+
with open("step_6_A_out.txt") as f:
47+
for line in f:
48+
if "Diff" in line:
49+
diff_nonMPI.append(float(line.split()[1]))
50+
51+
assert len(diff_MPI) == len(diff_nonMPI), 'ERROR: got different number of results form MPI and nonMPI for even ' \
52+
'distribution of time-steps'
53+
54+
for i, j in zip(diff_MPI, diff_nonMPI):
55+
assert abs(i-j) < 6E-11, 'ERROR: difference between MPI and nonMPI results is too large for even ' \
56+
'distributions of time-steps, got %s' %abs(i - j)
57+
58+
diff_MPI = []
59+
with open("step_6_C2_out.txt") as f:
60+
for line in f:
61+
if "Diff" in line:
62+
diff_MPI.append(float(line.split()[1]))
63+
64+
diff_nonMPI = []
65+
with open("step_6_B_out.txt") as f:
66+
for line in f:
67+
if "Diff" in line:
68+
diff_nonMPI.append(float(line.split()[1]))
69+
70+
assert len(diff_MPI) == len(diff_nonMPI), 'ERROR: got different number of results form MPI and nonMPI for odd ' \
71+
'distribution of time-steps'
72+
73+
for i, j in zip(diff_MPI, diff_nonMPI):
74+
assert abs(i - j) < 6E-11, 'ERROR: difference between MPI and nonMPI results is too large for odd ' \
75+
'distributions of time-steps, got %s' %abs(i - j)

0 commit comments

Comments
 (0)