Skip to content
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

[pre-commit.ci] pre-commit autoupdate #2723

Merged
merged 2 commits into from
May 13, 2024
Merged
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
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
rev: 0.28.3
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
Expand All @@ -20,12 +20,11 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.8.0"
rev: "2.0.4"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.3"
rev: "v0.4.4"
hooks:
- id: ruff-format
- id: ruff
Expand Down
88 changes: 54 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ keywords = [
"virtual",
]
license = "MIT"
maintainers = [{ name = "Bernat Gabor", email = "[email protected]" }]
maintainers = [
{ name = "Bernat Gabor", email = "[email protected]" },
]
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -31,7 +33,6 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
Expand All @@ -44,7 +45,7 @@ dynamic = [
dependencies = [
"distlib<1,>=0.3.7",
"filelock<4,>=3.12.2",
'importlib-metadata>=6.6; python_version < "3.8"',
"importlib-metadata>=6.6; python_version<'3.8'",
"platformdirs<5,>=3.9.1",
]
optional-dependencies.docs = [
Expand All @@ -63,50 +64,57 @@ optional-dependencies.test = [
"packaging>=23.1",
"pytest>=7.4",
"pytest-env>=0.8.2",
'pytest-freezer>=0.4.8; platform_python_implementation == "PyPy"',
"pytest-freezer>=0.4.8; platform_python_implementation=='PyPy'",
"pytest-mock>=3.11.1",
"pytest-randomly>=3.12",
"pytest-timeout>=2.1",
"setuptools>=68",
'time-machine>=2.10; platform_python_implementation == "CPython"',
"time-machine>=2.10; platform_python_implementation=='CPython'",
]
urls.Documentation = "https://virtualenv.pypa.io"
urls.Homepage = "https://github.com/pypa/virtualenv"
urls.Source = "https://github.com/pypa/virtualenv"
urls.Tracker = "https://github.com/pypa/virtualenv/issues"
scripts.virtualenv = "virtualenv.__main__:run_with_catch"
[project.entry-points."virtualenv.activate"]
bash = "virtualenv.activation.bash:BashActivator"
batch = "virtualenv.activation.batch:BatchActivator"
cshell = "virtualenv.activation.cshell:CShellActivator"
fish = "virtualenv.activation.fish:FishActivator"
nushell = "virtualenv.activation.nushell:NushellActivator"
powershell = "virtualenv.activation.powershell:PowerShellActivator"
python = "virtualenv.activation.python:PythonActivator"
[project.entry-points."virtualenv.create"]
cpython3-mac-brew = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsBrew"
cpython3-mac-framework = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsFramework"
cpython3-posix = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Posix"
cpython3-win = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Windows"
pypy3-posix = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:PyPy3Posix"
pypy3-win = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:Pypy3Windows"
venv = "virtualenv.create.via_global_ref.venv:Venv"
[project.entry-points."virtualenv.discovery"]
builtin = "virtualenv.discovery.builtin:Builtin"
[project.entry-points."virtualenv.seed"]
app-data = "virtualenv.seed.embed.via_app_data.via_app_data:FromAppData"
pip = "virtualenv.seed.embed.pip_invoke:PipInvoke"
entry-points."virtualenv.activate".bash = "virtualenv.activation.bash:BashActivator"
entry-points."virtualenv.activate".batch = "virtualenv.activation.batch:BatchActivator"
entry-points."virtualenv.activate".cshell = "virtualenv.activation.cshell:CShellActivator"
entry-points."virtualenv.activate".fish = "virtualenv.activation.fish:FishActivator"
entry-points."virtualenv.activate".nushell = "virtualenv.activation.nushell:NushellActivator"
entry-points."virtualenv.activate".powershell = "virtualenv.activation.powershell:PowerShellActivator"
entry-points."virtualenv.activate".python = "virtualenv.activation.python:PythonActivator"
entry-points."virtualenv.create".cpython3-mac-brew = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsBrew"
entry-points."virtualenv.create".cpython3-mac-framework = "virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsFramework"
entry-points."virtualenv.create".cpython3-posix = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Posix"
entry-points."virtualenv.create".cpython3-win = "virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Windows"
entry-points."virtualenv.create".pypy3-posix = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:PyPy3Posix"
entry-points."virtualenv.create".pypy3-win = "virtualenv.create.via_global_ref.builtin.pypy.pypy3:Pypy3Windows"
entry-points."virtualenv.create".venv = "virtualenv.create.via_global_ref.venv:Venv"
entry-points."virtualenv.discovery".builtin = "virtualenv.discovery.builtin:Builtin"
entry-points."virtualenv.seed".app-data = "virtualenv.seed.embed.via_app_data.via_app_data:FromAppData"
entry-points."virtualenv.seed".pip = "virtualenv.seed.embed.pip_invoke:PipInvoke"

[tool.hatch]
build.hooks.vcs.version-file = "src/virtualenv/version.py"
build.targets.sdist.include = ["/src", "/tests", "/tasks", "/tox.ini"]
build.targets.sdist.include = [
"/src",
"/tests",
"/tasks",
"/tox.ini",
]
version.source = "vcs"

[tool.ruff]
line-length = 120
target-version = "py37"
lint.isort = { known-first-party = ["virtualenv"], required-imports = ["from __future__ import annotations"] }
lint.select = ["ALL"]
lint.isort = { known-first-party = [
"virtualenv",
], required-imports = [
"from __future__ import annotations",
] }
lint.select = [
"ALL",
]
lint.ignore = [
"CPY", # No copyright header
"ANN", # no type checking added yet
Expand Down Expand Up @@ -144,10 +152,14 @@ builtin = "clear,usage,en-GB_to_en-US"
count = true

[tool.pytest.ini_options]
markers = ["slow"]
markers = [
"slow",
]
timeout = 600
addopts = "--showlocals --no-success-flaky-report"
env = ["PYTHONIOENCODING=utf-8"]
env = [
"PYTHONIOENCODING=utf-8",
]

[tool.coverage]
html.show_contexts = true
Expand All @@ -159,12 +171,20 @@ report.omit = [
"**/src/virtualenv/activation/python/activate_this.py",
"**/src/virtualenv/seed/wheels/embed/pip-*.whl/pip/**",
]
paths.source = ["src", "**/site-packages"]
paths.source = [
"src",
"**/site-packages",
]
report.fail_under = 76
run.source = ["${_COVERAGE_SRC}", "tests"]
run.source = [
"${_COVERAGE_SRC}",
"tests",
]
run.dynamic_context = "test_function"
run.parallel = true
run.plugins = ["covdefaults"]
run.plugins = [
"covdefaults",
]
run.relative_files = true

[tool.towncrier]
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/discovery/py_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def from_exe( # noqa: PLR0913
if isinstance(proposed, PythonInfo) and resolve_to_host:
try:
proposed = proposed._resolve_to_system(app_data, proposed) # noqa: SLF001
except Exception as exception: # noqa: BLE001
except Exception as exception:
if raise_on_error:
raise
logging.info("ignore %s due cannot resolve system due to %r", proposed.original_executable, exception)
Expand Down
2 changes: 1 addition & 1 deletion tasks/make_zipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def create_zipapp(dest, packages):
print(f"zipapp created at {dest}") # noqa: T201


def write_packages_to_zipapp(base, dist, modules, packages, zip_app): # noqa: C901
def write_packages_to_zipapp(base, dist, modules, packages, zip_app): # noqa: C901, PLR0912
has = set()
for name, p_w_v in packages.items(): # noqa: PLR1702
for platform, w_v in p_w_v.items():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/activation/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_version(self, raise_on_fail):
encoding="utf-8",
)
out, err = process.communicate()
except Exception as exception: # noqa: BLE001
except Exception as exception:
self._version = exception
if raise_on_fail:
raise
Expand Down