diff --git a/.cruft.json b/.cruft.json deleted file mode 100644 index 250ced0..0000000 --- a/.cruft.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "template": "https://github.com/mkoeppe/sage", - "commit": "016c53ef397a9a3a764b467ab45de04f4284c0c8", - "checkout": "sagemath-environment-cookiecutter", - "context": { - "cookiecutter": { - "project_name": "pplpy", - "_template": "https://github.com/mkoeppe/sage" - } - }, - "directory": "pkgs/sage-project-cookiecutter/sage_project_cookiecutter/sagemath-upstream-package-template" -} diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 5346b22..1d02225 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -24,7 +24,7 @@ jobs: run: | python3 -m pip install build python3 -m build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v5 with: path: "dist/*.tar.gz" name: dist @@ -37,33 +37,22 @@ jobs: if: env.CAN_DEPLOY == 'true' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') build_wheels: - name: Build wheels on ${{ matrix.os }}, arch ${{ matrix.arch }} + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} needs: sdists_for_pypi strategy: fail-fast: false matrix: - include: - - os: ubuntu-latest - arch: x86_64 - - os: ubuntu-latest - arch: i686 - - os: macos-latest - arch: auto - - os: macos-14 - arch: auto + os: + - ubuntu-latest + - macos-latest + - ubuntu-24.04-arm + - macos-15-intel env: # SPKGs to install as system packages - SPKGS: _bootstrap _prereq + SPKGS: _bootstrap _prereq gmp mpfr mpc # Non-Python packages to install as spkgs TARGETS_PRE: gmp mpfr mpc ppl-ensure - # Disable building PyPy wheels on all platforms - # Disable musllinux until #33083 provides alpine package information - CIBW_SKIP: "pp* *-musllinux*" - # - CIBW_ARCHS: ${{ matrix.arch }} - # https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" # Environment during wheel build CIBW_ENVIRONMENT: "PATH=$(pwd)/local/bin:$PATH CPATH=$(pwd)/local/include:$CPATH LIBRARY_PATH=$(pwd)/local/lib:$LIBRARY_PATH LD_LIBRARY_PATH=$(pwd)/local/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/local/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal" # Use 'build', not 'pip wheel' @@ -74,7 +63,7 @@ jobs: repository: sagemath/sage ref: develop - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v6 with: name: dist path: dist @@ -84,7 +73,7 @@ jobs: # Installing pipx follows the approach of https://github.com/pypa/cibuildwheel/pull/1743 id: python with: - python-version: "3.8 - 3.12" + python-version: "3.12 - 3.14" update-environment: false - name: Build platform wheels @@ -97,16 +86,16 @@ jobs: run: | "${{ steps.python.outputs.python-path }}" -m pip install pipx export PATH=build/bin:$PATH - export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root --enable-fat-binary && MAKE=\"make -j6\" make V=0 $TARGETS_PRE" + export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || $(sage-print-system-package-command alpine --yes --no-install-recommends install $(sage-get-system-packages alpine $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root --enable-fat-binary --disable-meson-check --disable-boost && MAKE=\"make -j6\" make V=0 $TARGETS_PRE" mkdir -p unpacked for pkg in pplpy; do (cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz - "${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.17.0 unpacked/$pkg* + "${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==3.2.1 unpacked/$pkg* done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v5 with: - name: wheels + name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl pypi-publish: @@ -119,7 +108,7 @@ jobs: CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v6 with: name: wheels path: wheelhouse diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91bfa90..1c50c94 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,49 +11,49 @@ jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - cython: ["cython", "cython<3.0.0"] - exclude: - - python-version: 3.12 - cython: cython<3.0.0 + python: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v2 with: { submodules: recursive } - - uses: conda-incubator/setup-miniconda@v2 - with: { miniforge-variant: "Mambaforge", miniforge-version: "latest", python-version: "${{matrix.python-version}}" } - - name: Install pplpy dependencies - shell: bash -l {0} - run: | - mamba install --quiet setuptools cysignals ppl gmp mpfr mpc "${{matrix.cython}}" - - name: Install gmpy2 via mamba - shell: bash -l {0} - if: ${{ matrix.python-version != '3.12' }} - run: | - mamba install --quiet gmpy2 - python -c 'import gmpy2; print(gmpy2.version())' - - name: Install gmpy2 via pip + + - name: Setup Conda environment + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python }} + # Disabled for now due to + # https://github.com/conda-incubator/setup-miniconda/issues/379 + # miniforge-version: latest + use-mamba: true + channels: conda-forge + channel-priority: true + + - name: Install dependencies shell: bash -l {0} - if: ${{ matrix.python-version == '3.12' }} run: | - pip install --pre gmpy2==2.2.0a1 - python -c 'import gmpy2; print(gmpy2.version())' - - name: Install pplpy + conda install --quiet ppl gmp mpfr mpc + + - name: Build shell: bash -l {0} run: | - pip install --verbose --no-index --no-build-isolation . + pip install --verbose . + - name: Install test dependencies run: | - mamba env update --quiet -n test -f environment.test.yml + conda env update --quiet -n test -f environment.test.yml conda list - - name: Linter + + - name: Lint shell: bash -l {0} run: | cython-lint --ignore=E265,E266,E501,E741 --exclude='ppl_decl.pxd' ppl/ + - name: Run tests shell: bash -l {0} run: | python setup.py test + - name: Show logs run: grep "" /dev/null `find -name '*.log'` || true if: ${{ always() }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 7c4ee24..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -image: ubuntu:20.04 -before_script: -- export DEBIAN_FRONTEND=noninteractive # avoid tzdata interactive configuration -- apt-get -qq update -- apt-get install -y apt-utils git libgmp-dev libmpfr-dev libmpc-dev libppl-dev $PKGS -- $PYTHON --version -# NOTE: currently it seems not possible to build the sdist without manually installing -# dependencies. pyproject.toml is ignored by the call to 'setup.py sdist' below and the -# install_requires of setuptools is broken with Cython. -- $PYTHON -m pip install "gmpy2>=2.1.0b1" -- $PYTHON setup.py sdist -- $PYTHON -m pip -v install dist/pplpy-*.tar.gz - -python3: - stage: test - variables: - PYTHON: python3 - PKGS: python3 python3-dev python3-pip python3-setuptools python3-wheel python3-sphinx cython3 python3-cysignals-bare - script: - - $PYTHON setup.py test - - make -w -C docs html diff --git a/environment.test.yml b/environment.test.yml index 0fba3b2..ffefef3 100644 --- a/environment.test.yml +++ b/environment.test.yml @@ -5,6 +5,7 @@ channels: dependencies: - sphinx - pip + - setuptools - pip: - linkchecker - cython-lint diff --git a/ppl/mip_problem.pyx b/ppl/mip_problem.pyx index 2d0b737..daac7ff 100644 --- a/ppl/mip_problem.pyx +++ b/ppl/mip_problem.pyx @@ -72,7 +72,7 @@ cdef class MIP_Problem(object): >>> m.optimal_value() mpq(10,3) >>> float(_) - 3.333333333333333 + 3.3333333333333335 >>> m.optimizing_point() point(10/3, 0/3) """ diff --git a/pyproject.toml b/pyproject.toml index 5a92e93..dd6ae83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ description = "Python PPL wrapper" readme = "README.rst" authors = [{name = "Vincent Delecroix", email = "vincent.delecroix@labri.fr"}] license = {text = "GPL v3"} +requires-python = ">=3.12" classifiers = [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: C++", @@ -20,11 +21,11 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Operating System :: Unix", "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] keywords = [ "polyhedron", diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9d8533c..0000000 --- a/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py27, py36, py37, py38 -skip_missing_interpreters = true - -[testenv] -whitelist_externals = make -commands = - {envpython} setup.py test - make -w -C docs html