Skip to content

Commit

Permalink
TST: drop workaround for Cython bug fixed in version 0.29.34
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Apr 19, 2023
1 parent e5b2e15 commit d05cf79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
19 changes: 0 additions & 19 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# SPDX-License-Identifier: MIT

import atexit
import contextlib
import os
import os.path
Expand Down Expand Up @@ -75,24 +74,6 @@ def tmp_path_session(tmp_path_factory):
))


@pytest.fixture
def tmp_build_path():
# Similar to the tmp_path fixture but ensures that the temporary
# directory is on the same Windows drive as the test packages
# source directory. This is required to work around a Cython bug
# exposed in our test packages. See https://github.com/cython/cython/pull/5279
tmpdir = tempfile.mkdtemp(prefix='.build-', dir=package_dir)
# The clenup is implemented with an atexit hook rather than with a
# regular context manager because we import extension modules from
# the build directory in the tests and these need to stay around
# till the Python interpreter is being teared down. Orherwise
# PermissionError removing the folder are obtained on Windows, but
# more importantly, the removal succeeds on Cygwin but memory
# mapping errors are obtained when Python tries to fork().
atexit.register(shutil.rmtree, tmpdir, ignore_errors=True)
yield pathlib.Path(tmpdir)


class VEnv(EnvBuilder):
def __init__(self, env_dir):
super().__init__(with_pip=True)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def test_collect(package_complex):
assert tree['complex']['more']['__init__.py'] == os.path.join(root, 'complex', 'more', '__init__.py')


def test_mesonpy_meta_finder(package_complex, tmp_build_path):
def test_mesonpy_meta_finder(package_complex, tmp_path):
# build a package in a temporary directory
mesonpy.Project(package_complex, tmp_build_path)
build_path = tmp_build_path / 'build'
mesonpy.Project(package_complex, tmp_path)
build_path = tmp_path / 'build'

# point the meta finder to the build directory
finder = _editable.MesonpyMetaFinder({'complex'}, os.fspath(build_path), ['ninja'])
Expand Down

0 comments on commit d05cf79

Please sign in to comment.