pipgrip 0.10.4__tar.gz → 0.10.6__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.
Files changed (45) hide show
  1. {pipgrip-0.10.4/src/pipgrip.egg-info → pipgrip-0.10.6}/PKG-INFO +21 -10
  2. {pipgrip-0.10.4 → pipgrip-0.10.6}/README.md +20 -9
  3. pipgrip-0.10.6/requirements/prod.txt +10 -0
  4. pipgrip-0.10.6/src/pipgrip/_repo_version.py +1 -0
  5. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/pipper.py +66 -5
  6. {pipgrip-0.10.4 → pipgrip-0.10.6/src/pipgrip.egg-info}/PKG-INFO +21 -10
  7. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip.egg-info/requires.txt +6 -1
  8. pipgrip-0.10.4/requirements/prod.txt +0 -9
  9. pipgrip-0.10.4/src/pipgrip/_repo_version.py +0 -1
  10. {pipgrip-0.10.4 → pipgrip-0.10.6}/LICENSE +0 -0
  11. {pipgrip-0.10.4 → pipgrip-0.10.6}/setup.cfg +0 -0
  12. {pipgrip-0.10.4 → pipgrip-0.10.6}/setup.py +0 -0
  13. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/__init__.py +0 -0
  14. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/cli.py +0 -0
  15. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/compat.py +0 -0
  16. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/__init__.py +0 -0
  17. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/__init__.py +0 -0
  18. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/_compat.py +0 -0
  19. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/assignment.py +0 -0
  20. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/constraint.py +0 -0
  21. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/failure.py +0 -0
  22. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/incompatibility.py +0 -0
  23. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/incompatibility_cause.py +0 -0
  24. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/package.py +0 -0
  25. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/package_source.py +0 -0
  26. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/partial_solution.py +0 -0
  27. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/range.py +0 -0
  28. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/result.py +0 -0
  29. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/set_relation.py +0 -0
  30. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/term.py +0 -0
  31. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/union.py +0 -0
  32. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/mixology/version_solver.py +0 -0
  33. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/__init__.py +0 -0
  34. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/empty_constraint.py +0 -0
  35. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/exceptions.py +0 -0
  36. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/patterns.py +0 -0
  37. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/version.py +0 -0
  38. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/version_constraint.py +0 -0
  39. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/version_range.py +0 -0
  40. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/libs/semver/version_union.py +0 -0
  41. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip/package_source.py +0 -0
  42. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip.egg-info/SOURCES.txt +0 -0
  43. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip.egg-info/dependency_links.txt +0 -0
  44. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip.egg-info/entry_points.txt +0 -0
  45. {pipgrip-0.10.4 → pipgrip-0.10.6}/src/pipgrip.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pipgrip
3
- Version: 0.10.4
3
+ Version: 0.10.6
4
4
  Summary: Lightweight pip dependency resolver with deptree preview functionality based on the PubGrub algorithm
5
5
  Home-page: https://github.com/ddelange/pipgrip
6
6
  Author: ddelange
@@ -43,6 +43,18 @@ License-File: LICENSE
43
43
 
44
44
  [pipgrip](https://github.com/ddelange/pipgrip) is a lightweight pip dependency resolver with deptree preview functionality based on the [PubGrub algorithm](https://medium.com/@nex3/pubgrub-2fb6470504f), which is also used by [poetry](https://github.com/python-poetry/poetry). For one or more [PEP 508](https://www.python.org/dev/peps/pep-0508/) dependency specifications, pipgrip recursively fetches/builds the Python wheels necessary for version solving, and optionally renders the full resulting dependency tree.
45
45
 
46
+ ```
47
+ $ pipgrip --tree fastapi~=0.94
48
+
49
+ fastapi~=0.94 (0.95.1)
50
+ ├── pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 (1.10.7)
51
+ │ └── typing-extensions>=4.2.0 (4.5.0)
52
+ └── starlette<0.27.0,>=0.26.1 (0.26.1)
53
+ └── anyio<5,>=3.4.0 (3.6.2)
54
+ ├── idna>=2.8 (3.4)
55
+ └── sniffio>=1.1 (1.3.0)
56
+ ```
57
+
46
58
  #### pipgrip vs. poetry
47
59
 
48
60
  [poetry](https://github.com/python-poetry/poetry) offers package management with dependency resolution, essentially replacing pip/setuptools. This means that poetry packages don't contain `setup.py`, and hence are not compatible with `pip install -e`: poetry projects would have to be converted to setuptools-based projects with e.g. [dephell](https://github.com/dephell/dephell). To avoid such hassle, pipgrip only requires the selected package(s) + dependencies to be available to pip in the usual way.
@@ -144,15 +156,14 @@ Exhaustive dependency trees without the need to install any packages ([at most b
144
156
  ```
145
157
  $ pipgrip --tree pipgrip
146
158
 
147
- pipgrip (0.10.0)
148
- ├── anytree>=2.4.1 (2.8.0)
149
- │ └── six>=1.9.0 (1.16.0)
150
- ├── click>=7 (8.1.3)
151
- ├── packaging>=17 (22.0)
152
- ├── pip>=7.1.0 (22.3.1)
153
- ├── pkginfo<1.8,>=1.4.2 (1.7.1)
154
- ├── setuptools>=38.3 (65.6.3)
155
- └── wheel (0.38.4)
159
+ pipgrip (0.10.6)
160
+ ├── anytree>=2.4.1 (2.9.0)
161
+ │ └── six (1.16.0)
162
+ ├── click>=7 (8.1.6)
163
+ ├── packaging>=17 (23.1)
164
+ ├── pip>=22.2 (23.2.1)
165
+ ├── setuptools>=38.3 (68.0.0)
166
+ └── wheel (0.41.1)
156
167
  ```
157
168
 
158
169
  For more details/further processing, combine `--tree` with `--json` for a detailed nested JSON dependency tree. See also `--tree-ascii` (no unicode tree markers), and `--tree-json` & `--tree-json-exact` (simplified JSON dependency trees).
@@ -9,6 +9,18 @@
9
9
 
10
10
  [pipgrip](https://github.com/ddelange/pipgrip) is a lightweight pip dependency resolver with deptree preview functionality based on the [PubGrub algorithm](https://medium.com/@nex3/pubgrub-2fb6470504f), which is also used by [poetry](https://github.com/python-poetry/poetry). For one or more [PEP 508](https://www.python.org/dev/peps/pep-0508/) dependency specifications, pipgrip recursively fetches/builds the Python wheels necessary for version solving, and optionally renders the full resulting dependency tree.
11
11
 
12
+ ```
13
+ $ pipgrip --tree fastapi~=0.94
14
+
15
+ fastapi~=0.94 (0.95.1)
16
+ ├── pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 (1.10.7)
17
+ │ └── typing-extensions>=4.2.0 (4.5.0)
18
+ └── starlette<0.27.0,>=0.26.1 (0.26.1)
19
+ └── anyio<5,>=3.4.0 (3.6.2)
20
+ ├── idna>=2.8 (3.4)
21
+ └── sniffio>=1.1 (1.3.0)
22
+ ```
23
+
12
24
  #### pipgrip vs. poetry
13
25
 
14
26
  [poetry](https://github.com/python-poetry/poetry) offers package management with dependency resolution, essentially replacing pip/setuptools. This means that poetry packages don't contain `setup.py`, and hence are not compatible with `pip install -e`: poetry projects would have to be converted to setuptools-based projects with e.g. [dephell](https://github.com/dephell/dephell). To avoid such hassle, pipgrip only requires the selected package(s) + dependencies to be available to pip in the usual way.
@@ -110,15 +122,14 @@ Exhaustive dependency trees without the need to install any packages ([at most b
110
122
  ```
111
123
  $ pipgrip --tree pipgrip
112
124
 
113
- pipgrip (0.10.0)
114
- ├── anytree>=2.4.1 (2.8.0)
115
- │ └── six>=1.9.0 (1.16.0)
116
- ├── click>=7 (8.1.3)
117
- ├── packaging>=17 (22.0)
118
- ├── pip>=7.1.0 (22.3.1)
119
- ├── pkginfo<1.8,>=1.4.2 (1.7.1)
120
- ├── setuptools>=38.3 (65.6.3)
121
- └── wheel (0.38.4)
125
+ pipgrip (0.10.6)
126
+ ├── anytree>=2.4.1 (2.9.0)
127
+ │ └── six (1.16.0)
128
+ ├── click>=7 (8.1.6)
129
+ ├── packaging>=17 (23.1)
130
+ ├── pip>=22.2 (23.2.1)
131
+ ├── setuptools>=38.3 (68.0.0)
132
+ └── wheel (0.41.1)
122
133
  ```
123
134
 
124
135
  For more details/further processing, combine `--tree` with `--json` for a detailed nested JSON dependency tree. See also `--tree-ascii` (no unicode tree markers), and `--tree-json` & `--tree-json-exact` (simplified JSON dependency trees).
@@ -0,0 +1,10 @@
1
+ anytree>=2.4.1
2
+ click>=7
3
+ packaging>=17
4
+ setuptools>=38.3 # for pkg_resources
5
+ wheel
6
+ pip>=22.2; python_version>'3.6' # >=22.2 for --dry-run --report ref ddelange/pipgrip#114
7
+ pip>=7.1.0; python_version<='3.6' # >=7.1.0 for --constraint
8
+ pkginfo>=1.4.2,<1.8; python_version<='3.6' # ref ddelange/pipgrip#68 and ddelange/pipgrip#114
9
+ enum34; python_version=='2.7'
10
+ typing; python_version=='2.7'
@@ -0,0 +1 @@
1
+ version = "0.10.6"
@@ -1,4 +1,5 @@
1
1
  import io
2
+ import json
2
3
  import logging
3
4
  import os
4
5
  import re
@@ -10,7 +11,6 @@ import pkg_resources
10
11
  from click import echo as _echo
11
12
  from packaging.markers import default_environment
12
13
  from packaging.utils import canonicalize_name
13
- from pkginfo import get_metadata
14
14
 
15
15
  from pipgrip.compat import PIP_VERSION, urlparse
16
16
 
@@ -254,6 +254,59 @@ def _get_available_versions(package, index_url, extra_index_url, pre):
254
254
  raise RuntimeError("Failed to get available versions for {}".format(package))
255
255
 
256
256
 
257
+ def _get_package_report(package, index_url, extra_index_url, pre, cache_dir):
258
+ """Get metadata (install report) using pip's --dry-run --report functionality."""
259
+ logger.debug(
260
+ "Getting report for {} (with fallback cache_dir {})".format(package, cache_dir)
261
+ )
262
+ args = [
263
+ sys.executable,
264
+ "-m",
265
+ "pip",
266
+ "install",
267
+ "-qq",
268
+ "--no-deps",
269
+ "--ignore-installed",
270
+ "--disable-pip-version-check",
271
+ "--dry-run",
272
+ "--no-deps",
273
+ ]
274
+ if pre:
275
+ args += ["--pre"]
276
+ if cache_dir is not None:
277
+ args += [
278
+ "--cache-dir",
279
+ cache_dir,
280
+ ]
281
+ if index_url is not None:
282
+ args += [
283
+ "--index-url",
284
+ index_url,
285
+ "--trusted-host",
286
+ urlparse(index_url).hostname,
287
+ ]
288
+ if extra_index_url is not None:
289
+ args += [
290
+ "--extra-index-url",
291
+ extra_index_url,
292
+ "--trusted-host",
293
+ urlparse(extra_index_url).hostname,
294
+ ]
295
+ args += ["--report", "-", package]
296
+ try:
297
+ out = stream_bash_command(args)
298
+ except subprocess.CalledProcessError as err:
299
+ output = getattr(err, "output") or ""
300
+ logger.error(
301
+ "Getting report for {} failed with output:\n{}".format(
302
+ package, output.strip()
303
+ )
304
+ )
305
+ raise RuntimeError("Failed to get report for {}".format(package))
306
+ report = json.loads(out)
307
+ return report
308
+
309
+
257
310
  def _download_wheel(package, index_url, extra_index_url, pre, cache_dir):
258
311
  """Download/build wheel for package and return its filename."""
259
312
  logger.debug(
@@ -352,6 +405,8 @@ def _download_wheel(package, index_url, extra_index_url, pre, cache_dir):
352
405
 
353
406
 
354
407
  def _extract_metadata(wheel_fname):
408
+ from pkginfo import get_metadata # not required on python 3.7+
409
+
355
410
  wheel_fname = os.path.abspath(wheel_fname)
356
411
  logger.debug("Searching metadata in %s", wheel_fname)
357
412
  if not os.path.exists(wheel_fname):
@@ -419,10 +474,16 @@ def discover_dependencies_and_versions(
419
474
  extras_requested = sorted(req.extras)
420
475
 
421
476
  logger.info("discovering %s", req)
422
- wheel_fname = _download_wheel(
423
- req.__str__(), index_url, extra_index_url, pre, cache_dir
424
- )
425
- wheel_metadata = _extract_metadata(wheel_fname)
477
+ if PIP_VERSION >= [22, 2]:
478
+ report = _get_package_report(
479
+ req.__str__(), index_url, extra_index_url, pre, cache_dir
480
+ )
481
+ wheel_metadata = report["install"][0]["metadata"]
482
+ else: # old python (<3.7) fallback
483
+ wheel_fname = _download_wheel(
484
+ req.__str__(), index_url, extra_index_url, pre, cache_dir
485
+ )
486
+ wheel_metadata = _extract_metadata(wheel_fname)
426
487
  wheel_requirements = _get_wheel_requirements(wheel_metadata, extras_requested)
427
488
  wheel_version = req.url or wheel_metadata["version"]
428
489
  available_versions = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pipgrip
3
- Version: 0.10.4
3
+ Version: 0.10.6
4
4
  Summary: Lightweight pip dependency resolver with deptree preview functionality based on the PubGrub algorithm
5
5
  Home-page: https://github.com/ddelange/pipgrip
6
6
  Author: ddelange
@@ -43,6 +43,18 @@ License-File: LICENSE
43
43
 
44
44
  [pipgrip](https://github.com/ddelange/pipgrip) is a lightweight pip dependency resolver with deptree preview functionality based on the [PubGrub algorithm](https://medium.com/@nex3/pubgrub-2fb6470504f), which is also used by [poetry](https://github.com/python-poetry/poetry). For one or more [PEP 508](https://www.python.org/dev/peps/pep-0508/) dependency specifications, pipgrip recursively fetches/builds the Python wheels necessary for version solving, and optionally renders the full resulting dependency tree.
45
45
 
46
+ ```
47
+ $ pipgrip --tree fastapi~=0.94
48
+
49
+ fastapi~=0.94 (0.95.1)
50
+ ├── pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 (1.10.7)
51
+ │ └── typing-extensions>=4.2.0 (4.5.0)
52
+ └── starlette<0.27.0,>=0.26.1 (0.26.1)
53
+ └── anyio<5,>=3.4.0 (3.6.2)
54
+ ├── idna>=2.8 (3.4)
55
+ └── sniffio>=1.1 (1.3.0)
56
+ ```
57
+
46
58
  #### pipgrip vs. poetry
47
59
 
48
60
  [poetry](https://github.com/python-poetry/poetry) offers package management with dependency resolution, essentially replacing pip/setuptools. This means that poetry packages don't contain `setup.py`, and hence are not compatible with `pip install -e`: poetry projects would have to be converted to setuptools-based projects with e.g. [dephell](https://github.com/dephell/dephell). To avoid such hassle, pipgrip only requires the selected package(s) + dependencies to be available to pip in the usual way.
@@ -144,15 +156,14 @@ Exhaustive dependency trees without the need to install any packages ([at most b
144
156
  ```
145
157
  $ pipgrip --tree pipgrip
146
158
 
147
- pipgrip (0.10.0)
148
- ├── anytree>=2.4.1 (2.8.0)
149
- │ └── six>=1.9.0 (1.16.0)
150
- ├── click>=7 (8.1.3)
151
- ├── packaging>=17 (22.0)
152
- ├── pip>=7.1.0 (22.3.1)
153
- ├── pkginfo<1.8,>=1.4.2 (1.7.1)
154
- ├── setuptools>=38.3 (65.6.3)
155
- └── wheel (0.38.4)
159
+ pipgrip (0.10.6)
160
+ ├── anytree>=2.4.1 (2.9.0)
161
+ │ └── six (1.16.0)
162
+ ├── click>=7 (8.1.6)
163
+ ├── packaging>=17 (23.1)
164
+ ├── pip>=22.2 (23.2.1)
165
+ ├── setuptools>=38.3 (68.0.0)
166
+ └── wheel (0.41.1)
156
167
  ```
157
168
 
158
169
  For more details/further processing, combine `--tree` with `--json` for a detailed nested JSON dependency tree. See also `--tree-ascii` (no unicode tree markers), and `--tree-json` & `--tree-json-exact` (simplified JSON dependency trees).
@@ -1,11 +1,16 @@
1
1
  anytree>=2.4.1
2
2
  click>=7
3
3
  packaging>=17
4
- pkginfo<1.8,>=1.4.2
5
4
  setuptools>=38.3
6
5
  wheel
6
+
7
+ [:python_version <= "3.6"]
7
8
  pip>=7.1.0
9
+ pkginfo<1.8,>=1.4.2
8
10
 
9
11
  [:python_version == "2.7"]
10
12
  enum34
11
13
  typing
14
+
15
+ [:python_version > "3.6"]
16
+ pip>=22.2
@@ -1,9 +0,0 @@
1
- anytree>=2.4.1
2
- click>=7
3
- packaging>=17
4
- pkginfo>=1.4.2,<1.8 # ref ddelange/pipgrip#68
5
- setuptools>=38.3 # for pkg_resources
6
- wheel
7
- pip>=7.1.0 # >=7.1.0 for --constraint
8
- enum34; python_version=='2.7'
9
- typing; python_version=='2.7'
@@ -1 +0,0 @@
1
- version = "0.10.4"
File without changes
File without changes
File without changes
File without changes
File without changes