From b240b3f2724c308c8263a0ee6fe564420f0214a7 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Thu, 11 Jul 2024 14:55:17 +0200 Subject: [PATCH] Relax numpy constraints (#88) * relax numpy constraints * relax numpy constraints * CI * ci * ci * ci * ci --- .github/workflows/python-module.yml | 39 +++++++++++++++-------------- python/Dockerfile | 4 +-- python/requirements.txt | 3 +-- python/setup.py | 7 +----- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/python-module.yml b/.github/workflows/python-module.yml index 76ed96a..2dca66f 100644 --- a/.github/workflows/python-module.yml +++ b/.github/workflows/python-module.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: wheels + name: wheels-lin path: ./python/dist/*.whl - name: Make sdist @@ -61,11 +61,11 @@ jobs: path: ./python/dist/*.tar.gz build_mac: - runs-on: macos-12 + runs-on: macos-13 strategy: max-parallel: 4 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -83,7 +83,7 @@ jobs: run: | cd python export PATH=$PATH:$HOME/.cargo/bin - pip install wheel + pip install wheel setuptools python setup.py bdist_wheel -p macosx-10.9-universal2 pip install dist/*.whl - name: Test @@ -93,9 +93,9 @@ jobs: pip install pytest pytest tests - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-mac-py${{ matrix.python-version }} path: ./python/dist/*.whl build_win: @@ -106,18 +106,18 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} architecture: "x64" # (x64 or x86) - name: Build run: | cd python - pip install wheel + pip install wheel setuptools python setup.py bdist_wheel -p $(python -c "import distutils.util; print(distutils.util.get_platform())") pip install dist/*.whl - name: Test @@ -133,9 +133,9 @@ jobs: python -c "import wkw" pytest tests -k "not big_read" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-win-py${{ matrix.python-version }} path: ./python/dist/*.whl publish: @@ -147,20 +147,21 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.event.ref, 'refs/tags') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: "0" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Get wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: wheels + pattern: wheels-* + merge-multiple: true path: dist - name: Get tar.gz - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: targz path: dist diff --git a/python/Dockerfile b/python/Dockerfile index 783b7fa..8ee5138 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -3,7 +3,7 @@ FROM quay.io/pypa/manylinux2014_x86_64 ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - PYBIN=/opt/python/cp37-cp37m/bin + PYBIN=/opt/python/cp312-cp312/bin RUN git config --global --add safe.directory /app @@ -13,7 +13,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y; \ cargo --version; \ rustc --version; -RUN for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311}/bin; do \ +RUN for PYBIN in /opt/python/{cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312}/bin; do \ echo "--> $PYBIN"; \ $PYBIN/pip install \ numpy \ diff --git a/python/requirements.txt b/python/requirements.txt index c9cdf63..537dd6e 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,3 +1,2 @@ cffi -numpy>=1.15,==1.* -numpy<1.22; python_version < '3.8' +numpy>=1.15 diff --git a/python/setup.py b/python/setup.py index 9968a83..2ec5700 100644 --- a/python/setup.py +++ b/python/setup.py @@ -88,11 +88,6 @@ def run(self): packages=find_packages(), include_package_data=True, license="MIT", - install_requires=["cffi", "numpy>=1.15,==1.*"], - extras_require={ - ':python_version < "3.8"': [ - "numpy<1.22", - ], - }, + install_requires=["cffi", "numpy>=1.15"], cmdclass={"build_py": BuildPyCommand}, )