pydepinject 0.0.5.dev0__tar.gz → 0.0.6.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydepinject
3
- Version: 0.0.5.dev0
3
+ Version: 0.0.6.dev0
4
4
  Summary: A package to dynamically inject requirements into a virtual environment.
5
5
  Author: pydepinject
6
6
  License-Expression: MIT
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
17
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
18
  Classifier: Topic :: Software Development :: Libraries
19
19
  Classifier: Typing :: Typed
20
- Requires-Python: >=3.11
20
+ Requires-Python: >=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: packaging>=24.0
@@ -14,7 +14,7 @@ authors = [
14
14
  ]
15
15
  license = "MIT"
16
16
  keywords = ["virtualenv", "requirements", "dependency management"]
17
- requires-python = ">=3.11"
17
+ requires-python = ">=3.12"
18
18
  dependencies = [
19
19
  "packaging>=24.0",
20
20
  "typing-extensions>=4.4.0",
@@ -73,57 +73,57 @@ extend-exclude = [
73
73
  select = ["ALL"]
74
74
  ignore = [
75
75
  "ANN",
76
- "BLE001",
76
+ "blind-except",
77
77
  "COM",
78
- "CPY001",
78
+ "missing-copyright-notice",
79
79
  "D1",
80
80
  "D2",
81
81
  "D4",
82
82
  "DOC", # pydoclint
83
- "E501",
84
- "EM101",
85
- "EM102",
86
- "FBT001",
83
+ "line-too-long",
84
+ "raw-string-in-exception",
85
+ "f-string-in-exception",
86
+ "boolean-type-hint-positional-argument",
87
87
  "FIX",
88
- "FLY002",
89
- "FURB142",
88
+ "static-join-to-f-string",
89
+ "for-loop-set-mutations",
90
90
  "I0",
91
- "ISC001",
92
- "PERF401",
93
- "PLC0415",
94
- "PLR0904",
95
- "PLR0913",
96
- "PLW2901",
97
- "RET503",
98
- "RUF005",
99
- "RUF067",
100
- "S404",
101
- "S603",
102
- "SLF001",
103
- "TC006", # Doesn't seem useful at this time.
91
+ "single-line-implicit-string-concatenation",
92
+ "manual-list-comprehension",
93
+ "import-outside-top-level",
94
+ "too-many-public-methods",
95
+ "too-many-arguments",
96
+ "redefined-loop-name",
97
+ "implicit-return",
98
+ "collection-literal-concatenation",
99
+ "non-empty-init-module",
100
+ "suspicious-subprocess-import",
101
+ "subprocess-without-shell-equals-true",
102
+ "private-member-access",
103
+ "runtime-cast-value", # Doesn't seem useful at this time.
104
104
  "TD",
105
- "TRY003",
105
+ "raise-vanilla-args",
106
106
  ]
107
107
 
108
108
  [tool.ruff.lint.per-file-ignores]
109
- "tests/test_pydepinject.py" = ["F401", "F811"]
109
+ "tests/test_pydepinject.py" = ["unused-import", "redefined-while-unused"]
110
110
  "tasks/**" = [
111
- "C901",
112
- "G004",
113
- "PLR0912",
114
- "PLR0915",
111
+ "complex-structure",
112
+ "logging-f-string",
113
+ "too-many-branches",
114
+ "too-many-statements",
115
115
  "PT0",
116
- "PLW1510",
117
- "S202",
118
- "S310",
119
- "SIM102",
120
- "SIM117",
121
- "T201",
122
- "TRY301",
123
- "TRY400",
116
+ "subprocess-run-without-check",
117
+ "tarfile-unsafe-members",
118
+ "suspicious-url-open-usage",
119
+ "collapsible-if",
120
+ "multiple-with-statements",
121
+ "print",
122
+ "raise-within-try",
123
+ "error-instead-of-exception",
124
124
  ]
125
- "tasks/corelib/http.py" = ["A005"]
126
- "tests/**" = ["S1", "T201", "INP001"]
125
+ "tasks/corelib/http.py" = ["stdlib-module-shadowing"]
126
+ "tests/**" = ["S1", "print", "implicit-namespace-package", "pytest-fixture-autouse"]
127
127
 
128
128
  [tool.pyright]
129
129
  include = ["src"]
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- import datetime
3
+ import datetime as dt
4
4
  import functools
5
5
  import hashlib
6
6
  import json
@@ -23,7 +23,7 @@ from .backends import VenvBackendRegistry
23
23
  P = typing.ParamSpec("P")
24
24
  R = typing.TypeVar("R")
25
25
 
26
- VERSION = "0.0.5dev0"
26
+ VERSION = "0.0.6dev0"
27
27
  __version__ = VERSION
28
28
 
29
29
  logger = logging.getLogger(__name__)
@@ -201,7 +201,7 @@ class RequirementManager:
201
201
  norm_key,
202
202
  ))
203
203
  # Non-cryptographic hash to key the venv path (safe for identity, not security).
204
- self._venv_path = self._venv_root / hashlib.md5(key.encode()).hexdigest() # noqa: S324
204
+ self._venv_path = self._venv_root / hashlib.md5(key.encode()).hexdigest() # ruff:ignore[hashlib-insecure-hash-function]
205
205
  return self._venv_path
206
206
 
207
207
  def _create_virtualenv(self):
@@ -221,7 +221,7 @@ class RequirementManager:
221
221
  extra_args=list(self._install_args) if self._install_args else None,
222
222
  )
223
223
  # Write metadata file for traceability
224
- timestamp = int(datetime.datetime.now(tz=datetime.UTC).timestamp())
224
+ timestamp = int(dt.datetime.now(tz=dt.UTC).timestamp())
225
225
  meta_filepath = self.venv_path / f".pydepinject-{timestamp}.json"
226
226
  try:
227
227
  meta = {
@@ -234,7 +234,7 @@ class RequirementManager:
234
234
  "platform": sys.platform,
235
235
  "packages": list(self.packages),
236
236
  "install_args": list(self._install_args),
237
- "timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
237
+ "timestamp": dt.datetime.now(dt.UTC).isoformat(),
238
238
  }
239
239
  meta_filepath.write_text(json.dumps(meta, indent=2))
240
240
  logger.debug("Wrote venv metadata to: %s", meta_filepath)
@@ -13,7 +13,7 @@ from abc import abstractmethod
13
13
  if typing.TYPE_CHECKING:
14
14
  from collections.abc import MutableMapping, Sequence
15
15
 
16
- from typing_extensions import override
16
+ from typing import override
17
17
 
18
18
  _PYTHON_BIN = sys.executable
19
19
 
@@ -90,7 +90,7 @@ class VenvBackend:
90
90
  def is_supported(cls) -> bool:
91
91
  """Check if the backend is supported on the current system."""
92
92
 
93
- def _run_command(self, cmd: list[str]) -> None: # noqa: PLR6301
93
+ def _run_command(self, cmd: list[str]) -> None: # ruff:ignore[no-self-use]
94
94
  """Run a command in the virtual environment.
95
95
 
96
96
  Output is captured (stdout and stderr merged) and stays quiet on success.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydepinject
3
- Version: 0.0.5.dev0
3
+ Version: 0.0.6.dev0
4
4
  Summary: A package to dynamically inject requirements into a virtual environment.
5
5
  Author: pydepinject
6
6
  License-Expression: MIT
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
17
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
18
  Classifier: Topic :: Software Development :: Libraries
19
19
  Classifier: Typing :: Typed
20
- Requires-Python: >=3.11
20
+ Requires-Python: >=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: packaging>=24.0
@@ -7,7 +7,7 @@ import pytest
7
7
  PROJECT_DIR = pathlib.Path(__file__).parent.parent
8
8
 
9
9
 
10
- @pytest.fixture(autouse=True) # noqa: RUF076
10
+ @pytest.fixture(autouse=True)
11
11
  def _check_test_leftovers():
12
12
  """Checks if the test left any files in the project directory."""
13
13
  items_before = list(PROJECT_DIR.iterdir())
@@ -396,7 +396,7 @@ def test_failed_activation_restores_global_state(
396
396
  with pytest.raises(ImportError):
397
397
  import attrs
398
398
 
399
- def _boom(*args, **kwargs): # noqa: ARG001 - stub replacing backend.install
399
+ def _boom(*args, **kwargs): # ruff:ignore[unused-function-argument] - stub replacing backend.install
400
400
  raise exc
401
401
 
402
402
  from pydepinject import backends
@@ -443,8 +443,8 @@ def test_interrupt_mid_activation_restores_env(venv_root, monkeypatch):
443
443
 
444
444
  # Must be a real list subclass: sys.path has to stay a plain list for
445
445
  # CPython's import machinery, so UserList is not an option here.
446
- class _RaisingInsertList(list): # noqa: FURB189
447
- def insert(self, *args, **kwargs): # noqa: ARG002, PLR6301 - stub
446
+ class _RaisingInsertList(list): # ruff:ignore[subclass-builtin]
447
+ def insert(self, *args, **kwargs): # ruff:ignore[unused-method-argument, no-self-use] - stub
448
448
  raise KeyboardInterrupt("simulated interrupt mid-activation")
449
449
 
450
450
  monkeypatch.setattr(sys, "path", _RaisingInsertList(sys.path))
@@ -592,4 +592,4 @@ def test_same_package_different_versions(venv_root, backend, ephemeral):
592
592
  if ephemeral:
593
593
  assert not list(venv_root.iterdir())
594
594
  else:
595
- assert len(list(venv_root.iterdir())) == 2 # noqa: PLR2004
595
+ assert len(list(venv_root.iterdir())) == 2 # ruff:ignore[magic-value-comparison]