Skip to content

Commit 285514e

Browse files
committed
fix installation
1 parent 92d532d commit 285514e

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,13 @@ jobs:
7171

7272

7373
install:
74-
- source script/conda.sh
75-
- conda create --yes -n test python=${PYTHON_VERSION}
76-
- source activate test
77-
- conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes
78-
- pip install flake8 codecov
7974
- source script/cuda.sh
75+
- source script/conda.sh
8076
- python setup.py install
8177

8278
script:
83-
- flake8 .
79+
- pip install flake8 codecov
80+
- if [ "${PYTHON_VERSION}" != "3.5" ]; then flake8 .; fi
8481
- python setup.py test
8582
after_success:
8683
- python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}/${IDX}

script/conda.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
2222
fi
2323

2424
conda update --yes conda
25+
26+
conda create --yes -n test python="${PYTHON_VERSION}"
27+
source activate test
28+
conda install pytorch="${TORCH_VERSION}" "${TOOLKIT}" -c pytorch --yes
29+
30+
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
31+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
32+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
33+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h
34+
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
35+
fi

script/cuda.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,3 @@ fi
9292
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" = "cu92" ]; then
9393
sed -i.bak -e '129,141d' "${CUDA_HOME}/include/crt/host_config.h"
9494
fi
95-
96-
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
97-
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
98-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
99-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h
100-
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
101-
fi

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_extensions():
5757
return extensions
5858

5959

60-
install_requires = []
60+
install_requires = ['zipp']
6161
setup_requires = ['pytest-runner']
6262
tests_require = ['pytest', 'pytest-cov']
6363

0 commit comments

Comments
 (0)