importlib-metadata 7.0.2__tar.gz → 7.2.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.
Files changed (68) hide show
  1. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.github/workflows/main.yml +8 -3
  2. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.readthedocs.yaml +5 -1
  3. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/NEWS.rst +26 -0
  4. {importlib_metadata-7.0.2/importlib_metadata.egg-info → importlib_metadata-7.2.0}/PKG-INFO +24 -23
  5. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/conf.py +1 -1
  6. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/__init__.py +15 -6
  7. importlib_metadata-7.0.2/importlib_metadata/_py39compat.py → importlib_metadata-7.2.0/importlib_metadata/compat/py39.py +3 -3
  8. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0/importlib_metadata.egg-info}/PKG-INFO +24 -23
  9. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata.egg-info/SOURCES.txt +6 -4
  10. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata.egg-info/requires.txt +6 -7
  11. importlib_metadata-7.2.0/pyproject.toml +62 -0
  12. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/pytest.ini +4 -1
  13. importlib_metadata-7.2.0/setup.cfg +4 -0
  14. importlib_metadata-7.2.0/tests/compat/__init__.py +0 -0
  15. importlib_metadata-7.2.0/tests/compat/py312.py +18 -0
  16. importlib_metadata-7.2.0/tests/compat/py39.py +9 -0
  17. importlib_metadata-7.0.2/tests/test_py39compat.py → importlib_metadata-7.2.0/tests/compat/test_py39_compat.py +2 -3
  18. importlib_metadata-7.2.0/tests/data/__init__.py +0 -0
  19. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/fixtures.py +13 -28
  20. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/test_api.py +1 -1
  21. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/test_main.py +4 -1
  22. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tox.ini +3 -3
  23. importlib_metadata-7.0.2/pyproject.toml +0 -5
  24. importlib_metadata-7.0.2/setup.cfg +0 -53
  25. importlib_metadata-7.0.2/tests/py39compat.py +0 -4
  26. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.coveragerc +0 -0
  27. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.editorconfig +0 -0
  28. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.github/FUNDING.yml +0 -0
  29. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.github/dependabot.yml +0 -0
  30. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.gitignore +0 -0
  31. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/.pre-commit-config.yaml +0 -0
  32. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/LICENSE +0 -0
  33. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/README.rst +0 -0
  34. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/SECURITY.md +0 -0
  35. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/conftest.py +0 -0
  36. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/__init__.py +0 -0
  37. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/api.rst +0 -0
  38. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/history.rst +0 -0
  39. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/index.rst +0 -0
  40. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/docs/migration.rst +0 -0
  41. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/exercises.py +0 -0
  42. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_adapters.py +0 -0
  43. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_collections.py +0 -0
  44. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_compat.py +0 -0
  45. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_functools.py +0 -0
  46. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_itertools.py +0 -0
  47. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_meta.py +0 -0
  48. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/_text.py +0 -0
  49. {importlib_metadata-7.0.2/tests → importlib_metadata-7.2.0/importlib_metadata/compat}/__init__.py +0 -0
  50. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/diagnose.py +0 -0
  51. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata/py.typed +0 -0
  52. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata.egg-info/dependency_links.txt +0 -0
  53. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/importlib_metadata.egg-info/top_level.txt +0 -0
  54. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/mypy.ini +0 -0
  55. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/ruff.toml +0 -0
  56. {importlib_metadata-7.0.2/tests/data → importlib_metadata-7.2.0/tests}/__init__.py +0 -0
  57. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/_context.py +0 -0
  58. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/_path.py +0 -0
  59. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/example-21.12-py3-none-any.whl +0 -0
  60. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/example-21.12-py3.6.egg +0 -0
  61. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/example2-1.0.0-py3-none-any.whl +0 -0
  62. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/sources/example/example/__init__.py +0 -0
  63. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/sources/example/setup.py +0 -0
  64. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/sources/example2/example2/__init__.py +0 -0
  65. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/data/sources/example2/pyproject.toml +0 -0
  66. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/test_integration.py +0 -0
  67. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/tests/test_zip.py +0 -0
  68. {importlib_metadata-7.0.2 → importlib_metadata-7.2.0}/towncrier.toml +0 -0
@@ -4,8 +4,11 @@ on:
4
4
  merge_group:
5
5
  push:
6
6
  branches-ignore:
7
- # disabled for jaraco/skeleton#103
8
- # - gh-readonly-queue/** # Temporary merge queue-related GH-made branches
7
+ # temporary GH branches relating to merge queues (jaraco/skeleton#93)
8
+ - gh-readonly-queue/**
9
+ tags:
10
+ # required if branches-ignore is supplied (jaraco/skeleton#103)
11
+ - '**'
9
12
  pull_request:
10
13
 
11
14
  permissions:
@@ -28,10 +31,10 @@ env:
28
31
  jobs:
29
32
  test:
30
33
  strategy:
34
+ # https://blog.jaraco.com/efficient-use-of-ci-resources/
31
35
  matrix:
32
36
  python:
33
37
  - "3.8"
34
- - "3.11"
35
38
  - "3.12"
36
39
  platform:
37
40
  - ubuntu-latest
@@ -42,6 +45,8 @@ jobs:
42
45
  platform: ubuntu-latest
43
46
  - python: "3.10"
44
47
  platform: ubuntu-latest
48
+ - python: "3.11"
49
+ platform: ubuntu-latest
45
50
  - python: pypy3.10
46
51
  platform: ubuntu-latest
47
52
  runs-on: ${{ matrix.platform }}
@@ -3,10 +3,14 @@ python:
3
3
  install:
4
4
  - path: .
5
5
  extra_requirements:
6
- - docs
6
+ - doc
7
7
 
8
8
  # required boilerplate readthedocs/readthedocs.org#10401
9
9
  build:
10
10
  os: ubuntu-lts-latest
11
11
  tools:
12
12
  python: latest
13
+ # post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114
14
+ jobs:
15
+ post_checkout:
16
+ - git fetch --unshallow || true
@@ -1,3 +1,29 @@
1
+ v7.2.0
2
+ ======
3
+
4
+ Features
5
+ --------
6
+
7
+ - Deferred select imports in for speedup (python/cpython#109829).
8
+ - Updated fixtures for python/cpython#120801.
9
+
10
+
11
+ v7.1.0
12
+ ======
13
+
14
+ Features
15
+ --------
16
+
17
+ - Improve import time (python/cpython#114664).
18
+
19
+
20
+ Bugfixes
21
+ --------
22
+
23
+ - Make MetadataPathFinder.find_distributions a classmethod for consistency with CPython. Closes #484. (#484)
24
+ - Allow ``MetadataPathFinder.invalidate_caches`` to be called as a classmethod.
25
+
26
+
1
27
  v7.0.2
2
28
  ======
3
29
 
@@ -1,38 +1,39 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: importlib_metadata
3
- Version: 7.0.2
3
+ Version: 7.2.0
4
4
  Summary: Read metadata from Python packages
5
- Home-page: https://github.com/python/importlib_metadata
6
- Author: Jason R. Coombs
7
- Author-email: jaraco@jaraco.com
5
+ Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
6
+ Project-URL: Homepage, https://github.com/python/importlib_metadata
8
7
  Classifier: Development Status :: 5 - Production/Stable
9
8
  Classifier: Intended Audience :: Developers
10
9
  Classifier: License :: OSI Approved :: Apache Software License
11
10
  Classifier: Programming Language :: Python :: 3
12
11
  Classifier: Programming Language :: Python :: 3 :: Only
13
12
  Requires-Python: >=3.8
13
+ Description-Content-Type: text/x-rst
14
14
  License-File: LICENSE
15
15
  Requires-Dist: zipp>=0.5
16
16
  Requires-Dist: typing-extensions>=3.6.4; python_version < "3.8"
17
- Provides-Extra: testing
18
- Requires-Dist: pytest>=6; extra == "testing"
19
- Requires-Dist: pytest-checkdocs>=2.4; extra == "testing"
20
- Requires-Dist: pytest-cov; extra == "testing"
21
- Requires-Dist: pytest-mypy; platform_python_implementation != "PyPy" and extra == "testing"
22
- Requires-Dist: pytest-enabler>=2.2; extra == "testing"
23
- Requires-Dist: pytest-ruff>=0.2.1; extra == "testing"
24
- Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "testing"
25
- Requires-Dist: packaging; extra == "testing"
26
- Requires-Dist: pyfakefs; extra == "testing"
27
- Requires-Dist: flufl.flake8; extra == "testing"
28
- Requires-Dist: pytest-perf>=0.9.2; extra == "testing"
29
- Provides-Extra: docs
30
- Requires-Dist: sphinx>=3.5; extra == "docs"
31
- Requires-Dist: jaraco.packaging>=9.3; extra == "docs"
32
- Requires-Dist: rst.linker>=1.9; extra == "docs"
33
- Requires-Dist: furo; extra == "docs"
34
- Requires-Dist: sphinx-lint; extra == "docs"
35
- Requires-Dist: jaraco.tidelift>=1.4; extra == "docs"
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
19
+ Requires-Dist: pytest-checkdocs>=2.4; extra == "test"
20
+ Requires-Dist: pytest-cov; extra == "test"
21
+ Requires-Dist: pytest-mypy; extra == "test"
22
+ Requires-Dist: pytest-enabler>=2.2; extra == "test"
23
+ Requires-Dist: pytest-ruff>=0.2.1; extra == "test"
24
+ Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "test"
25
+ Requires-Dist: packaging; extra == "test"
26
+ Requires-Dist: pyfakefs; extra == "test"
27
+ Requires-Dist: flufl.flake8; extra == "test"
28
+ Requires-Dist: pytest-perf>=0.9.2; extra == "test"
29
+ Requires-Dist: jaraco.test>=5.4; extra == "test"
30
+ Provides-Extra: doc
31
+ Requires-Dist: sphinx>=3.5; extra == "doc"
32
+ Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
33
+ Requires-Dist: rst.linker>=1.9; extra == "doc"
34
+ Requires-Dist: furo; extra == "doc"
35
+ Requires-Dist: sphinx-lint; extra == "doc"
36
+ Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
36
37
  Provides-Extra: perf
37
38
  Requires-Dist: ipython; extra == "perf"
38
39
 
@@ -25,7 +25,7 @@ link_files = {
25
25
  url='https://peps.python.org/pep-{pep_number:0>4}/',
26
26
  ),
27
27
  dict(
28
- pattern=r'(Python #|py-)(?P<python>\d+)',
28
+ pattern=r'(python/cpython#|Python #|py-)(?P<python>\d+)',
29
29
  url='https://github.com/python/cpython/issues/{python}',
30
30
  ),
31
31
  ],
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  import os
4
4
  import re
5
5
  import abc
6
- import csv
7
6
  import sys
8
7
  import json
9
8
  import zipp
@@ -19,7 +18,8 @@ import itertools
19
18
  import posixpath
20
19
  import collections
21
20
 
22
- from . import _adapters, _meta, _py39compat
21
+ from . import _meta
22
+ from .compat import py39
23
23
  from ._collections import FreezableDefaultDict, Pair
24
24
  from ._compat import (
25
25
  NullFinder,
@@ -280,7 +280,7 @@ class EntryPoints(tuple):
280
280
  Select entry points from self that match the
281
281
  given parameters (typically group and/or name).
282
282
  """
283
- return EntryPoints(ep for ep in self if _py39compat.ep_matches(ep, **params))
283
+ return EntryPoints(ep for ep in self if py39.ep_matches(ep, **params))
284
284
 
285
285
  @property
286
286
  def names(self) -> Set[str]:
@@ -461,6 +461,9 @@ class Distribution(DeprecatedNonAbstract):
461
461
  Custom providers may provide the METADATA file or override this
462
462
  property.
463
463
  """
464
+ # deferred for performance (python/cpython#109829)
465
+ from . import _adapters
466
+
464
467
  opt_text = (
465
468
  self.read_text('METADATA')
466
469
  or self.read_text('PKG-INFO')
@@ -522,6 +525,10 @@ class Distribution(DeprecatedNonAbstract):
522
525
 
523
526
  @pass_none
524
527
  def make_files(lines):
528
+ # Delay csv import, since Distribution.files is not as widely used
529
+ # as other parts of importlib.metadata
530
+ import csv
531
+
525
532
  return starmap(make_file, csv.reader(lines))
526
533
 
527
534
  @pass_none
@@ -873,8 +880,9 @@ class MetadataPathFinder(NullFinder, DistributionFinder):
873
880
  of Python that do not have a PathFinder find_distributions().
874
881
  """
875
882
 
883
+ @classmethod
876
884
  def find_distributions(
877
- self, context=DistributionFinder.Context()
885
+ cls, context=DistributionFinder.Context()
878
886
  ) -> Iterable[PathDistribution]:
879
887
  """
880
888
  Find distributions.
@@ -884,7 +892,7 @@ class MetadataPathFinder(NullFinder, DistributionFinder):
884
892
  (or all names if ``None`` indicated) along the paths in the list
885
893
  of directories ``context.path``.
886
894
  """
887
- found = self._search_paths(context.name, context.path)
895
+ found = cls._search_paths(context.name, context.path)
888
896
  return map(PathDistribution, found)
889
897
 
890
898
  @classmethod
@@ -895,6 +903,7 @@ class MetadataPathFinder(NullFinder, DistributionFinder):
895
903
  path.search(prepared) for path in map(FastPath, paths)
896
904
  )
897
905
 
906
+ @classmethod
898
907
  def invalidate_caches(cls) -> None:
899
908
  FastPath.__new__.cache_clear()
900
909
 
@@ -992,7 +1001,7 @@ def version(distribution_name: str) -> str:
992
1001
 
993
1002
  _unique = functools.partial(
994
1003
  unique_everseen,
995
- key=_py39compat.normalized_name,
1004
+ key=py39.normalized_name,
996
1005
  )
997
1006
  """
998
1007
  Wrapper for ``distributions`` to return unique distributions by name.
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Any, Optional
6
6
 
7
7
  if TYPE_CHECKING: # pragma: no cover
8
8
  # Prevent circular imports on runtime.
9
- from . import Distribution, EntryPoint
9
+ from .. import Distribution, EntryPoint
10
10
  else:
11
11
  Distribution = EntryPoint = Any
12
12
 
@@ -18,7 +18,7 @@ def normalized_name(dist: Distribution) -> Optional[str]:
18
18
  try:
19
19
  return dist._normalized_name
20
20
  except AttributeError:
21
- from . import Prepared # -> delay to prevent circular imports.
21
+ from .. import Prepared # -> delay to prevent circular imports.
22
22
 
23
23
  return Prepared.normalize(getattr(dist, "name", None) or dist.metadata['Name'])
24
24
 
@@ -30,7 +30,7 @@ def ep_matches(ep: EntryPoint, **params) -> bool:
30
30
  try:
31
31
  return ep.matches(**params)
32
32
  except AttributeError:
33
- from . import EntryPoint # -> delay to prevent circular imports.
33
+ from .. import EntryPoint # -> delay to prevent circular imports.
34
34
 
35
35
  # Reconstruct the EntryPoint object to make sure it is compatible.
36
36
  return EntryPoint(ep.name, ep.value, ep.group).matches(**params)
@@ -1,38 +1,39 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: importlib_metadata
3
- Version: 7.0.2
3
+ Version: 7.2.0
4
4
  Summary: Read metadata from Python packages
5
- Home-page: https://github.com/python/importlib_metadata
6
- Author: Jason R. Coombs
7
- Author-email: jaraco@jaraco.com
5
+ Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
6
+ Project-URL: Homepage, https://github.com/python/importlib_metadata
8
7
  Classifier: Development Status :: 5 - Production/Stable
9
8
  Classifier: Intended Audience :: Developers
10
9
  Classifier: License :: OSI Approved :: Apache Software License
11
10
  Classifier: Programming Language :: Python :: 3
12
11
  Classifier: Programming Language :: Python :: 3 :: Only
13
12
  Requires-Python: >=3.8
13
+ Description-Content-Type: text/x-rst
14
14
  License-File: LICENSE
15
15
  Requires-Dist: zipp>=0.5
16
16
  Requires-Dist: typing-extensions>=3.6.4; python_version < "3.8"
17
- Provides-Extra: testing
18
- Requires-Dist: pytest>=6; extra == "testing"
19
- Requires-Dist: pytest-checkdocs>=2.4; extra == "testing"
20
- Requires-Dist: pytest-cov; extra == "testing"
21
- Requires-Dist: pytest-mypy; platform_python_implementation != "PyPy" and extra == "testing"
22
- Requires-Dist: pytest-enabler>=2.2; extra == "testing"
23
- Requires-Dist: pytest-ruff>=0.2.1; extra == "testing"
24
- Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "testing"
25
- Requires-Dist: packaging; extra == "testing"
26
- Requires-Dist: pyfakefs; extra == "testing"
27
- Requires-Dist: flufl.flake8; extra == "testing"
28
- Requires-Dist: pytest-perf>=0.9.2; extra == "testing"
29
- Provides-Extra: docs
30
- Requires-Dist: sphinx>=3.5; extra == "docs"
31
- Requires-Dist: jaraco.packaging>=9.3; extra == "docs"
32
- Requires-Dist: rst.linker>=1.9; extra == "docs"
33
- Requires-Dist: furo; extra == "docs"
34
- Requires-Dist: sphinx-lint; extra == "docs"
35
- Requires-Dist: jaraco.tidelift>=1.4; extra == "docs"
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
19
+ Requires-Dist: pytest-checkdocs>=2.4; extra == "test"
20
+ Requires-Dist: pytest-cov; extra == "test"
21
+ Requires-Dist: pytest-mypy; extra == "test"
22
+ Requires-Dist: pytest-enabler>=2.2; extra == "test"
23
+ Requires-Dist: pytest-ruff>=0.2.1; extra == "test"
24
+ Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "test"
25
+ Requires-Dist: packaging; extra == "test"
26
+ Requires-Dist: pyfakefs; extra == "test"
27
+ Requires-Dist: flufl.flake8; extra == "test"
28
+ Requires-Dist: pytest-perf>=0.9.2; extra == "test"
29
+ Requires-Dist: jaraco.test>=5.4; extra == "test"
30
+ Provides-Extra: doc
31
+ Requires-Dist: sphinx>=3.5; extra == "doc"
32
+ Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
33
+ Requires-Dist: rst.linker>=1.9; extra == "doc"
34
+ Requires-Dist: furo; extra == "doc"
35
+ Requires-Dist: sphinx-lint; extra == "doc"
36
+ Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
36
37
  Provides-Extra: perf
37
38
  Requires-Dist: ipython; extra == "perf"
38
39
 
@@ -13,7 +13,6 @@ mypy.ini
13
13
  pyproject.toml
14
14
  pytest.ini
15
15
  ruff.toml
16
- setup.cfg
17
16
  towncrier.toml
18
17
  tox.ini
19
18
  .github/FUNDING.yml
@@ -32,7 +31,6 @@ importlib_metadata/_compat.py
32
31
  importlib_metadata/_functools.py
33
32
  importlib_metadata/_itertools.py
34
33
  importlib_metadata/_meta.py
35
- importlib_metadata/_py39compat.py
36
34
  importlib_metadata/_text.py
37
35
  importlib_metadata/diagnose.py
38
36
  importlib_metadata/py.typed
@@ -41,16 +39,20 @@ importlib_metadata.egg-info/SOURCES.txt
41
39
  importlib_metadata.egg-info/dependency_links.txt
42
40
  importlib_metadata.egg-info/requires.txt
43
41
  importlib_metadata.egg-info/top_level.txt
42
+ importlib_metadata/compat/__init__.py
43
+ importlib_metadata/compat/py39.py
44
44
  tests/__init__.py
45
45
  tests/_context.py
46
46
  tests/_path.py
47
47
  tests/fixtures.py
48
- tests/py39compat.py
49
48
  tests/test_api.py
50
49
  tests/test_integration.py
51
50
  tests/test_main.py
52
- tests/test_py39compat.py
53
51
  tests/test_zip.py
52
+ tests/compat/__init__.py
53
+ tests/compat/py312.py
54
+ tests/compat/py39.py
55
+ tests/compat/test_py39_compat.py
54
56
  tests/data/__init__.py
55
57
  tests/data/example-21.12-py3-none-any.whl
56
58
  tests/data/example-21.12-py3.6.egg
@@ -3,7 +3,7 @@ zipp>=0.5
3
3
  [:python_version < "3.8"]
4
4
  typing-extensions>=3.6.4
5
5
 
6
- [docs]
6
+ [doc]
7
7
  sphinx>=3.5
8
8
  jaraco.packaging>=9.3
9
9
  rst.linker>=1.9
@@ -14,19 +14,18 @@ jaraco.tidelift>=1.4
14
14
  [perf]
15
15
  ipython
16
16
 
17
- [testing]
18
- pytest>=6
17
+ [test]
18
+ pytest!=8.1.*,>=6
19
19
  pytest-checkdocs>=2.4
20
20
  pytest-cov
21
+ pytest-mypy
21
22
  pytest-enabler>=2.2
22
23
  pytest-ruff>=0.2.1
23
24
  packaging
24
25
  pyfakefs
25
26
  flufl.flake8
26
27
  pytest-perf>=0.9.2
28
+ jaraco.test>=5.4
27
29
 
28
- [testing:platform_python_implementation != "PyPy"]
29
- pytest-mypy
30
-
31
- [testing:python_version < "3.9"]
30
+ [test:python_version < "3.9"]
32
31
  importlib_resources>=1.3
@@ -0,0 +1,62 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.1"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "importlib_metadata"
7
+ authors = [
8
+ { name = "Jason R. Coombs", email = "jaraco@jaraco.com" },
9
+ ]
10
+ description = "Read metadata from Python packages"
11
+ readme = "README.rst"
12
+ classifiers = [
13
+ "Development Status :: 5 - Production/Stable",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ ]
19
+ requires-python = ">=3.8"
20
+ dependencies = [
21
+ "zipp>=0.5",
22
+ 'typing-extensions>=3.6.4; python_version < "3.8"',
23
+ ]
24
+ dynamic = ["version"]
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/python/importlib_metadata"
28
+
29
+ [project.optional-dependencies]
30
+ test = [
31
+ # upstream
32
+ "pytest >= 6, != 8.1.*",
33
+ "pytest-checkdocs >= 2.4",
34
+ "pytest-cov",
35
+ "pytest-mypy",
36
+ "pytest-enabler >= 2.2",
37
+ "pytest-ruff >= 0.2.1",
38
+
39
+ # local
40
+ 'importlib_resources>=1.3; python_version < "3.9"',
41
+ "packaging",
42
+ "pyfakefs",
43
+ "flufl.flake8",
44
+ "pytest-perf >= 0.9.2",
45
+ "jaraco.test >= 5.4",
46
+ ]
47
+ doc = [
48
+ # upstream
49
+ "sphinx >= 3.5",
50
+ "jaraco.packaging >= 9.3",
51
+ "rst.linker >= 1.9",
52
+ "furo",
53
+ "sphinx-lint",
54
+
55
+ # tidelift
56
+ "jaraco.tidelift >= 1.4",
57
+
58
+ # local
59
+ ]
60
+ perf = ["ipython"]
61
+
62
+ [tool.setuptools_scm]
@@ -1,6 +1,9 @@
1
1
  [pytest]
2
2
  norecursedirs=dist build .tox .eggs
3
- addopts=--doctest-modules
3
+ addopts=
4
+ --doctest-modules
5
+ --import-mode importlib
6
+ consider_namespace_packages=true
4
7
  filterwarnings=
5
8
  ## upstream
6
9
 
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,18 @@
1
+ import contextlib
2
+
3
+ from .py39 import import_helper
4
+
5
+
6
+ @contextlib.contextmanager
7
+ def isolated_modules():
8
+ """
9
+ Save modules on entry and cleanup on exit.
10
+ """
11
+ (saved,) = import_helper.modules_setup()
12
+ try:
13
+ yield
14
+ finally:
15
+ import_helper.modules_cleanup(saved)
16
+
17
+
18
+ vars(import_helper).setdefault('isolated_modules', isolated_modules)
@@ -0,0 +1,9 @@
1
+ from jaraco.test.cpython import from_test_support, try_import
2
+
3
+
4
+ os_helper = try_import('os_helper') or from_test_support(
5
+ 'FS_NONASCII', 'skip_unless_symlink', 'temp_dir'
6
+ )
7
+ import_helper = try_import('import_helper') or from_test_support(
8
+ 'modules_setup', 'modules_cleanup'
9
+ )
@@ -2,7 +2,7 @@ import sys
2
2
  import pathlib
3
3
  import unittest
4
4
 
5
- from . import fixtures
5
+ from .. import fixtures
6
6
  from importlib_metadata import (
7
7
  distribution,
8
8
  distributions,
@@ -14,8 +14,7 @@ from importlib_metadata import (
14
14
 
15
15
  class OldStdlibFinderTests(fixtures.DistInfoPkgOffPath, unittest.TestCase):
16
16
  def setUp(self):
17
- python_version = sys.version_info[:2]
18
- if python_version < (3, 8) or python_version > (3, 9):
17
+ if sys.version_info >= (3, 10):
19
18
  self.skipTest("Tests specific for Python 3.8/3.9")
20
19
  super().setUp()
21
20
 
File without changes
@@ -1,15 +1,14 @@
1
- import os
2
1
  import sys
3
2
  import copy
4
3
  import json
5
4
  import shutil
6
5
  import pathlib
7
- import tempfile
8
6
  import textwrap
9
7
  import functools
10
8
  import contextlib
11
9
 
12
- from .py39compat import FS_NONASCII
10
+ from .compat.py312 import import_helper
11
+ from .compat.py39 import os_helper
13
12
 
14
13
  from . import _path
15
14
  from ._path import FilesSpec
@@ -25,29 +24,12 @@ except (ImportError, AttributeError):
25
24
 
26
25
 
27
26
  @contextlib.contextmanager
28
- def tempdir():
29
- tmpdir = tempfile.mkdtemp()
30
- try:
31
- yield pathlib.Path(tmpdir)
32
- finally:
33
- shutil.rmtree(tmpdir)
34
-
35
-
36
- @contextlib.contextmanager
37
- def save_cwd():
38
- orig = os.getcwd()
39
- try:
40
- yield
41
- finally:
42
- os.chdir(orig)
43
-
44
-
45
- @contextlib.contextmanager
46
- def tempdir_as_cwd():
47
- with tempdir() as tmp:
48
- with save_cwd():
49
- os.chdir(str(tmp))
50
- yield tmp
27
+ def tmp_path():
28
+ """
29
+ Like os_helper.temp_dir, but yields a pathlib.Path.
30
+ """
31
+ with os_helper.temp_dir() as path:
32
+ yield pathlib.Path(path)
51
33
 
52
34
 
53
35
  @contextlib.contextmanager
@@ -68,7 +50,7 @@ class Fixtures:
68
50
  class SiteDir(Fixtures):
69
51
  def setUp(self):
70
52
  super().setUp()
71
- self.site_dir = self.fixtures.enter_context(tempdir())
53
+ self.site_dir = self.fixtures.enter_context(tmp_path())
72
54
 
73
55
 
74
56
  class OnSysPath(Fixtures):
@@ -84,6 +66,7 @@ class OnSysPath(Fixtures):
84
66
  def setUp(self):
85
67
  super().setUp()
86
68
  self.fixtures.enter_context(self.add_sys_path(self.site_dir))
69
+ self.fixtures.enter_context(import_helper.isolated_modules())
87
70
 
88
71
 
89
72
  class SiteBuilder(SiteDir):
@@ -335,7 +318,9 @@ def record_names(file_defs):
335
318
 
336
319
  class FileBuilder:
337
320
  def unicode_filename(self):
338
- return FS_NONASCII or self.skip("File system does not support non-ascii.")
321
+ return os_helper.FS_NONASCII or self.skip(
322
+ "File system does not support non-ascii."
323
+ )
339
324
 
340
325
 
341
326
  def DALS(str):
@@ -109,7 +109,7 @@ class APITests(
109
109
  Entry points should only be exposed for the first package
110
110
  on sys.path with a given name (even when normalized).
111
111
  """
112
- alt_site_dir = self.fixtures.enter_context(fixtures.tempdir())
112
+ alt_site_dir = self.fixtures.enter_context(fixtures.tmp_path())
113
113
  self.fixtures.enter_context(self.add_sys_path(alt_site_dir))
114
114
  alt_pkg = {
115
115
  "DistInfo_pkg-1.1.0.dist-info": {
@@ -5,6 +5,8 @@ import warnings
5
5
  import importlib
6
6
  import importlib_metadata
7
7
  import contextlib
8
+ from .compat.py39 import os_helper
9
+
8
10
  import pyfakefs.fake_filesystem_unittest as ffs
9
11
 
10
12
  from . import fixtures
@@ -133,7 +135,7 @@ class NameNormalizationTests(fixtures.OnSysPath, fixtures.SiteDir, unittest.Test
133
135
  fixtures.build_files(self.make_pkg('abc'), self.site_dir)
134
136
  before = list(_unique(distributions()))
135
137
 
136
- alt_site_dir = self.fixtures.enter_context(fixtures.tempdir())
138
+ alt_site_dir = self.fixtures.enter_context(fixtures.tmp_path())
137
139
  self.fixtures.enter_context(self.add_sys_path(alt_site_dir))
138
140
  fixtures.build_files(self.make_pkg('ABC'), alt_site_dir)
139
141
  after = list(_unique(distributions()))
@@ -396,6 +398,7 @@ class PackagesDistributionsTest(
396
398
 
397
399
  assert not any(name.endswith('.dist-info') for name in distributions)
398
400
 
401
+ @os_helper.skip_unless_symlink
399
402
  def test_packages_distributions_symlinked_top_level(self) -> None:
400
403
  """
401
404
  Distribution is resolvable from a simple top-level symlink in RECORD.
@@ -9,7 +9,7 @@ passenv =
9
9
  HOME
10
10
  usedevelop = True
11
11
  extras =
12
- testing
12
+ test
13
13
 
14
14
  [testenv:diffcov]
15
15
  description = run tests and check that diff from main is covered
@@ -24,8 +24,8 @@ commands =
24
24
  [testenv:docs]
25
25
  description = build the documentation
26
26
  extras =
27
- docs
28
- testing
27
+ doc
28
+ test
29
29
  changedir = docs
30
30
  commands =
31
31
  python -m sphinx -W --keep-going . {toxinidir}/build/html
@@ -1,5 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [tool.setuptools_scm]
@@ -1,53 +0,0 @@
1
- [metadata]
2
- name = importlib_metadata
3
- author = Jason R. Coombs
4
- author_email = jaraco@jaraco.com
5
- description = Read metadata from Python packages
6
- long_description = file:README.rst
7
- url = https://github.com/python/importlib_metadata
8
- classifiers =
9
- Development Status :: 5 - Production/Stable
10
- Intended Audience :: Developers
11
- License :: OSI Approved :: Apache Software License
12
- Programming Language :: Python :: 3
13
- Programming Language :: Python :: 3 :: Only
14
-
15
- [options]
16
- include_package_data = true
17
- python_requires = >=3.8
18
- install_requires =
19
- zipp>=0.5
20
- typing-extensions>=3.6.4; python_version < "3.8"
21
-
22
- [options.extras_require]
23
- testing =
24
- pytest >= 6
25
- pytest-checkdocs >= 2.4
26
- pytest-cov
27
- pytest-mypy; \
28
- python_implementation != "PyPy"
29
- pytest-enabler >= 2.2
30
- pytest-ruff >= 0.2.1
31
-
32
- importlib_resources>=1.3; python_version < "3.9"
33
- packaging
34
- pyfakefs
35
- flufl.flake8
36
- pytest-perf >= 0.9.2
37
- docs =
38
- sphinx >= 3.5
39
- jaraco.packaging >= 9.3
40
- rst.linker >= 1.9
41
- furo
42
- sphinx-lint
43
-
44
- jaraco.tidelift >= 1.4
45
- perf =
46
- ipython
47
-
48
- [options.entry_points]
49
-
50
- [egg_info]
51
- tag_build =
52
- tag_date = 0
53
-
@@ -1,4 +0,0 @@
1
- try:
2
- from test.support.os_helper import FS_NONASCII
3
- except ImportError:
4
- from test.support import FS_NONASCII # noqa