dependence 1.0a0__py3-none-any.whl → 1.0.1__py3-none-any.whl
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/update.py +8 -19
- {dependence-1.0a0.dist-info → dependence-1.0.1.dist-info}/METADATA +1 -1
- {dependence-1.0a0.dist-info → dependence-1.0.1.dist-info}/RECORD +5 -5
- {dependence-1.0a0.dist-info → dependence-1.0.1.dist-info}/WHEEL +0 -0
- {dependence-1.0a0.dist-info → dependence-1.0.1.dist-info}/entry_points.txt +0 -0
dependence/update.py
CHANGED
|
@@ -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"
|
|
@@ -3,8 +3,8 @@ dependence/__main__.py,sha256=myBIBZdez2jC3_dkVSE-mOLo39yKi2cF_0NuVXcXF1E,1528
|
|
|
3
3
|
dependence/_utilities.py,sha256=gUFC6lzd3T60_-3kqzqTJRmmilzM64HRHz6rxjhJd9c,33697
|
|
4
4
|
dependence/freeze.py,sha256=t9yoavc8h5OWA5za_tNrEQIGThFHy679O-6MnXUBZmQ,14855
|
|
5
5
|
dependence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
dependence/update.py,sha256=
|
|
7
|
-
dependence-1.
|
|
8
|
-
dependence-1.
|
|
9
|
-
dependence-1.
|
|
10
|
-
dependence-1.
|
|
6
|
+
dependence/update.py,sha256=UWbUKBcLZ30sLnCn9A3cdtn4RsT68R916LcEbuLkAiM,19955
|
|
7
|
+
dependence-1.0.1.dist-info/METADATA,sha256=zu90hLAwuvbyG-IizENodndT4Sowf5EOO6TimrZfNbg,5508
|
|
8
|
+
dependence-1.0.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
9
|
+
dependence-1.0.1.dist-info/entry_points.txt,sha256=NStO_B0D81ObVYr9zDs6LCy0whm0a8KCiiFHMmTwOVE,56
|
|
10
|
+
dependence-1.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|