Skip to content

Commit

Permalink
Run tests on Python 3.12 (#477)
Browse files Browse the repository at this point in the history
* Run tests on Python 3.12
* Update setup.cfg
* Update code to work with Python 3.12
* Try to fix the pep425_impl code
* Update windows default_abi behaviour to match linux and macos
* Fix package version module
* This is still a dev version
  • Loading branch information
itziakos authored Aug 23, 2024
1 parent e1ca185 commit aa14161
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
tests:
strategy:
matrix:
python-version: [3.6, 3.8, 3.11]
python-version: [3.6, 3.8, 3.11, 3.12]
os: [ubuntu-20.04, macos-12, macos-latest, windows-2019]
exclude:
- os: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.0.0.dev
10 changes: 2 additions & 8 deletions okonomiyaki/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Copyright (c) 2013 by Enthought, Inc.
# Copyright (c) 2013-2024 by Enthought, Inc.
# All rights reserved.
try:
from ._version import (
version as __version__, version_info as __version_info__
)
except ImportError:
__version__ = "unknown"
__version_info__ = (0, 0, 0, "unknown", 0)
from ._version import __version__ # noqa
22 changes: 14 additions & 8 deletions okonomiyaki/platforms/_pep425_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,21 @@ def _is_running_32bit():
def get_platform():
import distutils.util
import platform
"""Return our platform name 'win32', 'linux_x86_64'"""
result = distutils.util.get_platform().replace('.', '_').replace('-', '_')
if result == "linux_x86_64" and _is_running_32bit():
# 32 bit Python program (running on a 64 bit Linux): pip should only
# install and run 32 bit compiled extensions in that case.
result = "linux_i686"
try:
import distutils.util
except ImportError:
import sysconfig
result = sysconfig.get_platform().replace(".", "_").replace("-", "_")
else:
result = distutils.util.get_platform().replace('.', '_').replace('-', '_')
if _is_running_32bit():
# 32 bit Python program (running on a 64 bit Linux): pip should only
# install and run 32 bit compiled extensions in that case.
if result == "linux_x86_64":
result = "linux_i686"
elif result == "linux_aarch64":
result = "linux_armv71"
return result
Expand Down
2 changes: 1 addition & 1 deletion okonomiyaki/platforms/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _default_cpython_abi(platform, implementation_version):
abi = u"msvc2015"
elif implementation_version.minor <= 8:
abi = u"msvc2019"
elif implementation_version.minor <= 11:
else:
abi = u"msvc2022"

if abi is None:
Expand Down
1 change: 0 additions & 1 deletion okonomiyaki/platforms/tests/test_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def test_basics(self, platform, implementation, version, expected):
self.assertEqual(abi, expected)

@parameterized.expand([
("win_x86", "cpython", "3.12.0+1"),
("win_x86", "pypy", "4.1.0+1"),
("rh5_x86_64", "r", "3.0.0+1")])
def test_non_supported(self, *arguments):
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classifier =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12

[bdist_wheel]
universal = 1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

HERE = Path(__file__).parent
version = (HERE / 'VERSION').read_text().strip()
filename = (HERE / 'okonomiyaki' / 'version.py').write_text(f'__version__ = "{version}"\n')
filename = (HERE / 'okonomiyaki' / '_version.py').write_text(f'__version__ = "{version}"\n')

setup()

0 comments on commit aa14161

Please sign in to comment.