Skip to content

CI: Run tests in Cygwin for Cygwin CI #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ENH: Get tests passing on Cygwin.
There are a few other ways these changes could be made
Tweak the regex to accept different file extensions
Combine the Windows and Cygwin paths for adding .dll.a files
  • Loading branch information
DWesl committed Nov 12, 2022
commit b0f12d167944cb4489a04271cfc6ef45f53e4666
8 changes: 6 additions & 2 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def _init_colors() -> Dict[str, str]:


_LINUX_NATIVE_MODULE_REGEX = re.compile(r'^(?P<name>.+)\.(?P<tag>.+)\.so$')
_CYGWIN_NATIVE_MODULE_REGEX = re.compile(r'^(?P<name>.+)\.(?P<tag>.+)\.dll$')
_WINDOWS_NATIVE_MODULE_REGEX = re.compile(r'^(?P<name>.+)\.(?P<tag>.+)\.pyd$')
_STABLE_ABI_TAG_REGEX = re.compile(r'^abi(?P<abi_number>[0-9]+)$')

Expand Down Expand Up @@ -292,7 +293,7 @@ def _calculate_file_abi_tag_heuristic_posix(self, filename: str) -> Optional[mes
# preventive and check its value to make sure it matches our expectations
try:
extension = sysconfig.get_config_vars().get('SHLIB_SUFFIX', '.so')
if extension != '.so':
if extension not in ('.so', '.dll'):
raise NotImplementedError(
f"We don't currently support the {extension} extension. "
'Please report this to https://github.com/FFY00/mesonpy/issues '
Expand All @@ -305,7 +306,10 @@ def _calculate_file_abi_tag_heuristic_posix(self, filename: str) -> Optional[mes
'Please report this to https://github.com/FFY00/mesonpy/issues '
'and include the output of `python -m sysconfig`.'
)
match = _LINUX_NATIVE_MODULE_REGEX.match(filename)
if sys.platform == 'cygwin':
match = _CYGWIN_NATIVE_MODULE_REGEX.match(filename)
else:
match = _LINUX_NATIVE_MODULE_REGEX.match(filename)
if not match: # this file does not appear to be a native module
return None
tag = match.group('tag')
Expand Down
5 changes: 4 additions & 1 deletion tests/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_scipy_like(wheel_scipy_like):
'mypkg/submod/__init__.py',
'mypkg/submod/unknown_filetype.npq',
}
if os.name == 'nt':
if os.name == 'nt' or sys.platform == 'cygwin':
# Currently Meson is installing `.dll.a` (import libraries) next to
# `.pyd` extension modules. Those are very small, so it's not a major
# issue - just sloppy. For now, ensure we don't fail on those
Expand Down Expand Up @@ -154,6 +154,8 @@ def test_purelib_and_platlib(wheel_purelib_and_platlib):
}
if platform.system() == 'Windows':
expecting.add('plat{}'.format(EXT_SUFFIX.replace('pyd', 'dll.a')))
elif sys.platform == 'cygwin':
expecting.add('plat{}'.format(EXT_SUFFIX.replace('dll', 'dll.a')))

assert wheel_contents(artifact) == expecting

Expand Down Expand Up @@ -216,6 +218,7 @@ def test_executable_bit(wheel_executable_bit):
executable_files = {
'executable_bit-1.0.0.data/purelib/executable_module.py',
'executable_bit-1.0.0.data/scripts/example',
'executable_bit-1.0.0.data/scripts/example.exe',
'executable_bit-1.0.0.data/scripts/example-script',
'executable_bit-1.0.0.data/data/bin/example-script',
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy