Skip to content

Commit 44ddbbe

Browse files
authored
Merge pull request #153 from ndem0/py3
Add Python3 compatibility
2 parents 95759ac + b392d5e commit 44ddbbe

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

.travis.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ matrix:
1010
- os: linux
1111
python: 2.7
1212
env: TOXENV=py27
13+
- os: linux
14+
python: 3.6
15+
env: TOXENV=py36
1316
- os: osx
1417
language: generic
1518
env: TOXENV=py27
19+
- os: osx
20+
language: generic
21+
env: TOXENV=py36
1622

1723
before_script:
1824
- "export DISPLAY=:99.0"
@@ -24,13 +30,20 @@ before_script:
2430
before_install:
2531
# We do this conditionally because it saves us some downloading if the
2632
# version is the same.
27-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
28-
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
29-
else
33+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
34+
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
35+
fi
36+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
37+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
38+
fi
39+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
3040
brew update;
3141
brew install python;
32-
python --version;
33-
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
42+
if [[ "$TOXENV" == "py27" ]]; then
43+
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
44+
else
45+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
46+
fi
3447
fi
3548
- chmod +x miniconda.sh
3649
- bash miniconda.sh -b -p $HOME/miniconda
@@ -46,11 +59,19 @@ install:
4659
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
4760
conda create --yes -n test python=$TRAVIS_PYTHON_VERSION;
4861
else
49-
conda create --yes -n test python="2.7";
62+
if [[ "$TOXENV" == "py27" ]]; then
63+
conda create --yes -n test python="2.7";
64+
else
65+
conda create --yes -n test python="3.6";
66+
fi
5067
fi
5168
- source activate test
5269
- pip install numpy scipy matplotlib vtk nose
53-
- conda install --yes -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core==0.17.3 python=2
70+
- if [[ "$TOXENV" == "py27" ]]; then
71+
conda install --yes -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core=0.17 python=2.7;
72+
else
73+
conda install --yes -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core=0.17 python=3.6;
74+
fi
5475
- pip install setuptools
5576
- pip install coveralls
5677
- pip install coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ See the [**Examples**](#examples) section below and the [**Tutorials**](tutorial
4848

4949

5050
## Dependencies and installation
51-
**PyGeM** requires `numpy`, `scipy`, `matplotlib`, `vtk`, `numpy-stl`, `sphinx` (for the documentation) and `nose` (for local test). They can be easily installed via `pip`. The code is compatible with Python 2.7.
51+
**PyGeM** requires `numpy`, `scipy`, `matplotlib`, `vtk`, `numpy-stl`, `sphinx` (for the documentation) and `nose` (for local test). They can be easily installed via `pip`. The code is compatible with Python 2.7 and Python 3.6.
5252
Moreover **PyGeM** depends on `OCC`. These requirements cannot be satisfied through `pip`.
5353
Please see the table below for instructions on how to satisfy the requirements.
5454

pygem/nurbshandler.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def combine_faces(compshape, sew_tolerance):
597597
shell = topods.Shell(shell)
598598
shell_fixer = ShapeFix_Shell()
599599
shell_fixer.FixFaceOrientation(shell)
600-
600+
"""
601601
if shell_fixer.Perform():
602602
print("{} shells fixed! ".format(shell_fixer.NbShells()))
603603
else:
@@ -609,7 +609,7 @@ def combine_faces(compshape, sew_tolerance):
609609
print "Shell valid! "
610610
else:
611611
print "Shell failed! "
612-
612+
"""
613613
return new_shell
614614

615615
def write_shape(self, l_shells, filename, tol):
@@ -663,8 +663,9 @@ def write_shape(self, l_shells, filename, tol):
663663
# add the new shell to the global compound
664664
global_compound_builder.Add(global_comp, new_shell)
665665

666-
print("Shell {0} of type {1} Processed ".format(ishell, itype))
667-
print "=============================================="
666+
# TODO
667+
#print("Shell {0} of type {1} Processed ".format(ishell, itype))
668+
#print "=============================================="
668669

669670
ishell += 1
670671
shape_shells_explorer.Next()

0 commit comments

Comments
 (0)