Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions setuptools/tests/config/test_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import jaraco.path
import pytest
import tomli_w
from path import Path

import setuptools # noqa: F401 # force distutils.core to be patched
from setuptools.config.pyprojecttoml import (
Expand Down Expand Up @@ -363,7 +362,7 @@ def test_include_package_data_in_setuppy(tmp_path):
}
jaraco.path.build(files, prefix=tmp_path)

with Path(tmp_path):
with jaraco.path.DirectoryStack().context(tmp_path):
dist = distutils.core.run_setup("setup.py", {}, stop_after="config")

assert dist.get_name() == "myproj"
Expand Down
7 changes: 3 additions & 4 deletions setuptools/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from pathlib import Path

import path
import pytest

from . import contexts, environment
Expand Down Expand Up @@ -119,7 +118,7 @@ def setuptools_wheel(tmp_path_factory, request):
def venv(tmp_path, setuptools_wheel):
"""Virtual env with the version of setuptools under test installed"""
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'venv')
env.root = Path(tmp_path / 'venv')
env.create_opts = ['--no-setuptools', '--wheel=bundle']
# TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel
env.req = str(setuptools_wheel)
Expand All @@ -141,7 +140,7 @@ def venv(tmp_path, setuptools_wheel):
def venv_without_setuptools(tmp_path):
"""Virtual env without any version of setuptools installed"""
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'venv_without_setuptools')
env.root = Path(tmp_path / 'venv_without_setuptools')
env.create_opts = ['--no-setuptools', '--no-wheel']
env.ensure_env()
return env
Expand All @@ -151,7 +150,7 @@ def venv_without_setuptools(tmp_path):
def bare_venv(tmp_path):
"""Virtual env without any common packages installed"""
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'bare_venv')
env.root = Path(tmp_path / 'bare_venv')
env.create_opts = ['--no-setuptools', '--no-pip', '--no-wheel', '--no-seed']
env.ensure_env()
return env
10 changes: 5 additions & 5 deletions setuptools/tests/test_config_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import sys
from configparser import ConfigParser
from itertools import product
from pathlib import Path
from typing import cast

import jaraco.path
import pytest
from path import Path

import setuptools # noqa: F401 # force distutils.core to be patched
from setuptools.command.sdist import sdist
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_setupcfg_metadata(self, tmp_path, folder, opts):
assert dist.package_dir
package_path = find_package_path("pkg", dist.package_dir, tmp_path)
assert os.path.exists(package_path)
assert folder in Path(package_path).parts()
assert folder in Path(package_path).parts

_run_build(tmp_path, "--sdist")
dist_file = tmp_path / "dist/pkg-42.tar.gz"
Expand Down Expand Up @@ -618,7 +618,7 @@ def _get_dist(dist_path, attrs):

script = dist_path / 'setup.py'
if script.exists():
with Path(dist_path):
with jaraco.path.DirectoryStack().context(dist_path):
dist = cast(
Distribution,
distutils.core.run_setup("setup.py", {}, stop_after="init"),
Expand All @@ -628,7 +628,7 @@ def _get_dist(dist_path, attrs):

dist.src_root = root
dist.script_name = "setup.py"
with Path(dist_path):
with jaraco.path.DirectoryStack().context(dist_path):
dist.parse_config_files()

dist.set_defaults()
Expand All @@ -641,7 +641,7 @@ def _run_sdist_programatically(dist_path, attrs):
cmd.ensure_finalized()
assert cmd.distribution.packages or cmd.distribution.py_modules

with quiet(), Path(dist_path):
with quiet(), jaraco.path.DirectoryStack().context(dist_path):
cmd.run()

return dist, cmd
6 changes: 3 additions & 3 deletions setuptools/tests/test_editable_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
from unittest.mock import Mock
from uuid import uuid4

import jaraco.envs
import jaraco.path
import pytest
from path import Path as _Path

from setuptools._importlib import resources as importlib_resources
from setuptools.command.editable_wheel import (
Expand Down Expand Up @@ -565,6 +563,8 @@ def test_combine_namespaces_nested(self, tmp_path):
self.install_finder(code)
mod1 = import_module("different_name.my_module")
mod2 = import_module("different_name.subpkg.my_module2")
assert mod1.__file__ is not None
assert mod2.__file__ is not None

expected = str((tmp_path / "src/my_package/my_module.py").resolve())
assert str(Path(mod1.__file__).resolve()) == expected
Expand Down Expand Up @@ -972,7 +972,7 @@ class TestLinkTree:
def test_generated_tree(self, tmp_path):
jaraco.path.build(self.FILES, prefix=tmp_path)

with _Path(tmp_path):
with jaraco.path.DirectoryStack().context(tmp_path):
name = "mypkg-3.14159"
dist = Distribution({"script_name": "%PEP 517%"})
dist.parse_config_files()
Expand Down
2 changes: 1 addition & 1 deletion tools/vendored.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import functools
import re
import subprocess
from pathlib import Path

import jaraco.packaging.metadata
from path import Path


def remove_all(paths):
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ commands =
[testenv:vendor]
skip_install = True
deps =
path
jaraco.packaging
# workaround for pypa/pyproject-hooks#192
pyproject-hooks!=1.1
Expand Down
Loading