Skip to content

Commit

Permalink
ci: add Python 3.12 alpha 7+ (#922)
Browse files Browse the repository at this point in the history
ci: try adding Python 3.12

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Apr 10, 2023
1 parent 19de102 commit 6df6d57
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Setup nox
uses: wntrblm/nox@2022.11.21
with:
python-versions: "3.7,3.8,3.9,3.10,3.11"
python-versions: "3.7,3.8,3.9,3.10,3.11,3.12-dev"

# We check all Python's on Linux, because it's fast.
# We check minimum Python and maximum Python on all OS's.
Expand All @@ -76,8 +76,12 @@ jobs:
run: nox -s tests-3.9
- name: Test on 🐍 3.10
run: nox -s tests-3.10
if: runner.os == 'Linux'
- name: Test on 🐍 3.11
run: nox -s tests-3.11
- name: Test on 🐍 3.12
run: nox -s tests-3.12
if: runner.os == 'Linux'

cygwin:
name: Tests on 🐍 3.9 • cygwin
Expand Down
33 changes: 17 additions & 16 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,34 @@ tests on Linux. This release requires Python 3.7+.
Bug fixes
---------

* Match setuptools behavior for ``include_package_data`` default. by :user:`vyasr` in :pr:`873`
* Misc. fixes for F2PY and PythonExtensions modules by :user:`benbovy` in :pr:`495`
* Provide more useful error if user provides ``CMAKE_INSTALL_PREFIX`` by :user:`vyasr` in :pr:`872`
* Stop assuming that ``.pyx`` files are in the same directory as ``CMakeLists.txt`` by :user:`vyasr` in :pr:`871`
* Allow build type overriding in :pr:`902`
* Detect PyPy library correctly on Windows by user:`gershnik` in :pr:`904`
* Match setuptools behavior for ``include_package_data`` default. by :user:`vyasr` in :pr:`873`.
* Misc. fixes for F2PY and PythonExtensions modules by :user:`benbovy` in :pr:`495`.
* Provide more useful error if user provides ``CMAKE_INSTALL_PREFIX`` by :user:`vyasr` in :pr:`872`.
* Stop assuming that ``.pyx`` files are in the same directory as ``CMakeLists.txt`` by :user:`vyasr` in :pr:`871`.
* Allow build type overriding in :pr:`902`.
* Detect PyPy library correctly on Windows by user:`gershnik` in :pr:`904`.
* Include library for FindPython for better Windows cross-compiles in :pr:`913`. Thanks to user:`maxbachmann` for testing.
* Fix logic for default generator when cross-compiling for ARM on Windows in :pr:`917` by :user:`dlech`.
* Use f2py's ``get_include`` if present in :pr:`877`
* Fix support for cross-compilation exception using ``targetLinkLibrariesWithDynamicLookup`` by :user:`erykoff` in :pr:`901`
* Use f2py's ``get_include`` if present in :pr:`877`.
* Fix support for cross-compilation exception using ``targetLinkLibrariesWithDynamicLookup`` by :user:`erykoff` in :pr:`901`.
* Treat empty ``MACOSX_DEPLOYMENT_TARGET`` as if it was unset in :pr:`918`.

Testing
-------

* Add hello fortran sample package + tests by :user:`benbovy` in :pr:`493`
* Add sdist check & fix in :pr:`906`
* Fix some setuptools types in :pr:`888`
* Add PyPy Win & macOS to the CI in :pr:`907`
* Add hello fortran sample package + tests by :user:`benbovy` in :pr:`493`.
* Add sdist check & fix in :pr:`906`.
* Fix some setuptools types in :pr:`888`.
* Add PyPy Win & macOS to the CI in :pr:`907`.
* Add tests for Python 3.12 Linux alphas in :pr:`922`.

Miscellaneous
-------------

* Drop Python 3.6 in :pr:`862`
* Move building backend to hatchling in :pr:`870`
* Avoid mutating function input parameters in :pr:`899`
* Use _compat/typing name in :pr:`869`
* Drop Python 3.6 in :pr:`862`.
* Move building backend to hatchling in :pr:`870`.
* Avoid mutating function input parameters in :pr:`899`.
* Use _compat/typing name in :pr:`869`.

.. END-BRIEF-CHANGELOG
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

nox.options.sessions = ["lint", "tests"]

PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9"]
PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.7", "pypy3.8", "pypy3.9"]
MSVC_ALL_VERSIONS = {"2017", "2019", "2022"}

if os.environ.get("CI", None):
Expand Down Expand Up @@ -40,7 +40,7 @@ def tests(session: nox.Session) -> None:
contained = "1" if version in known_MSVC else "0"
env[f"SKBUILD_TEST_FIND_VS{version}_INSTALLATION_EXPECTED"] = contained

numpy = [] if "pypy" in session.python else ["numpy"]
numpy = [] if "pypy" in session.python or "3.12" in session.python else ["numpy"]

# Latest versions may break things, so grab them for testing!
session.install("-U", "setuptools", "wheel")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ filterwarnings = [
'default:shell/Perl-style subs.* are deprecated:DeprecationWarning',
'default:subprocess .* is still running:ResourceWarning',
'ignore: pkg_resources is deprecated as an API:DeprecationWarning',
'ignore:onerror argument is deprecated, use onexc instead:DeprecationWarning', # Caused by wheel and Python 3.12
]
log_cli_level = "info"
markers = [
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

@pytest.fixture(scope="session")
def pep518_wheelhouse(tmpdir_factory):
numpy = ["numpy"] if sys.version_info < (3, 12) else []
wheelhouse = tmpdir_factory.mktemp("wheelhouse")
dist = tmpdir_factory.mktemp("dist")
subprocess.run([sys.executable, "-m", "build", "--wheel", "--outdir", str(dist)], cwd=BASE, check=True)
Expand All @@ -43,7 +44,7 @@ def pep518_wheelhouse(tmpdir_factory):
"wheel",
"ninja",
"cmake",
"numpy",
*numpy,
],
check=True,
)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
platform.python_implementation() == "PyPy" and sys.version_info >= (3, 9),
reason="NumPy not released for PyPy 3.9 yet",
)
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="NumPy not released for Python 3.12 yet",
)
@pytest.mark.usefixtures("pep518")
def test_pep518_findpython():
subprocess.run([sys.executable, "-m", "build", "--wheel"], cwd=HELLO_NUMPY, check=True)

0 comments on commit 6df6d57

Please sign in to comment.