dependence 1.1.0__py3-none-any.whl → 1.1.2__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/freeze.py CHANGED
@@ -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: MutableSet[str] = set()
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
- configuration_files |= requirement_configuration_files
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
- *map(
141
- partial(
142
- iter_configuration_file_requirement_strings,
143
- include_pointers=include_pointers,
144
- exclude_pointers=exclude_pointers,
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/ignore
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`.
dependence/update.py CHANGED
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dependence
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary: A dependency management tool for python projects
5
5
  Project-URL: Documentation, https://dependence.enorganic.org
6
6
  Project-URL: Repository, https://github.com/enorganic/dependence
@@ -1,11 +1,11 @@
1
1
  dependence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  dependence/__main__.py,sha256=zk67MINE1FpsBcXDDvRiHQwmO7_4iay_Rkq3JTPrha4,1802
3
3
  dependence/_utilities.py,sha256=CxIl7BkoTqMtrOsJzq544_RDa8-QtZufKj31PazIBFI,36790
4
- dependence/freeze.py,sha256=gZ3ZJuxphojUmlx8LoZ-qFTd-EUTPF-oM-FKFYVxoSs,15518
4
+ dependence/freeze.py,sha256=MMv7_feEXfRo8cxyrgK0su17k1k8uLXWwpRCvrj-vz8,16184
5
5
  dependence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- dependence/update.py,sha256=k6KtRbJORnbC7-bkDbVCDjsJkwVkGshQncLh1RjmolU,20554
6
+ dependence/update.py,sha256=QLe6sx39PKM3x6TxMzQxTUPDSKn8d7UizIVpbqMZuJI,20707
7
7
  dependence/upgrade.py,sha256=lNovLvKhxiczZAJj2_hHrbkDscNOTrx1xaOhmobVNSI,7747
8
- dependence-1.1.0.dist-info/METADATA,sha256=mUjlA-89b_G0rNU0uLrgxznIqKeFGu7fQtkmMx4pGCM,8364
9
- dependence-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- dependence-1.1.0.dist-info/entry_points.txt,sha256=NStO_B0D81ObVYr9zDs6LCy0whm0a8KCiiFHMmTwOVE,56
11
- dependence-1.1.0.dist-info/RECORD,,
8
+ dependence-1.1.2.dist-info/METADATA,sha256=XhMrXo14In72SHqOStXK0bn8NVEm4XqWkbGBWOyUCUo,8364
9
+ dependence-1.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ dependence-1.1.2.dist-info/entry_points.txt,sha256=NStO_B0D81ObVYr9zDs6LCy0whm0a8KCiiFHMmTwOVE,56
11
+ dependence-1.1.2.dist-info/RECORD,,