Skip to content

Commit 326cec2

Browse files
committed
Drop dependency on py
1 parent 8c45d6e commit 326cec2

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

newsfragments/4237.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop dependency on `py`. Bump ``pytest-xdist`` to ``>=3`` and use `pathlib` instead in tests -- by :user:`Avasam`

pkg_resources/tests/test_find_distributions.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import py
1+
from pathlib import Path
2+
import shutil
23
import pytest
34
import pkg_resources
45

56

6-
TESTS_DATA_DIR = py.path.local(__file__).dirpath('data')
7+
TESTS_DATA_DIR = Path(__file__).parent / 'data'
78

89

910
class TestFindDistributions:
@@ -19,21 +20,21 @@ def test_non_egg_dir_named_egg(self, target_dir):
1920
assert not list(dists)
2021

2122
def test_standalone_egg_directory(self, target_dir):
22-
(TESTS_DATA_DIR / 'my-test-package_unpacked-egg').copy(target_dir)
23+
shutil.copy(TESTS_DATA_DIR / 'my-test-package_unpacked-egg', target_dir)
2324
dists = pkg_resources.find_distributions(str(target_dir))
2425
assert [dist.project_name for dist in dists] == ['my-test-package']
2526
dists = pkg_resources.find_distributions(str(target_dir), only=True)
2627
assert not list(dists)
2728

2829
def test_zipped_egg(self, target_dir):
29-
(TESTS_DATA_DIR / 'my-test-package_zipped-egg').copy(target_dir)
30+
shutil.copy(TESTS_DATA_DIR / 'my-test-package_zipped-egg', target_dir)
3031
dists = pkg_resources.find_distributions(str(target_dir))
3132
assert [dist.project_name for dist in dists] == ['my-test-package']
3233
dists = pkg_resources.find_distributions(str(target_dir), only=True)
3334
assert not list(dists)
3435

3536
def test_zipped_sdist_one_level_removed(self, target_dir):
36-
(TESTS_DATA_DIR / 'my-test-package-zip').copy(target_dir)
37+
shutil.copy(TESTS_DATA_DIR / 'my-test-package-zip', target_dir)
3738
dists = pkg_resources.find_distributions(
3839
str(target_dir / "my-test-package.zip")
3940
)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ testing =
6161
pip>=19.1 # For proper file:// URLs support.
6262
packaging>=23.2
6363
jaraco.envs>=2.2
64-
pytest-xdist
64+
pytest-xdist>=3 # Dropped dependency on pytest-fork and py
6565
jaraco.path>=3.2.0
6666
build[virtualenv]
6767
filelock>=3.4.0

0 commit comments

Comments
 (0)