dependence 1.1.0__tar.gz → 1.1.2__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.
- {dependence-1.1.0 → dependence-1.1.2}/PKG-INFO +1 -1
- {dependence-1.1.0 → dependence-1.1.2}/dependence/freeze.py +28 -11
- {dependence-1.1.0 → dependence-1.1.2}/dependence/update.py +3 -0
- {dependence-1.1.0 → dependence-1.1.2}/pyproject.toml +21 -83
- {dependence-1.1.0 → dependence-1.1.2}/.gitignore +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/README.md +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/dependence/__init__.py +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/dependence/__main__.py +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/dependence/_utilities.py +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/dependence/py.typed +0 -0
- {dependence-1.1.0 → dependence-1.1.2}/dependence/upgrade.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
|
+
import os
|
|
4
5
|
from collections.abc import Iterable, MutableSet
|
|
5
6
|
from fnmatch import fnmatch
|
|
6
7
|
from functools import partial
|
|
@@ -119,7 +120,7 @@ def get_frozen_requirements( # noqa: C901
|
|
|
119
120
|
elif not isinstance(no_version, tuple):
|
|
120
121
|
no_version = tuple(no_version)
|
|
121
122
|
# Separate requirement strings from requirement files
|
|
122
|
-
configuration_files:
|
|
123
|
+
configuration_files: dict[str, dict[str, tuple[str, ...]]] = {}
|
|
123
124
|
requirement_strings: MutableSet[str] = set()
|
|
124
125
|
requirement: str | Path
|
|
125
126
|
for requirement in requirements:
|
|
@@ -129,21 +130,38 @@ def get_frozen_requirements( # noqa: C901
|
|
|
129
130
|
iter_configuration_files(requirement)
|
|
130
131
|
)
|
|
131
132
|
if requirement_configuration_files:
|
|
132
|
-
|
|
133
|
+
is_directory: bool = os.path.isdir(requirement)
|
|
134
|
+
for (
|
|
135
|
+
requirement_configuration_file
|
|
136
|
+
) in requirement_configuration_files:
|
|
137
|
+
configuration_files[requirement_configuration_file] = (
|
|
138
|
+
{"include_pointers": ("/project",)}
|
|
139
|
+
if (
|
|
140
|
+
is_directory
|
|
141
|
+
and os.path.basename(
|
|
142
|
+
requirement_configuration_file
|
|
143
|
+
).lower()
|
|
144
|
+
== "pyproject.toml"
|
|
145
|
+
)
|
|
146
|
+
else {
|
|
147
|
+
"include_pointers": include_pointers,
|
|
148
|
+
"exclude_pointers": exclude_pointers,
|
|
149
|
+
}
|
|
150
|
+
)
|
|
133
151
|
else:
|
|
134
152
|
if requirement.startswith("setup.py"):
|
|
135
153
|
raise ValueError(requirement)
|
|
136
154
|
requirement_strings.add(requirement)
|
|
155
|
+
configuration_file: str
|
|
156
|
+
kwargs: dict[str, tuple[str, ...]]
|
|
137
157
|
frozen_requirements: Iterable[str] = iter_distinct(
|
|
138
158
|
chain(
|
|
139
159
|
requirement_strings,
|
|
140
|
-
*
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
),
|
|
146
|
-
configuration_files,
|
|
160
|
+
*(
|
|
161
|
+
iter_configuration_file_requirement_strings(
|
|
162
|
+
configuration_file, **kwargs
|
|
163
|
+
)
|
|
164
|
+
for configuration_file, kwargs in configuration_files.items()
|
|
147
165
|
),
|
|
148
166
|
)
|
|
149
167
|
)
|
|
@@ -273,8 +291,7 @@ def freeze(
|
|
|
273
291
|
"requirement-name[extra-a,extra-b]" or ".[extra-a, extra-b]) and/or
|
|
274
292
|
paths to a setup.py, setup.cfg, pyproject.toml, tox.ini or
|
|
275
293
|
requirements.txt file
|
|
276
|
-
exclude: One or more distributions to exclude
|
|
277
|
-
exclude_recursive: One or more distributions to exclude.
|
|
294
|
+
exclude: One or more distributions to exclude.
|
|
278
295
|
exclude_recursive: One or more distributions to exclude. Recursive
|
|
279
296
|
dependency discovery is also halted for these distributions,
|
|
280
297
|
unlike those passed to `exclude`.
|
|
@@ -137,6 +137,9 @@ def _get_updated_requirement_string(
|
|
|
137
137
|
except KeyError:
|
|
138
138
|
# If the requirement isn't installed, we can't update the version
|
|
139
139
|
pass
|
|
140
|
+
except TypeError as error:
|
|
141
|
+
message = f"Unable to determine installed version for {requirement}"
|
|
142
|
+
raise ValueError(message) from error
|
|
140
143
|
return str(requirement)
|
|
141
144
|
|
|
142
145
|
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [
|
|
3
|
-
"hatchling",
|
|
4
|
-
]
|
|
2
|
+
requires = ["hatchling"]
|
|
5
3
|
build-backend = "hatchling.build"
|
|
6
4
|
|
|
7
5
|
[project]
|
|
8
6
|
name = "dependence"
|
|
9
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.2"
|
|
10
8
|
description = "A dependency management tool for python projects"
|
|
11
9
|
readme = "README.md"
|
|
12
10
|
license = "MIT"
|
|
13
11
|
requires-python = "~=3.9"
|
|
14
|
-
authors = [
|
|
15
|
-
|
|
16
|
-
]
|
|
17
|
-
keywords = [
|
|
18
|
-
"dependencies",
|
|
19
|
-
"requirements",
|
|
20
|
-
]
|
|
12
|
+
authors = [{ email = "david@belais.me" }]
|
|
13
|
+
keywords = ["dependencies", "requirements"]
|
|
21
14
|
dependencies = [
|
|
22
15
|
"packaging",
|
|
23
16
|
"pip",
|
|
@@ -35,31 +28,17 @@ Documentation = "https://dependence.enorganic.org"
|
|
|
35
28
|
Repository = "https://github.com/enorganic/dependence"
|
|
36
29
|
|
|
37
30
|
[tool.hatch.build.targets.sdist]
|
|
38
|
-
packages = [
|
|
39
|
-
|
|
40
|
-
]
|
|
41
|
-
sources = [
|
|
42
|
-
"src",
|
|
43
|
-
]
|
|
31
|
+
packages = ["src/dependence"]
|
|
32
|
+
sources = ["src"]
|
|
44
33
|
|
|
45
34
|
[tool.hatch.build.targets.wheel]
|
|
46
|
-
packages = [
|
|
47
|
-
|
|
48
|
-
]
|
|
49
|
-
sources = [
|
|
50
|
-
"src",
|
|
51
|
-
]
|
|
35
|
+
packages = ["src/dependence"]
|
|
36
|
+
sources = ["src"]
|
|
52
37
|
|
|
53
38
|
[tool.hatch.envs.default]
|
|
54
39
|
python = "3.9"
|
|
55
|
-
dependencies = [
|
|
56
|
-
|
|
57
|
-
"pytest",
|
|
58
|
-
"ruff",
|
|
59
|
-
]
|
|
60
|
-
pre-install-commands = [
|
|
61
|
-
"pip install --upgrade pip setuptools",
|
|
62
|
-
]
|
|
40
|
+
dependencies = ["mypy", "pytest", "ruff"]
|
|
41
|
+
pre-install-commands = ["pip install --upgrade pip setuptools"]
|
|
63
42
|
post-install-commands = [
|
|
64
43
|
"hatch run mypy --install-types --non-interactive || echo",
|
|
65
44
|
]
|
|
@@ -70,11 +49,7 @@ lint = "ruff check . && ruff format --check . && mypy"
|
|
|
70
49
|
[tool.hatch.envs.docs]
|
|
71
50
|
template = "docs"
|
|
72
51
|
python = "3.13"
|
|
73
|
-
dependencies = [
|
|
74
|
-
"mkdocs-material",
|
|
75
|
-
"mkdocstrings[python]",
|
|
76
|
-
"black",
|
|
77
|
-
]
|
|
52
|
+
dependencies = ["mkdocs-material", "mkdocstrings[python]", "black"]
|
|
78
53
|
|
|
79
54
|
[tool.hatch.envs.hatch-static-analysis]
|
|
80
55
|
skip-install = false
|
|
@@ -82,37 +57,17 @@ skip-install = false
|
|
|
82
57
|
[tool.hatch.envs.hatch-test]
|
|
83
58
|
template = "hatch-test"
|
|
84
59
|
extra-dependencies = []
|
|
85
|
-
extra-arguments = [
|
|
86
|
-
"--cache-clear",
|
|
87
|
-
]
|
|
60
|
+
extra-arguments = ["--cache-clear"]
|
|
88
61
|
|
|
89
62
|
[[tool.hatch.envs.hatch-test.matrix]]
|
|
90
|
-
python = [
|
|
91
|
-
"3.9",
|
|
92
|
-
"3.10",
|
|
93
|
-
"3.11",
|
|
94
|
-
"3.12",
|
|
95
|
-
"3.13",
|
|
96
|
-
]
|
|
63
|
+
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
97
64
|
|
|
98
65
|
[tool.ruff]
|
|
99
66
|
line-length = 79
|
|
100
67
|
|
|
101
68
|
[tool.ruff.lint]
|
|
102
|
-
ignore = [
|
|
103
|
-
|
|
104
|
-
"INP001",
|
|
105
|
-
]
|
|
106
|
-
extend-select = [
|
|
107
|
-
"E",
|
|
108
|
-
"F",
|
|
109
|
-
"UP",
|
|
110
|
-
"B",
|
|
111
|
-
"SIM",
|
|
112
|
-
"I",
|
|
113
|
-
"C",
|
|
114
|
-
"N",
|
|
115
|
-
]
|
|
69
|
+
ignore = ["F842", "INP001"]
|
|
70
|
+
extend-select = ["E", "F", "UP", "B", "SIM", "I", "C", "N"]
|
|
116
71
|
|
|
117
72
|
[tool.ruff.lint.mccabe]
|
|
118
73
|
max-complexity = 10
|
|
@@ -123,38 +78,21 @@ docstring-code-line-length = 20
|
|
|
123
78
|
|
|
124
79
|
[tool.black]
|
|
125
80
|
line-length = 79
|
|
126
|
-
target-version = [
|
|
127
|
-
"py39",
|
|
128
|
-
"py310",
|
|
129
|
-
"py311",
|
|
130
|
-
"py312",
|
|
131
|
-
"py313",
|
|
132
|
-
]
|
|
81
|
+
target-version = ["py39", "py310", "py311", "py312", "py313"]
|
|
133
82
|
|
|
134
83
|
[tool.mypy]
|
|
135
84
|
python_version = "3.9"
|
|
136
|
-
files = [
|
|
137
|
-
|
|
138
|
-
"tests",
|
|
139
|
-
]
|
|
140
|
-
exclude = [
|
|
141
|
-
"tests/test_projects",
|
|
142
|
-
]
|
|
85
|
+
files = ["src", "tests"]
|
|
86
|
+
exclude = ["tests/test_projects"]
|
|
143
87
|
disallow_untyped_defs = true
|
|
144
88
|
disallow_incomplete_defs = true
|
|
145
89
|
|
|
146
90
|
[tool.coverage.run]
|
|
147
|
-
include = [
|
|
148
|
-
|
|
149
|
-
]
|
|
150
|
-
omit = [
|
|
151
|
-
"src/**/_*.py",
|
|
152
|
-
]
|
|
91
|
+
include = ["src/**/*.py"]
|
|
92
|
+
omit = ["src/**/_*.py"]
|
|
153
93
|
|
|
154
94
|
[tool.coverage.paths]
|
|
155
|
-
source = [
|
|
156
|
-
"src/**",
|
|
157
|
-
]
|
|
95
|
+
source = ["src/**"]
|
|
158
96
|
|
|
159
97
|
[tool.coverage.report]
|
|
160
98
|
fail_under = 70
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|