Skip to content

Commit

Permalink
Add cp311 dummy eggs (#453)
Browse files Browse the repository at this point in the history
* Add dummy eggs for cp311
* Update test code to check the dummy cp311 eggs
* Add new cp311 eggs into the package
  • Loading branch information
itziakos authored Jun 29, 2023
1 parent 375ff97 commit f95752e
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 1 deletion.
32 changes: 32 additions & 0 deletions okonomiyaki/utils/test_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,35 @@
NOSE_1_3_4_OSX_X86_64_cp38,
MKL_10_3_OSX_X86_64_cp38,
NUMPY_1_9_2_OSX_X86_64_cp38]

# cp38 eggs for testing

_RH8_X86_64_cp311 = os.path.join(_HERE, "eggs", "rh8_x86_64", "cp311")

NOSE_1_3_4_RH7_X86_64_cp311 = os.path.join(_RH8_X86_64_cp311, "nose-1.3.4-1.egg")
MKL_10_3_RH7_X86_64_cp311 = os.path.join(_RH8_X86_64_cp311, "MKL-10.3-1.egg")
NUMPY_1_9_2_RH7_X86_64_cp311 = os.path.join(_RH8_X86_64_cp311, "numpy-1.9.2-1.egg")

_WIN_X86_64_cp311 = os.path.join(_HERE, "eggs", "win_x86_64", "cp311")

NOSE_1_3_4_WIN_X86_64_cp311 = os.path.join(_WIN_X86_64_cp311, "nose-1.3.4-1.egg")
MKL_10_3_WIN_X86_64_cp311 = os.path.join(_WIN_X86_64_cp311, "MKL-10.3-1.egg")
NUMPY_1_9_2_WIN_X86_64_cp311 = os.path.join(_WIN_X86_64_cp311, "numpy-1.9.2-1.egg")

_OSX_X86_64_cp311 = os.path.join(_HERE, "eggs", "osx_x86_64", "cp311")

NOSE_1_3_4_OSX_X86_64_cp311 = os.path.join(_OSX_X86_64_cp311, "nose-1.3.4-1.egg")
MKL_10_3_OSX_X86_64_cp311 = os.path.join(_OSX_X86_64_cp311, "MKL-10.3-1.egg")
NUMPY_1_9_2_OSX_X86_64_cp311 = os.path.join(_OSX_X86_64_cp311, "numpy-1.9.2-1.egg")


CP311_EGGS = [
NOSE_1_3_4_RH7_X86_64_cp311,
MKL_10_3_RH7_X86_64_cp311,
NUMPY_1_9_2_RH7_X86_64_cp311,
NOSE_1_3_4_WIN_X86_64_cp311,
MKL_10_3_WIN_X86_64_cp311,
NUMPY_1_9_2_WIN_X86_64_cp311,
NOSE_1_3_4_OSX_X86_64_cp311,
MKL_10_3_OSX_X86_64_cp311,
NUMPY_1_9_2_OSX_X86_64_cp311]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 24 additions & 1 deletion okonomiyaki/utils/tests/test_eggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from okonomiyaki.file_formats import EggMetadata
from okonomiyaki.platforms import PlatformABI

from ..test_data import CP38_EGGS, CP27_EGGS
from ..test_data import CP38_EGGS, CP27_EGGS, CP311_EGGS


class TestDummyEggs(unittest.TestCase):
Expand Down Expand Up @@ -34,6 +34,29 @@ def test_cp38_egg_metadata_valid(self, filepath):
self.assertEqual(metadata.platform_tag, 'linux_x86_64')
self.assertEqual(metadata.platform_abi, PlatformABI(u'gnu'))

@given(sampled_from(CP311_EGGS))
def test_cp311_egg_metadata_valid(self, filepath):
# when
metadata = EggMetadata.from_egg(filepath)
filepath = filepath.lower()

# then
if 'mkl' in metadata.name:
self.assertEqual(metadata.python_tag, None)
self.assertEqual(metadata.abi_tag, None)
else:
self.assertEqual(metadata.python_tag, 'cp311')
self.assertEqual(metadata.abi_tag, 'cp311')
if 'osx_x86_64' in filepath:
self.assertEqual(metadata.platform_tag, 'macosx_12_0_x86_64')
self.assertEqual(metadata.platform_abi, PlatformABI(u'darwin'))
elif 'win_x86_64' in filepath:
self.assertEqual(metadata.platform_tag, 'win_amd64')
self.assertEqual(metadata.platform_abi, PlatformABI(u'msvc2022'))
else:
self.assertEqual(metadata.platform_tag, 'linux_x86_64')
self.assertEqual(metadata.platform_abi, PlatformABI(u'gnu'))

@given(sampled_from(CP27_EGGS))
def test_cp27_egg_metadata_valid(self, filepath):
# when
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ okonomiyaki.utils.test_data =
eggs/rh5_x86_64/*.egg
eggs/rh6_x86_64/*.egg
eggs/rh7_x86_64/*.egg
eggs/rh8_x86_64/*.egg
eggs/win_x86_64/*.egg
eggs/osx_x86_64/cp38/*.egg
eggs/osx_x86_64/cp311/*.egg
eggs/rh5_x86_64/cp38/*.egg
eggs/rh6_x86_64/cp38/*.egg
eggs/rh7_x86_64/cp38/*.egg
eggs/rh8_x86_64/cp311/*.egg
eggs/win_x86_64/cp38/*.egg
eggs/win_x86_64/cp311/*.egg
wheels/*.whl

[options.extras_require]
Expand Down

0 comments on commit f95752e

Please sign in to comment.