dependence 0.1.1__tar.gz → 0.3.0__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.1
2
2
  Name: dependence
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: Requirement (dependency) management for python projects
5
5
  Home-page: https://github.com/enorganic/dependence
6
6
  Author-email: david@belais.me
@@ -12,7 +12,6 @@ Requires-Dist: packaging
12
12
  Requires-Dist: pip
13
13
  Requires-Dist: tomli~=2.0
14
14
  Requires-Dist: tomli-w~=1.0
15
- Requires-Dist: more-itertools>7
16
15
  Requires-Dist: setuptools>63
17
16
 
18
17
  # dependence
@@ -95,50 +94,43 @@ dependence update -aen all setup.cfg pyproject.toml tox.ini
95
94
 
96
95
  ```console
97
96
  $ dependence freeze -h
98
- usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE]
99
- [-nv NO_VERSION] [-do] [--reverse]
97
+ usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE] [-nv NO_VERSION]
98
+ [-do] [--reverse] [-d DEPTH]
100
99
  requirement [requirement ...]
101
100
 
102
- This command prints dependencies inferred from an installed
103
- distribution or project, in a similar format to the output of `pip
104
- freeze`, except that all generated requirements are specified in the
105
- format "distribution-name==0.0.0" (including for editable
106
- installations). Using this command instead of `pip freeze` to generate
107
- requirement files ensures that you don't bloat your requirements files
108
- with superfluous distributions. The default sorting starts with
109
- directly specified requirements, followed by recursively discovered
110
- requirements, in the order of discovery.
101
+ This command prints dependencies inferred from an installed distribution or project, in
102
+ a similar format to the output of `pip freeze`, except that all generated requirements
103
+ are specified in the format "distribution-name==0.0.0" (including for editable
104
+ installations). Using this command instead of `pip freeze` to generate requirement
105
+ files ensures that you don't bloat your requirements files with superfluous
106
+ distributions.
111
107
 
112
108
  positional arguments:
113
- requirement One or more requirement specifiers (for
114
- example: "requirement-name", "requirement-
115
- name[extra-a,extra-b]", ".[extra-a, extra-b]"
116
- or "../other-editable-package-
117
- directory[extra-a, extra-b]) and/or paths to a
118
- setup.py, setup.cfg, pyproject.toml, tox.ini or
119
- requirements.txt file
109
+ requirement One or more requirement specifiers (for example: "requirement-
110
+ name", "requirement-name[extra-a,extra-b]", ".[extra-a,
111
+ extra-b]" or "../other-editable-package-directory[extra-a,
112
+ extra-b]) and/or paths to a setup.py, setup.cfg,
113
+ pyproject.toml, tox.ini or requirements.txt file
120
114
 
121
115
  optional arguments:
122
116
  -h, --help show this help message and exit
123
117
  -e EXCLUDE, --exclude EXCLUDE
124
- A distribution (or comma-separated list of
125
- distributions) to exclude from the output
118
+ A distribution (or comma-separated list of distributions) to
119
+ exclude from the output
126
120
  -er EXCLUDE_RECURSIVE, --exclude-recursive EXCLUDE_RECURSIVE
127
- A distribution (or comma-separated list of
128
- distributions) to exclude from the output.
129
- Unlike -e / --exclude, this argument also
130
- precludes recursive requirement discovery for
131
- the specified packages, thereby excluding all
132
- of the excluded package's requirements which
133
- are not required by another (non-excluded)
134
- distribution.
121
+ A distribution (or comma-separated list of distributions) to
122
+ exclude from the output. Unlike -e / --exclude, this argument
123
+ also precludes recursive requirement discovery for the
124
+ specified packages, thereby excluding all of the excluded
125
+ package's requirements which are not required by another (non-
126
+ excluded) distribution.
135
127
  -nv NO_VERSION, --no-version NO_VERSION
136
- Don't include versions (only output
137
- distribution names) for packages matching
138
- this/these glob pattern(s) (note: the value
128
+ Don't include versions (only output distribution names) for
129
+ packages matching this/these glob pattern(s) (note: the value
139
130
  must be single-quoted if it contains wildcards)
140
131
  -do, --dependency-order
141
- Sort requirements so that dependents precede
142
- dependencies
132
+ Sort requirements so that dependents precede dependencies
143
133
  --reverse Print requirements in reverse order
134
+ -d DEPTH, --depth DEPTH
135
+ Depth of recursive requirement discovery
144
136
  ```
@@ -78,50 +78,43 @@ dependence update -aen all setup.cfg pyproject.toml tox.ini
78
78
 
79
79
  ```console
80
80
  $ dependence freeze -h
81
- usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE]
82
- [-nv NO_VERSION] [-do] [--reverse]
81
+ usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE] [-nv NO_VERSION]
82
+ [-do] [--reverse] [-d DEPTH]
83
83
  requirement [requirement ...]
84
84
 
85
- This command prints dependencies inferred from an installed
86
- distribution or project, in a similar format to the output of `pip
87
- freeze`, except that all generated requirements are specified in the
88
- format "distribution-name==0.0.0" (including for editable
89
- installations). Using this command instead of `pip freeze` to generate
90
- requirement files ensures that you don't bloat your requirements files
91
- with superfluous distributions. The default sorting starts with
92
- directly specified requirements, followed by recursively discovered
93
- requirements, in the order of discovery.
85
+ This command prints dependencies inferred from an installed distribution or project, in
86
+ a similar format to the output of `pip freeze`, except that all generated requirements
87
+ are specified in the format "distribution-name==0.0.0" (including for editable
88
+ installations). Using this command instead of `pip freeze` to generate requirement
89
+ files ensures that you don't bloat your requirements files with superfluous
90
+ distributions.
94
91
 
95
92
  positional arguments:
96
- requirement One or more requirement specifiers (for
97
- example: "requirement-name", "requirement-
98
- name[extra-a,extra-b]", ".[extra-a, extra-b]"
99
- or "../other-editable-package-
100
- directory[extra-a, extra-b]) and/or paths to a
101
- setup.py, setup.cfg, pyproject.toml, tox.ini or
102
- requirements.txt file
93
+ requirement One or more requirement specifiers (for example: "requirement-
94
+ name", "requirement-name[extra-a,extra-b]", ".[extra-a,
95
+ extra-b]" or "../other-editable-package-directory[extra-a,
96
+ extra-b]) and/or paths to a setup.py, setup.cfg,
97
+ pyproject.toml, tox.ini or requirements.txt file
103
98
 
104
99
  optional arguments:
105
100
  -h, --help show this help message and exit
106
101
  -e EXCLUDE, --exclude EXCLUDE
107
- A distribution (or comma-separated list of
108
- distributions) to exclude from the output
102
+ A distribution (or comma-separated list of distributions) to
103
+ exclude from the output
109
104
  -er EXCLUDE_RECURSIVE, --exclude-recursive EXCLUDE_RECURSIVE
110
- A distribution (or comma-separated list of
111
- distributions) to exclude from the output.
112
- Unlike -e / --exclude, this argument also
113
- precludes recursive requirement discovery for
114
- the specified packages, thereby excluding all
115
- of the excluded package's requirements which
116
- are not required by another (non-excluded)
117
- distribution.
105
+ A distribution (or comma-separated list of distributions) to
106
+ exclude from the output. Unlike -e / --exclude, this argument
107
+ also precludes recursive requirement discovery for the
108
+ specified packages, thereby excluding all of the excluded
109
+ package's requirements which are not required by another (non-
110
+ excluded) distribution.
118
111
  -nv NO_VERSION, --no-version NO_VERSION
119
- Don't include versions (only output
120
- distribution names) for packages matching
121
- this/these glob pattern(s) (note: the value
112
+ Don't include versions (only output distribution names) for
113
+ packages matching this/these glob pattern(s) (note: the value
122
114
  must be single-quoted if it contains wildcards)
123
115
  -do, --dependency-order
124
- Sort requirements so that dependents precede
125
- dependencies
116
+ Sort requirements so that dependents precede dependencies
126
117
  --reverse Print requirements in reverse order
118
+ -d DEPTH, --depth DEPTH
119
+ Depth of recursive requirement discovery
127
120
  ```
@@ -2,11 +2,23 @@ import sys
2
2
  from functools import lru_cache
3
3
  from itertools import chain
4
4
  from traceback import format_exception
5
- from typing import Any, Dict, Iterable, List
5
+ from typing import Any, Dict, Hashable, Iterable, List, Set
6
6
 
7
7
  import tomli
8
8
 
9
9
 
10
+ def iter_distinct(items: Iterable[Hashable]) -> Iterable:
11
+ """
12
+ Yield distinct elements, preserving order
13
+ """
14
+ visited: Set[Hashable] = set()
15
+ item: Hashable
16
+ for item in items:
17
+ if item not in visited:
18
+ visited.add(item)
19
+ yield item
20
+
21
+
10
22
  @lru_cache()
11
23
  def pyproject_toml_defines_project(pyproject_toml_path: str) -> bool:
12
24
  pyproject: Dict[str, Any]
@@ -3,11 +3,9 @@ from fnmatch import fnmatch
3
3
  from importlib.metadata import Distribution
4
4
  from importlib.metadata import distribution as _get_distribution
5
5
  from itertools import chain
6
- from typing import Dict, Iterable, MutableSet, Tuple, cast
6
+ from typing import Dict, Iterable, MutableSet, Optional, Tuple, cast
7
7
 
8
- from more_itertools import unique_everseen
9
-
10
- from ._utilities import iter_parse_delimited_values
8
+ from ._utilities import iter_distinct, iter_parse_delimited_values
11
9
  from .utilities import (
12
10
  get_distribution,
13
11
  get_required_distribution_names,
@@ -76,6 +74,7 @@ def get_frozen_requirements(
76
74
  no_version: Iterable[str] = (),
77
75
  dependency_order: bool = False,
78
76
  reverse: bool = False,
77
+ depth: Optional[int] = None,
79
78
  ) -> Tuple[str, ...]:
80
79
  """
81
80
  Get the (frozen) requirements for one or more specified distributions or
@@ -95,6 +94,7 @@ def get_frozen_requirements(
95
94
  (only return distribution names)
96
95
  - dependency_order (bool) = False: Sort requirements so that dependents
97
96
  precede dependencies
97
+ - depth (int|None) = None: Depth of recursive requirement discovery
98
98
  """
99
99
  # Separate requirement strings from requirement files
100
100
  if isinstance(requirements, str):
@@ -111,37 +111,42 @@ def get_frozen_requirements(
111
111
  requirement_strings: MutableSet[str] = cast(
112
112
  MutableSet[str], requirements - requirement_files
113
113
  )
114
- frozen_requirements: Iterable[str] = _iter_frozen_requirements(
115
- unique_everseen(
116
- chain(
117
- requirement_strings,
118
- *map(
119
- iter_configuration_file_requirement_strings,
120
- requirement_files,
121
- ),
122
- )
123
- ),
124
- exclude=set(
125
- chain(
126
- # Exclude requirement strings which are *not*
127
- # distribution names (such as editable package paths),
128
- # as in these cases we are typically looking for this
129
- # package's dependencies
130
- (
131
- set(
132
- map(
133
- get_requirement_string_distribution_name,
134
- requirement_strings,
135
- )
136
- )
137
- - set(map(normalize_name, requirement_strings))
138
- ),
139
- map(normalize_name, exclude),
140
- )
141
- ),
142
- exclude_recursive=set(map(normalize_name, exclude_recursive)),
143
- no_version=no_version,
114
+ frozen_requirements: Iterable[str] = iter_distinct(
115
+ chain(
116
+ requirement_strings,
117
+ *map(
118
+ iter_configuration_file_requirement_strings,
119
+ requirement_files,
120
+ ),
121
+ )
144
122
  )
123
+ if depth is not None:
124
+ depth -= 1
125
+ if (depth is None) or depth >= 0:
126
+ frozen_requirements = _iter_frozen_requirements(
127
+ frozen_requirements,
128
+ exclude=set(
129
+ chain(
130
+ # Exclude requirement strings which are *not*
131
+ # distribution names (such as editable package paths),
132
+ # as in these cases we are typically looking for this
133
+ # package's dependencies
134
+ (
135
+ set(
136
+ map(
137
+ get_requirement_string_distribution_name,
138
+ requirement_strings,
139
+ )
140
+ )
141
+ - set(map(normalize_name, requirement_strings))
142
+ ),
143
+ map(normalize_name, exclude),
144
+ )
145
+ ),
146
+ exclude_recursive=set(map(normalize_name, exclude_recursive)),
147
+ no_version=no_version,
148
+ depth=depth,
149
+ )
145
150
  if dependency_order:
146
151
  frozen_requirements = tuple(
147
152
  _iter_sort_dependents_last(frozen_requirements)
@@ -165,6 +170,7 @@ def _iter_frozen_requirements(
165
170
  exclude: MutableSet[str],
166
171
  exclude_recursive: MutableSet[str],
167
172
  no_version: Iterable[str] = (),
173
+ depth: Optional[int] = None,
168
174
  ) -> Iterable[str]:
169
175
  def get_requirement_string(distribution_name: str) -> str:
170
176
  def distribution_name_matches_pattern(pattern: str) -> bool:
@@ -185,25 +191,35 @@ def _iter_frozen_requirements(
185
191
 
186
192
  def get_required_distribution_names_(
187
193
  requirement_string: str,
194
+ depth_: Optional[int] = None,
188
195
  ) -> MutableSet[str]:
189
196
  name: str = get_requirement_string_distribution_name(
190
197
  requirement_string
191
198
  )
192
199
  if name in exclude_recursive:
193
200
  return set()
201
+ distribution_names: MutableSet[str] = {name}
202
+ if (depth_ is None) or depth_:
203
+ distribution_names |= get_required_distribution_names(
204
+ requirement_string,
205
+ exclude=exclude_recursive,
206
+ depth=None if (depth_ is None) else depth_ - 1,
207
+ )
194
208
  return cast(
195
209
  MutableSet[str],
196
- (
197
- set((name,))
198
- | get_required_distribution_names(
199
- requirement_string, exclude=exclude_recursive
200
- )
201
- )
202
- - exclude,
210
+ distribution_names - exclude,
203
211
  )
204
212
 
205
- requirements: Iterable[str] = unique_everseen(
206
- chain(*map(get_required_distribution_names_, requirement_strings)),
213
+ distribution_names: MutableSet[str]
214
+ requirements: Iterable[str] = iter_distinct(
215
+ chain(
216
+ *map(
217
+ lambda distribution_names: get_required_distribution_names_(
218
+ distribution_names, None if (depth is None) else depth - 1
219
+ ),
220
+ requirement_strings,
221
+ )
222
+ ),
207
223
  )
208
224
 
209
225
  requirements = map(get_requirement_string, requirements)
@@ -217,6 +233,7 @@ def freeze(
217
233
  no_version: Iterable[str] = (),
218
234
  dependency_order: bool = False,
219
235
  reverse: bool = False,
236
+ depth: Optional[int] = None,
220
237
  ) -> None:
221
238
  """
222
239
  Print the (frozen) requirements for one or more specified requirements or
@@ -238,6 +255,7 @@ def freeze(
238
255
  patterns
239
256
  - dependency_order (bool) = False: Sort requirements so that dependents
240
257
  precede dependencies
258
+ - depth (int|None) = None: Depth of recursive requirement discovery
241
259
  """
242
260
  print(
243
261
  "\n".join(
@@ -248,6 +266,7 @@ def freeze(
248
266
  no_version=no_version,
249
267
  dependency_order=dependency_order,
250
268
  reverse=reverse,
269
+ depth=depth,
251
270
  )
252
271
  )
253
272
  )
@@ -331,15 +350,23 @@ def main() -> None:
331
350
  action="store_true",
332
351
  help="Print requirements in reverse order",
333
352
  )
334
- arguments: argparse.Namespace = parser.parse_args()
353
+ parser.add_argument(
354
+ "-d",
355
+ "--depth",
356
+ default=None,
357
+ type=int,
358
+ help="Depth of recursive requirement discovery",
359
+ )
360
+ namespace: argparse.Namespace = parser.parse_args()
335
361
  freeze(
336
- requirements=arguments.requirement,
337
- exclude=tuple(iter_parse_delimited_values(arguments.exclude)),
362
+ requirements=namespace.requirement,
363
+ exclude=tuple(iter_parse_delimited_values(namespace.exclude)),
338
364
  exclude_recursive=tuple(
339
- iter_parse_delimited_values(arguments.exclude_recursive)
365
+ iter_parse_delimited_values(namespace.exclude_recursive)
340
366
  ),
341
- no_version=arguments.no_version,
342
- dependency_order=arguments.dependency_order,
367
+ no_version=namespace.no_version,
368
+ dependency_order=namespace.dependency_order,
369
+ depth=namespace.depth,
343
370
  )
344
371
 
345
372
 
@@ -21,13 +21,12 @@ from typing import (
21
21
 
22
22
  import tomli
23
23
  import tomli_w
24
- from more_itertools import unique_everseen
25
24
  from packaging.requirements import Requirement
26
25
  from packaging.specifiers import Specifier, SpecifierSet
27
26
  from packaging.version import Version
28
27
  from packaging.version import parse as parse_version
29
28
 
30
- from ._utilities import iter_parse_delimited_values
29
+ from ._utilities import iter_distinct, iter_parse_delimited_values
31
30
  from .utilities import (
32
31
  get_installed_distributions,
33
32
  is_requirement_string,
@@ -230,7 +229,7 @@ def get_updated_setup_cfg(
230
229
  # We pre-pend an empty requirement string in order to]
231
230
  # force new-line creation at the beginning of the extra
232
231
  extras_require[all_extra_name] = "\n".join(
233
- unique_everseen([""] + all_extra_requirements)
232
+ iter_distinct([""] + all_extra_requirements)
234
233
  )
235
234
  # Return as a string
236
235
  setup_cfg: str
@@ -369,7 +368,7 @@ def get_updated_pyproject_toml(
369
368
  project_optional_dependencies[extra_name] = extra_requirements
370
369
  if all_extra_name:
371
370
  project_optional_dependencies[all_extra_name] = list(
372
- unique_everseen(all_extra_requirements)
371
+ iter_distinct(all_extra_requirements)
373
372
  )
374
373
  if (
375
374
  build_system_requires
@@ -32,11 +32,14 @@ from typing import (
32
32
  from warnings import warn
33
33
 
34
34
  import tomli
35
- from more_itertools import unique_everseen
36
35
  from packaging.requirements import InvalidRequirement, Requirement
37
36
  from packaging.utils import canonicalize_name
38
37
 
39
- from ._utilities import append_exception_text, get_exception_text
38
+ from ._utilities import (
39
+ append_exception_text,
40
+ get_exception_text,
41
+ iter_distinct,
42
+ )
40
43
 
41
44
  _BUILTIN_DISTRIBUTION_NAMES: Tuple[str] = ("distribute",)
42
45
 
@@ -330,7 +333,7 @@ def _iter_setup_cfg_requirement_strings(path: str) -> Iterable[str]:
330
333
  extra_requirements_string.split("\n"),
331
334
  ),
332
335
  )
333
- return unique_everseen(requirement_strings)
336
+ return iter_distinct(requirement_strings)
334
337
 
335
338
 
336
339
  def _iter_tox_ini_requirement_strings(path: str) -> Iterable[str]:
@@ -358,7 +361,7 @@ def _iter_tox_ini_requirement_strings(path: str) -> Iterable[str]:
358
361
  )
359
362
  return requirements
360
363
 
361
- return unique_everseen(
364
+ return iter_distinct(
362
365
  chain(("tox",), *map(get_section_requirements, parser.sections()))
363
366
  )
364
367
 
@@ -636,6 +639,7 @@ def get_required_distribution_names(
636
639
  exclude: Iterable[str] = (),
637
640
  recursive: bool = True,
638
641
  echo: bool = False,
642
+ depth: Optional[int] = None,
639
643
  ) -> MutableSet[str]:
640
644
  """
641
645
  Return a `tuple` of all distribution names which are required by the
@@ -652,6 +656,8 @@ def get_required_distribution_names(
652
656
  be obtained recursively.
653
657
  - echo (bool) = False: If `True`, commands and responses executed in
654
658
  subprocesses will be printed to `sys.stdout`
659
+ - depth (int|None) = None: The maximum depth of recursion to follow
660
+ requirements. If `None` (the default), recursion is not restricted.
655
661
  """
656
662
  if isinstance(exclude, str):
657
663
  exclude = set((normalize_name(exclude),))
@@ -663,6 +669,7 @@ def get_required_distribution_names(
663
669
  exclude=exclude,
664
670
  recursive=recursive,
665
671
  echo=echo,
672
+ depth=depth,
666
673
  )
667
674
  )
668
675
 
@@ -817,6 +824,7 @@ def _iter_requirement_names(
817
824
  exclude: MutableSet[str],
818
825
  recursive: bool = True,
819
826
  echo: bool = False,
827
+ depth: Optional[int] = None,
820
828
  ) -> Iterable[str]:
821
829
  name: str = normalize_name(requirement.name)
822
830
  extras: Tuple[str, ...] = tuple(requirement.extras)
@@ -831,7 +839,7 @@ def _iter_requirement_names(
831
839
  if distribution is None:
832
840
  return ()
833
841
  requirements: Tuple[Requirement, ...] = tuple(
834
- unique_everseen(
842
+ iter_distinct(
835
843
  _iter_distribution_requirements(
836
844
  distribution,
837
845
  extras=extras,
@@ -843,20 +851,23 @@ def _iter_requirement_names(
843
851
 
844
852
  def iter_requirement_names_(
845
853
  requirement_: Requirement,
854
+ depth_: Optional[int] = None,
846
855
  ) -> Iterable[str]:
847
- return _iter_requirement_names(
848
- requirement_,
849
- exclude=cast(
850
- MutableSet[str],
851
- exclude
852
- | (
853
- lateral_exclude
854
- - set((_get_requirement_name(requirement_),))
856
+ if (depth_ is None) or depth_ >= 0:
857
+ yield from _iter_requirement_names(
858
+ requirement_,
859
+ exclude=cast(
860
+ MutableSet[str],
861
+ exclude
862
+ | (
863
+ lateral_exclude
864
+ - set((_get_requirement_name(requirement_),))
865
+ ),
855
866
  ),
856
- ),
857
- recursive=recursive,
858
- echo=echo,
859
- )
867
+ recursive=recursive,
868
+ echo=echo,
869
+ depth=None if (depth_ is None) else depth_ - 1,
870
+ )
860
871
 
861
872
  def not_excluded(name: str) -> bool:
862
873
  if name not in exclude:
@@ -865,10 +876,19 @@ def _iter_requirement_names(
865
876
  return True
866
877
  return False
867
878
 
879
+ requirement_names: Iterable[str] = filter(
880
+ not_excluded, map(_get_requirement_name, requirements)
881
+ )
868
882
  if recursive:
883
+ requirement_: Requirement
869
884
  requirement_names = chain(
870
- filter(not_excluded, map(_get_requirement_name, requirements)),
871
- *map(iter_requirement_names_, requirements),
885
+ requirement_names,
886
+ *map(
887
+ lambda requirement_: iter_requirement_names_(
888
+ requirement_, None if (depth is None) else depth - 1
889
+ ),
890
+ requirements,
891
+ ),
872
892
  )
873
893
  return requirement_names
874
894
 
@@ -901,7 +921,7 @@ def _iter_requirement_strings_required_distribution_names(
901
921
  pass
902
922
  return set()
903
923
 
904
- return unique_everseen(
924
+ return iter_distinct(
905
925
  chain(*map(get_required_distribution_names_, requirement_strings)),
906
926
  )
907
927
 
@@ -934,7 +954,7 @@ def get_requirements_required_distribution_names(
934
954
  name: str
935
955
  return set(
936
956
  _iter_requirement_strings_required_distribution_names(
937
- unique_everseen(
957
+ iter_distinct(
938
958
  chain(
939
959
  requirement_strings,
940
960
  *map(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dependence
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: Requirement (dependency) management for python projects
5
5
  Home-page: https://github.com/enorganic/dependence
6
6
  Author-email: david@belais.me
@@ -12,7 +12,6 @@ Requires-Dist: packaging
12
12
  Requires-Dist: pip
13
13
  Requires-Dist: tomli~=2.0
14
14
  Requires-Dist: tomli-w~=1.0
15
- Requires-Dist: more-itertools>7
16
15
  Requires-Dist: setuptools>63
17
16
 
18
17
  # dependence
@@ -95,50 +94,43 @@ dependence update -aen all setup.cfg pyproject.toml tox.ini
95
94
 
96
95
  ```console
97
96
  $ dependence freeze -h
98
- usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE]
99
- [-nv NO_VERSION] [-do] [--reverse]
97
+ usage: dependence freeze [-h] [-e EXCLUDE] [-er EXCLUDE_RECURSIVE] [-nv NO_VERSION]
98
+ [-do] [--reverse] [-d DEPTH]
100
99
  requirement [requirement ...]
101
100
 
102
- This command prints dependencies inferred from an installed
103
- distribution or project, in a similar format to the output of `pip
104
- freeze`, except that all generated requirements are specified in the
105
- format "distribution-name==0.0.0" (including for editable
106
- installations). Using this command instead of `pip freeze` to generate
107
- requirement files ensures that you don't bloat your requirements files
108
- with superfluous distributions. The default sorting starts with
109
- directly specified requirements, followed by recursively discovered
110
- requirements, in the order of discovery.
101
+ This command prints dependencies inferred from an installed distribution or project, in
102
+ a similar format to the output of `pip freeze`, except that all generated requirements
103
+ are specified in the format "distribution-name==0.0.0" (including for editable
104
+ installations). Using this command instead of `pip freeze` to generate requirement
105
+ files ensures that you don't bloat your requirements files with superfluous
106
+ distributions.
111
107
 
112
108
  positional arguments:
113
- requirement One or more requirement specifiers (for
114
- example: "requirement-name", "requirement-
115
- name[extra-a,extra-b]", ".[extra-a, extra-b]"
116
- or "../other-editable-package-
117
- directory[extra-a, extra-b]) and/or paths to a
118
- setup.py, setup.cfg, pyproject.toml, tox.ini or
119
- requirements.txt file
109
+ requirement One or more requirement specifiers (for example: "requirement-
110
+ name", "requirement-name[extra-a,extra-b]", ".[extra-a,
111
+ extra-b]" or "../other-editable-package-directory[extra-a,
112
+ extra-b]) and/or paths to a setup.py, setup.cfg,
113
+ pyproject.toml, tox.ini or requirements.txt file
120
114
 
121
115
  optional arguments:
122
116
  -h, --help show this help message and exit
123
117
  -e EXCLUDE, --exclude EXCLUDE
124
- A distribution (or comma-separated list of
125
- distributions) to exclude from the output
118
+ A distribution (or comma-separated list of distributions) to
119
+ exclude from the output
126
120
  -er EXCLUDE_RECURSIVE, --exclude-recursive EXCLUDE_RECURSIVE
127
- A distribution (or comma-separated list of
128
- distributions) to exclude from the output.
129
- Unlike -e / --exclude, this argument also
130
- precludes recursive requirement discovery for
131
- the specified packages, thereby excluding all
132
- of the excluded package's requirements which
133
- are not required by another (non-excluded)
134
- distribution.
121
+ A distribution (or comma-separated list of distributions) to
122
+ exclude from the output. Unlike -e / --exclude, this argument
123
+ also precludes recursive requirement discovery for the
124
+ specified packages, thereby excluding all of the excluded
125
+ package's requirements which are not required by another (non-
126
+ excluded) distribution.
135
127
  -nv NO_VERSION, --no-version NO_VERSION
136
- Don't include versions (only output
137
- distribution names) for packages matching
138
- this/these glob pattern(s) (note: the value
128
+ Don't include versions (only output distribution names) for
129
+ packages matching this/these glob pattern(s) (note: the value
139
130
  must be single-quoted if it contains wildcards)
140
131
  -do, --dependency-order
141
- Sort requirements so that dependents precede
142
- dependencies
132
+ Sort requirements so that dependents precede dependencies
143
133
  --reverse Print requirements in reverse order
134
+ -d DEPTH, --depth DEPTH
135
+ Depth of recursive requirement discovery
144
136
  ```
@@ -2,5 +2,4 @@ packaging
2
2
  pip
3
3
  tomli~=2.0
4
4
  tomli-w~=1.0
5
- more-itertools>7
6
5
  setuptools>63
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = dependence
3
- version = 0.1.1
3
+ version = 0.3.0
4
4
  author_email = david@belais.me
5
5
  description = Requirement (dependency) management for python projects
6
6
  long_description = file: README.md
@@ -20,7 +20,6 @@ install_requires =
20
20
  pip
21
21
  tomli~=2.0
22
22
  tomli-w~=1.0
23
- more-itertools>7
24
23
  setuptools>63
25
24
 
26
25
  [options.entry_points]
File without changes
File without changes