diff --git a/.circleci/config.yml b/.circleci/config.yml index 4b46f08..233ca2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ jobs: python: working_directory: ~/repo docker: - - image: konstin2/pyo3-pack:0.5.0 + - image: konstin2/maturin:v0.8.2-alpha.1 steps: - checkout - run: @@ -54,11 +54,12 @@ jobs: - run: name: build-wheels command: | + set -ex cd python - for PYBIN in python3.{6,7}; do - "$PYBIN" -m pip install setuptools setuptools-rust>=0.10.2 - "$PYBIN" -m pip install numpy==1.15.0 scipy==1.1.0 + export PATH="$PATH:/opt/python/cp38-cp38m/bin/" + for PYBIN in python3.{6,7,8}; do "$PYBIN" -m pip install wheel==0.31.1 auditwheel==2.0.0 pytest hypothesis + "$PYBIN" -m pip install -r ../ci/requirements-build.txt "$PYBIN" setup.py bdist_wheel done for whl in dist/*.whl; do @@ -68,8 +69,10 @@ jobs: - run: name: test command: | + set -ex cd python - for PYBIN in python3.{6,7}; do + export PATH="$PATH:/opt/python/cp38-cp38m/bin/" + for PYBIN in python3.{6,7,8}; do "$PYBIN" -m pip uninstall -y vtext cd /tmp/ "$PYBIN" -m pip install --pre --no-index --find-links /root/repo/python/dist/ vtext diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 85da7f0..6a9f772 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,13 +4,17 @@ jobs: - template: ci/azure/posix.yml parameters: name: macOS - vmImage: xcode9-macos10.13 + vmImage: macOS-10.14 matrix: + py38: + PYTHON_VERSION: '3.8' + PYTHON_ARCH: '64' py37: PYTHON_VERSION: '3.7' + PYTHON_ARCH: '64' py36: PYTHON_VERSION: '3.6' - + PYTHON_ARCH: '64' - template: ci/azure/windows.yml parameters: diff --git a/ci/azure/install.cmd b/ci/azure/install.cmd index 625fa2f..cbd23e5 100644 --- a/ci/azure/install.cmd +++ b/ci/azure/install.cmd @@ -17,19 +17,19 @@ call activate %VIRTUALENV% python --version pip --version -@rem Use oldest supported numpy and scipy versions for building wheels -pip install numpy==1.15.0 scipy==1.1.0 pytest>=4.0.0 wheel>=0.31.1 hypothesis +pip install scipy==1.4.1 pytest>=4.0.0 wheel>=0.31.1 hypothesis curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --default-toolchain nightly-2019-11-01 set PATH=%PATH%;%USERPROFILE%\.cargo\bin echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" +rustup set default-host x86_64-pc-windows-gnu rustup default nightly-2019-11-01 @rem Install the build and runtime dependencies of the project. cd python/ -pip install -r requirements.txt +python -m pip install -r ..\ci\requirements-build.txt python setup.py bdist_wheel pip install pytest-faulthandler diff --git a/ci/azure/install.sh b/ci/azure/install.sh index 351842f..10acbfe 100755 --- a/ci/azure/install.sh +++ b/ci/azure/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -ex UNAMESTR=`uname` @@ -12,8 +12,7 @@ source activate $VIRTUALENV python --version pip --version -# Use oldest supported numpy, scipy versins for building wheels -pip install numpy==1.15.0 scipy==1.1.0 pytest>=4.0.0 wheel>=0.31.1 hypothesis +pip install scipy==1.1.0 pytest>=4.0.0 wheel>=0.31.1 hypothesis python -c "import numpy; print('numpy %s' % numpy.__version__)" python -c "import scipy; print('scipy %s' % scipy.__version__)" @@ -21,9 +20,10 @@ pip list curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2019-11-01 source $HOME/.cargo/env +rustup default nightly-2019-11-01 cd python/ -pip install -r requirements.txt +python -m pip install -r ../ci/requirements-build.txt python setup.py bdist_wheel pip install --pre --no-index --find-links dist/ vtext diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml index 9cb6372..a012e1a 100644 --- a/ci/azure/posix.yml +++ b/ci/azure/posix.yml @@ -20,6 +20,8 @@ jobs: steps: - bash: echo "##vso[task.prependpath]$CONDA/bin" displayName: Add conda to PATH + # fix permissions on MacOS + - script: sudo chown -R 501:20 /usr/local/miniconda/ - script: | ci/azure/install.sh displayName: 'Install' diff --git a/ci/requirements-build.txt b/ci/requirements-build.txt new file mode 100644 index 0000000..176871f --- /dev/null +++ b/ci/requirements-build.txt @@ -0,0 +1,5 @@ +setuptools +wheel +setuptools-rust +numpy==1.17.3 +scipy==1.4.1 diff --git a/python/pyproject.toml b/python/pyproject.toml index 31ffe04..dc1adc8 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,2 +1,9 @@ [build-system] -requires = ["setuptools", "wheel", "setuptools-rust"] +requires = [ + "setuptools", + "wheel", + "setuptools-rust", + "numpy==1.13.3; python_version=='3.6'", + "numpy==1.14.5; python_version=='3.7'", + "numpy==1.17.3; python_version>='3.8'", +] diff --git a/python/setup.py b/python/setup.py index 2b14f19..75ba2c8 100644 --- a/python/setup.py +++ b/python/setup.py @@ -16,7 +16,6 @@ rust_extensions=[ RustExtension( "vtext._lib", - "./Cargo.toml", rustc_flags=["--cfg=Py_3"], features=["numpy/python3"], args=["--no-default-features"],