dependence 1.2.6__tar.gz → 1.2.7__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.2.6 → dependence-1.2.7}/PKG-INFO +1 -1
- {dependence-1.2.6 → dependence-1.2.7}/dependence/freeze.py +36 -1
- {dependence-1.2.6 → dependence-1.2.7}/pyproject.toml +1 -1
- {dependence-1.2.6 → dependence-1.2.7}/.gitignore +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/README.md +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/__init__.py +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/__main__.py +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/_utilities.py +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/py.typed +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/update.py +0 -0
- {dependence-1.2.6 → dependence-1.2.7}/dependence/upgrade.py +0 -0
|
@@ -268,7 +268,27 @@ def _iter_frozen_requirements(
|
|
|
268
268
|
if keep_version_specifier and any(
|
|
269
269
|
fnmatch(name, pattern) for pattern in keep_version_specifier
|
|
270
270
|
):
|
|
271
|
-
|
|
271
|
+
existing_requirement_string: str | None = (
|
|
272
|
+
distribution_names_specifiers.get(name)
|
|
273
|
+
)
|
|
274
|
+
requirement_string = requirement_string.rstrip()
|
|
275
|
+
# Prioritize requirement strings which don't include environment
|
|
276
|
+
# markers over those that do, and prefer more specific requirement
|
|
277
|
+
# strings (longer ones) over less specific requirement strings
|
|
278
|
+
if (
|
|
279
|
+
(not existing_requirement_string)
|
|
280
|
+
or (
|
|
281
|
+
(";" in existing_requirement_string)
|
|
282
|
+
== (";" in requirement_string)
|
|
283
|
+
and len(existing_requirement_string)
|
|
284
|
+
< len(requirement_string)
|
|
285
|
+
)
|
|
286
|
+
or (
|
|
287
|
+
";" in existing_requirement_string
|
|
288
|
+
and ";" not in requirement_string
|
|
289
|
+
)
|
|
290
|
+
):
|
|
291
|
+
distribution_names_specifiers[name] = requirement_string
|
|
272
292
|
distribution_names: MutableSet[str] = {name}
|
|
273
293
|
if (depth_ is None) or depth_:
|
|
274
294
|
distribution_names |= get_required_distribution_names(
|
|
@@ -306,6 +326,7 @@ def freeze(
|
|
|
306
326
|
depth: int | None = None,
|
|
307
327
|
include_pointers: tuple[str, ...] = (),
|
|
308
328
|
exclude_pointers: tuple[str, ...] = (),
|
|
329
|
+
keep_version_specifier: Iterable[str] = (),
|
|
309
330
|
) -> None:
|
|
310
331
|
"""
|
|
311
332
|
Print the (frozen) requirements for one or more specified requirements or
|
|
@@ -343,6 +364,7 @@ def freeze(
|
|
|
343
364
|
depth=depth,
|
|
344
365
|
include_pointers=include_pointers,
|
|
345
366
|
exclude_pointers=exclude_pointers,
|
|
367
|
+
keep_version_specifier=keep_version_specifier,
|
|
346
368
|
)
|
|
347
369
|
)
|
|
348
370
|
)
|
|
@@ -413,6 +435,18 @@ def main() -> None:
|
|
|
413
435
|
"value must be single-quoted if it contains wildcards)"
|
|
414
436
|
),
|
|
415
437
|
)
|
|
438
|
+
parser.add_argument(
|
|
439
|
+
"-kvs",
|
|
440
|
+
"--keep-version-specifier",
|
|
441
|
+
type=str,
|
|
442
|
+
default=[],
|
|
443
|
+
action="append",
|
|
444
|
+
help=(
|
|
445
|
+
"Don't freeze versions (instead retain the most specific version "
|
|
446
|
+
"specifier) for packages matching this/these glob pattern(s) "
|
|
447
|
+
"(note: the value must be single-quoted if it contains wildcards)"
|
|
448
|
+
),
|
|
449
|
+
)
|
|
416
450
|
parser.add_argument(
|
|
417
451
|
"-do",
|
|
418
452
|
"--dependency-order",
|
|
@@ -461,6 +495,7 @@ def main() -> None:
|
|
|
461
495
|
iter_parse_delimited_values(namespace.exclude_recursive)
|
|
462
496
|
),
|
|
463
497
|
no_version=namespace.no_version,
|
|
498
|
+
keep_version_specifier=namespace.keep_version_specifier,
|
|
464
499
|
dependency_order=namespace.dependency_order,
|
|
465
500
|
depth=namespace.depth,
|
|
466
501
|
include_pointers=tuple(namespace.include_pointer),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|