dependence 1.0a0__tar.gz → 1.0.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.0a0 → dependence-1.0.2}/PKG-INFO +1 -1
- {dependence-1.0a0 → dependence-1.0.2}/dependence/update.py +11 -22
- {dependence-1.0a0 → dependence-1.0.2}/pyproject.toml +1 -1
- {dependence-1.0a0 → dependence-1.0.2}/.gitignore +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/README.md +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/dependence/__init__.py +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/dependence/__main__.py +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/dependence/_utilities.py +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/dependence/freeze.py +0 -0
- {dependence-1.0a0 → dependence-1.0.2}/dependence/py.typed +0 -0
|
@@ -39,19 +39,6 @@ from ._utilities import (
|
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def get_updated_requirement_string(
|
|
43
|
-
requirement_string: str, ignore: Iterable[str] = ()
|
|
44
|
-
) -> str:
|
|
45
|
-
"""
|
|
46
|
-
This function accepts a requirement string, and returns a requirement
|
|
47
|
-
string updated to reflect the version of the requirement installed
|
|
48
|
-
in the current environment
|
|
49
|
-
"""
|
|
50
|
-
return _get_updated_requirement_string(
|
|
51
|
-
requirement_string, set(map(normalize_name, ignore))
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
42
|
@dataclass
|
|
56
43
|
class _Version:
|
|
57
44
|
"""
|
|
@@ -161,7 +148,9 @@ def _normalize_ignore_argument(ignore: Iterable[str]) -> Set[str]:
|
|
|
161
148
|
return ignore_set
|
|
162
149
|
|
|
163
150
|
|
|
164
|
-
def
|
|
151
|
+
def _get_updated_requirements_txt(
|
|
152
|
+
data: str, ignore: Iterable[str] = ()
|
|
153
|
+
) -> str:
|
|
165
154
|
"""
|
|
166
155
|
Return the contents of a *requirements.txt* file, updated to reflect the
|
|
167
156
|
currently installed project versions, excluding those specified in
|
|
@@ -180,7 +169,7 @@ def get_updated_requirements_txt(data: str, ignore: Iterable[str] = ()) -> str:
|
|
|
180
169
|
return "\n".join(map(get_updated_requirement_string, data.split("\n")))
|
|
181
170
|
|
|
182
171
|
|
|
183
|
-
def
|
|
172
|
+
def _get_updated_setup_cfg(
|
|
184
173
|
data: str, ignore: Iterable[str] = (), all_extra_name: str = ""
|
|
185
174
|
) -> str:
|
|
186
175
|
"""
|
|
@@ -246,7 +235,7 @@ def get_updated_setup_cfg(
|
|
|
246
235
|
return f"{setup_cfg}\n"
|
|
247
236
|
|
|
248
237
|
|
|
249
|
-
def
|
|
238
|
+
def _get_updated_tox_ini(data: str, ignore: Iterable[str] = ()) -> str:
|
|
250
239
|
"""
|
|
251
240
|
Return the contents of a **tox.ini** file, updated to reflect the
|
|
252
241
|
currently installed project versions, excluding those specified in
|
|
@@ -447,7 +436,7 @@ def _update(
|
|
|
447
436
|
get_configuration_file_type(path)
|
|
448
437
|
)
|
|
449
438
|
if configuration_file_type == ConfigurationFileType.SETUP_CFG:
|
|
450
|
-
update_function =
|
|
439
|
+
update_function = _get_updated_setup_cfg
|
|
451
440
|
if all_extra_name:
|
|
452
441
|
kwargs["all_extra_name"] = all_extra_name
|
|
453
442
|
elif configuration_file_type == ConfigurationFileType.PYPROJECT_TOML:
|
|
@@ -464,9 +453,9 @@ def _update(
|
|
|
464
453
|
exclude_pointers=exclude_pointers,
|
|
465
454
|
)
|
|
466
455
|
elif configuration_file_type == ConfigurationFileType.TOX_INI:
|
|
467
|
-
update_function =
|
|
456
|
+
update_function = _get_updated_tox_ini
|
|
468
457
|
elif configuration_file_type == ConfigurationFileType.REQUIREMENTS_TXT:
|
|
469
|
-
update_function =
|
|
458
|
+
update_function = _get_updated_requirements_txt
|
|
470
459
|
else:
|
|
471
460
|
raise NotImplementedError(
|
|
472
461
|
f"Updating requirements for {path} is not supported"
|
|
@@ -548,9 +537,9 @@ def main() -> None:
|
|
|
548
537
|
type=str,
|
|
549
538
|
help=(
|
|
550
539
|
"If provided, an extra which consolidates the requirements "
|
|
551
|
-
"for all other extras will be added/updated to
|
|
540
|
+
"for all other extras will be added/updated to pyproject.toml "
|
|
552
541
|
"or setup.cfg (this argument is ignored for "
|
|
553
|
-
"requirements.txt files)"
|
|
542
|
+
"requirements.txt files and other TOML files)"
|
|
554
543
|
),
|
|
555
544
|
)
|
|
556
545
|
parser.add_argument(
|
|
@@ -578,7 +567,7 @@ def main() -> None:
|
|
|
578
567
|
nargs="+",
|
|
579
568
|
type=str,
|
|
580
569
|
help=(
|
|
581
|
-
"One or more local paths to a
|
|
570
|
+
"One or more local paths to a *.toml, setup.cfg, "
|
|
582
571
|
"and/or requirements.txt file"
|
|
583
572
|
),
|
|
584
573
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|