diff --git a/.github/workflows/ci-sage.yml b/.github/workflows/ci-sage.yml index 8aee2c8e..42e11342 100644 --- a/.github/workflows/ci-sage.yml +++ b/.github/workflows/ci-sage.yml @@ -59,10 +59,9 @@ env: TARGETS_PRE: build/make/Makefile TARGETS: SAGE_CHECK=no SAGE_CHECK_PACKAGES="cysignals,cypari" cysignals cypari TARGETS_OPTIONAL: build/make/Makefile - # Standard setting: Test the current beta release of Sage: - # Temporarily test with https://github.com/sagemath/sage/pull/36110 + # Standard setting: Test the current beta release of Sage SAGE_REPO: sagemath/sage - SAGE_REF: refs/pull/36110/merge + SAGE_REF: develop REMOVE_PATCHES: "*" jobs: @@ -106,29 +105,24 @@ jobs: with: submodules: recursive fetch-depth: 0 - - name: install cygwin and minimal prerequisites with choco + - name: Install cygwin and minimal prerequisites with choco shell: bash {0} run: | choco --version choco install make autoconf gcc-core gcc-g++ python3${{ matrix.python-version }}-devel --source cygwin - - name: install dependencies - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && python3.${{ matrix.python-version }} -m pip install -U --no-build-isolation -r requirements.txt' - - name: install + - name: Install dependencies run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && python3.${{ matrix.python-version }} setup.py build_ext -i' - - name: test + C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && python3.${{ matrix.python-version }} -m pip install --upgrade pip' + - name: Build and check run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make install PYTHON=python3.${{ matrix.python-version }}' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make check-all PYTHON=python3.${{ matrix.python-version }}' - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make distcheck PYTHON=python3.${{ matrix.python-version }}' + C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make check PYTHON=python3.${{ matrix.python-version }}' ubuntu-without-sage: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Set up the repository uses: actions/checkout@v4 @@ -142,15 +136,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -U --no-build-isolation -r requirements.txt - - name: Freeze pip + - name: Build and check run: | - pip freeze - - name: Local build - run: | - make -j4 install - make -j4 check-all - make -j4 distcheck + make -j4 check linux: uses: sagemath/sage/.github/workflows/docker.yml@develop @@ -210,15 +198,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -U --no-build-isolation -r requirements.txt - - name: Freeze pip - run: | - pip freeze - - name: Local build + - name: Build and check run: | - make -j4 install - make -j4 check-all - make -j4 distcheck + make -j4 check macos: uses: sagemath/sage/.github/workflows/macos.yml@develop diff --git a/Makefile b/Makefile index fa8dc522..f515cb81 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,11 @@ DOCTEST = $(PYTHON) -B rundoctests.py all: build doc build: configure - $(PYTHON) setup.py build + $(PIP) install build + $(PYTHON) -m build install: configure - $(PIP) install --no-build-isolation --no-index --ignore-installed --no-deps . + $(PIP) install . dist: configure $(PIP) install build @@ -56,9 +57,9 @@ distclean: clean test: check -check: check-tmp +check: check-all -check-all: check-tmp +check-all: $(MAKE) check-install # Install and check @@ -68,73 +69,13 @@ check-doctest: install $(DOCTEST) src/cysignals/*.pyx check-example: install - cd example && $(PYTHON) setup.py clean build + $(PYTHON) -m pip install -U build setuptools Cython + cd example && $(PYTHON) -m build --no-isolation . check-gdb: install $(PYTHON) testgdb.py -##################### -# Check installation -##################### -# -# Test 2 installation scenarios without a real installation -# - prefix (with --prefix and --root) -# - user (with --user) - -check-tmp: - $(MAKE) check-prefix - $(MAKE) check-user - -prefix-install: configure - rm -rf tmp/local tmp/build tmp/site-packages - $(PYTHON) setup.py install --prefix="`pwd`/tmp/local" --root=tmp/build - cd tmp && mv "build/`pwd`/local" local - cd tmp && cp -R local/lib*/python*/site-packages site-packages - -check-prefix: check-prefix-doctest check-prefix-example - -check-prefix-doctest: prefix-install - export PYTHONPATH="`pwd`/tmp/site-packages" && $(DOCTEST) src/cysignals/*.pyx - -check-prefix-example: prefix-install - rm -rf example/build - export PYTHONPATH="`pwd`/tmp/site-packages" && cd example && $(PYTHON) setup.py clean build - -check-user: check-user-doctest check-user-example - -user-install: configure - rm -rf tmp/user - export PYTHONUSERBASE="`pwd`/tmp/user" && $(PYTHON) setup.py install --user --old-and-unmanageable - -check-user-doctest: user-install - export PYTHONUSERBASE="`pwd`/tmp/user" && $(DOCTEST) src/cysignals/*.pyx - -check-user-example: user-install - export PYTHONUSERBASE="`pwd`/tmp/user" && cd example && $(PYTHON) setup.py clean build - -distcheck: dist - rm -rf dist/check - mkdir -p dist/check - cd dist/check && tar xzf ../cysignals-$(VERSION).tar.gz - cd dist/check/cysignals-$(VERSION) && $(LS_R) >../dist0.ls - cd dist/check/cysignals-$(VERSION) && $(MAKE) all - cd dist/check/cysignals-$(VERSION) && $(MAKE) distclean - cd dist/check/cysignals-$(VERSION) && $(LS_R) >../dist1.ls - cd dist/check; diff -u dist0.ls dist1.ls || { echo >&2 "Error: distclean after all leaves garbage"; exit 1; } - cd dist/check/cysignals-$(VERSION) && $(MAKE) check-user - cd dist/check/cysignals-$(VERSION) && ./configure --enable-debug - cd dist/check/cysignals-$(VERSION) && $(MAKE) check-prefix - cd dist/check/cysignals-$(VERSION) && $(MAKE) distclean - cd dist/check/cysignals-$(VERSION) && $(LS_R) >../dist2.ls - cd dist/check; diff -u dist0.ls dist2.ls || { echo >&2 "Error: distclean after check-tmp leaves garbage"; exit 1; } - cd dist/check/cysignals-$(VERSION) && $(MAKE) dist - cd dist/check/cysignals-$(VERSION) && tar xzf dist/cysignals-$(VERSION).tar.gz - cd dist/check/cysignals-$(VERSION)/cysignals-$(VERSION) && $(LS_R) >../../dist3.ls - cd dist/check; diff -u dist0.ls dist3.ls || { echo >&2 "Error: sdist is not reproducible"; exit 1; } - rm -rf dist/check - - ##################### # Maintain ##################### @@ -145,7 +86,5 @@ configure: configure.ac @rm -f src/config.h.in~ .PHONY: all build doc install dist doc clean clean-build clean-doc \ - distclean test check check-all check-tmp check-install \ - check-doctest check-example \ - check-prefix prefix-install check-prefix-doctest check-prefix-example \ - check-user user-install check-user-doctest check-user-example + distclean test check check-all check-install \ + check-doctest check-example diff --git a/example/pyproject.toml b/example/pyproject.toml new file mode 100644 index 00000000..5d7cd719 --- /dev/null +++ b/example/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ['setuptools', 'Cython>=0.28', 'cysignals'] +build-backend = "setuptools.build_meta" diff --git a/example/setup.py b/example/setup.py index c8be0016..9b53c8a8 100755 --- a/example/setup.py +++ b/example/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from setuptools import setup +from setuptools.extension import Extension from distutils.command.build import build as _build @@ -21,7 +22,6 @@ def cythonize(self, extensions): name="cysignals_example", version='1.0', license='Public Domain', - setup_requires=["cysignals"], - ext_modules=["cysignals_example.pyx"], + ext_modules=[Extension("*", ["cysignals_example.pyx"])], cmdclass=dict(build=build), )