patchy 2.7.0__tar.gz → 2.9.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.
@@ -2,6 +2,18 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ 2.9.0 (2024-10-25)
6
+ ------------------
7
+
8
+ * Drop Python 3.8 support.
9
+
10
+ * Support Python 3.13.
11
+
12
+ 2.8.0 (2023-07-10)
13
+ ------------------
14
+
15
+ * Drop Python 3.7 support.
16
+
5
17
  2.7.0 (2023-06-16)
6
18
  ------------------
7
19
 
@@ -1,30 +1,25 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: patchy
3
- Version: 2.7.0
3
+ Version: 2.9.0
4
4
  Summary: Patch the inner source of python functions at runtime.
5
- Home-page: https://github.com/adamchainz/patchy
6
- Author: Adam Johnson
7
- Author-email: me@adamj.eu
8
- License: MIT
5
+ Author-email: Adam Johnson <me@adamj.eu>
9
6
  Project-URL: Changelog, https://github.com/adamchainz/patchy/blob/main/CHANGELOG.rst
10
- Project-URL: Mastodon, https://fosstodon.org/@adamchainz
11
- Project-URL: Twitter, https://twitter.com/adamchainz
7
+ Project-URL: Funding, https://adamj.eu/books/
8
+ Project-URL: Repository, https://github.com/adamchainz/patchy
12
9
  Keywords: patchy
13
10
  Classifier: Development Status :: 5 - Production/Stable
14
11
  Classifier: Intended Audience :: Developers
15
12
  Classifier: License :: OSI Approved :: MIT License
16
13
  Classifier: Natural Language :: English
17
14
  Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
15
  Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: 3.7
21
- Classifier: Programming Language :: Python :: 3.8
22
16
  Classifier: Programming Language :: Python :: 3.9
23
17
  Classifier: Programming Language :: Python :: 3.10
24
18
  Classifier: Programming Language :: Python :: 3.11
25
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
26
21
  Classifier: Typing :: Typed
27
- Requires-Python: >=3.7
22
+ Requires-Python: >=3.9
28
23
  Description-Content-Type: text/x-rst
29
24
  License-File: LICENSE
30
25
 
@@ -32,7 +27,7 @@ License-File: LICENSE
32
27
  Patchy
33
28
  ======
34
29
 
35
- .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml?branch=main&style=for-the-badge
30
+ .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml.svg?branch=main&style=for-the-badge
36
31
  :target: https://github.com/adamchainz/patchy/actions?workflow=CI
37
32
 
38
33
  .. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
@@ -79,6 +74,12 @@ function object itself the same. It's thus more versatile than monkey patching,
79
74
  since if the function has been imported in multiple places they'll also call
80
75
  the new behaviour.
81
76
 
77
+ ----
78
+
79
+ **Hacking on a Django project?**
80
+ Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
81
+
82
+ ----
82
83
 
83
84
  Installation
84
85
  ============
@@ -89,14 +90,7 @@ Use **pip**:
89
90
 
90
91
  python -m pip install patchy
91
92
 
92
- Python 3.7 to 3.12 supported.
93
-
94
- ----
95
-
96
- **Hacking on a Django project?**
97
- Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
98
-
99
- ----
93
+ Python 3.9 to 3.13 supported.
100
94
 
101
95
  Why?
102
96
  ====
@@ -2,7 +2,7 @@
2
2
  Patchy
3
3
  ======
4
4
 
5
- .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml?branch=main&style=for-the-badge
5
+ .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml.svg?branch=main&style=for-the-badge
6
6
  :target: https://github.com/adamchainz/patchy/actions?workflow=CI
7
7
 
8
8
  .. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
@@ -49,6 +49,12 @@ function object itself the same. It's thus more versatile than monkey patching,
49
49
  since if the function has been imported in multiple places they'll also call
50
50
  the new behaviour.
51
51
 
52
+ ----
53
+
54
+ **Hacking on a Django project?**
55
+ Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
56
+
57
+ ----
52
58
 
53
59
  Installation
54
60
  ============
@@ -59,14 +65,7 @@ Use **pip**:
59
65
 
60
66
  python -m pip install patchy
61
67
 
62
- Python 3.7 to 3.12 supported.
63
-
64
- ----
65
-
66
- **Hacking on a Django project?**
67
- Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
68
-
69
- ----
68
+ Python 3.9 to 3.13 supported.
70
69
 
71
70
  Why?
72
71
  ====
@@ -0,0 +1,86 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = [
4
+ "setuptools",
5
+ ]
6
+
7
+ [project]
8
+ name = "patchy"
9
+ version = "2.9.0"
10
+ description = "Patch the inner source of python functions at runtime."
11
+ readme = "README.rst"
12
+ keywords = [
13
+ "patchy",
14
+ ]
15
+ authors = [
16
+ { name = "Adam Johnson", email = "me@adamj.eu" },
17
+ ]
18
+ requires-python = ">=3.9"
19
+ classifiers = [
20
+ "Development Status :: 5 - Production/Stable",
21
+ "Intended Audience :: Developers",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Natural Language :: English",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Programming Language :: Python :: 3.9",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Typing :: Typed",
32
+ ]
33
+ dependencies = [ ]
34
+ urls = { Changelog = "https://github.com/adamchainz/patchy/blob/main/CHANGELOG.rst", Funding = "https://adamj.eu/books/", Repository = "https://github.com/adamchainz/patchy" }
35
+
36
+ [tool.isort]
37
+ add_imports = [
38
+ "from __future__ import annotations",
39
+ ]
40
+ force_single_line = true
41
+ profile = "black"
42
+
43
+ [tool.pyproject-fmt]
44
+ max_supported_python = "3.13"
45
+
46
+ [tool.pytest.ini_options]
47
+ addopts = """\
48
+ --strict-config
49
+ --strict-markers
50
+ """
51
+ xfail_strict = true
52
+
53
+ [tool.coverage.run]
54
+ branch = true
55
+ parallel = true
56
+ source = [
57
+ "patchy",
58
+ "tests",
59
+ ]
60
+
61
+ [tool.coverage.paths]
62
+ source = [
63
+ "src",
64
+ ".tox/**/site-packages",
65
+ ]
66
+
67
+ [tool.coverage.report]
68
+ show_missing = true
69
+
70
+ [tool.mypy]
71
+ enable_error_code = [
72
+ "ignore-without-code",
73
+ "redundant-expr",
74
+ "truthy-bool",
75
+ ]
76
+ mypy_path = "src/"
77
+ namespace_packages = false
78
+ strict = true
79
+ warn_unreachable = true
80
+
81
+ [[tool.mypy.overrides]]
82
+ module = "tests.*"
83
+ allow_untyped_defs = true
84
+
85
+ [tool.rstcheck]
86
+ report_level = "ERROR"
patchy-2.9.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -5,7 +5,6 @@ import inspect
5
5
  import os
6
6
  import shutil
7
7
  import subprocess
8
- import sys
9
8
  from functools import wraps
10
9
  from tempfile import mkdtemp
11
10
  from textwrap import dedent
@@ -13,9 +12,8 @@ from types import CodeType
13
12
  from types import TracebackType
14
13
  from typing import Any
15
14
  from typing import Callable
16
- from typing import cast
17
- from typing import Dict
18
15
  from typing import TypeVar
16
+ from typing import cast
19
17
  from weakref import WeakKeyDictionary
20
18
 
21
19
  from .cache import PatchingCache
@@ -23,10 +21,7 @@ from .cache import PatchingCache
23
21
  if True:
24
22
  import __future__
25
23
 
26
- if sys.version_info >= (3, 9):
27
- from pkgutil import resolve_name as pkgutil_resolve_name
28
- else:
29
- from pkgutil_resolve_name import resolve_name as pkgutil_resolve_name
24
+ from pkgutil import resolve_name as pkgutil_resolve_name
30
25
 
31
26
  __all__ = ("patch", "mc_patchface", "unpatch", "replace", "temp_patch")
32
27
 
@@ -175,11 +170,7 @@ FEATURE_MASK = _get_flags_mask()
175
170
 
176
171
 
177
172
  # Stores the source of functions that have had their source changed
178
- # Bad type hints because WeakKeyDictionary only indexable on Python 3.9+
179
- _source_map: dict[Callable[..., Any], str] = cast(
180
- Dict[Callable[..., Any], str],
181
- WeakKeyDictionary(),
182
- )
173
+ _source_map: WeakKeyDictionary[Callable[..., Any], str] = WeakKeyDictionary()
183
174
 
184
175
 
185
176
  def _get_source(func: Callable[..., Any]) -> str:
@@ -1,30 +1,25 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: patchy
3
- Version: 2.7.0
3
+ Version: 2.9.0
4
4
  Summary: Patch the inner source of python functions at runtime.
5
- Home-page: https://github.com/adamchainz/patchy
6
- Author: Adam Johnson
7
- Author-email: me@adamj.eu
8
- License: MIT
5
+ Author-email: Adam Johnson <me@adamj.eu>
9
6
  Project-URL: Changelog, https://github.com/adamchainz/patchy/blob/main/CHANGELOG.rst
10
- Project-URL: Mastodon, https://fosstodon.org/@adamchainz
11
- Project-URL: Twitter, https://twitter.com/adamchainz
7
+ Project-URL: Funding, https://adamj.eu/books/
8
+ Project-URL: Repository, https://github.com/adamchainz/patchy
12
9
  Keywords: patchy
13
10
  Classifier: Development Status :: 5 - Production/Stable
14
11
  Classifier: Intended Audience :: Developers
15
12
  Classifier: License :: OSI Approved :: MIT License
16
13
  Classifier: Natural Language :: English
17
14
  Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
15
  Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: 3.7
21
- Classifier: Programming Language :: Python :: 3.8
22
16
  Classifier: Programming Language :: Python :: 3.9
23
17
  Classifier: Programming Language :: Python :: 3.10
24
18
  Classifier: Programming Language :: Python :: 3.11
25
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
26
21
  Classifier: Typing :: Typed
27
- Requires-Python: >=3.7
22
+ Requires-Python: >=3.9
28
23
  Description-Content-Type: text/x-rst
29
24
  License-File: LICENSE
30
25
 
@@ -32,7 +27,7 @@ License-File: LICENSE
32
27
  Patchy
33
28
  ======
34
29
 
35
- .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml?branch=main&style=for-the-badge
30
+ .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/patchy/main.yml.svg?branch=main&style=for-the-badge
36
31
  :target: https://github.com/adamchainz/patchy/actions?workflow=CI
37
32
 
38
33
  .. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
@@ -79,6 +74,12 @@ function object itself the same. It's thus more versatile than monkey patching,
79
74
  since if the function has been imported in multiple places they'll also call
80
75
  the new behaviour.
81
76
 
77
+ ----
78
+
79
+ **Hacking on a Django project?**
80
+ Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
81
+
82
+ ----
82
83
 
83
84
  Installation
84
85
  ============
@@ -89,14 +90,7 @@ Use **pip**:
89
90
 
90
91
  python -m pip install patchy
91
92
 
92
- Python 3.7 to 3.12 supported.
93
-
94
- ----
95
-
96
- **Hacking on a Django project?**
97
- Check out my book `Boost Your Django DX <https://adamchainz.gumroad.com/l/byddx>`__ which covers many ways to improve your development experience.
98
-
99
- ----
93
+ Python 3.9 to 3.13 supported.
100
94
 
101
95
  Why?
102
96
  ====
@@ -4,7 +4,6 @@ MANIFEST.in
4
4
  README.rst
5
5
  pirate.png
6
6
  pyproject.toml
7
- setup.cfg
8
7
  src/patchy/__init__.py
9
8
  src/patchy/api.py
10
9
  src/patchy/cache.py
@@ -12,8 +11,6 @@ src/patchy/py.typed
12
11
  src/patchy.egg-info/PKG-INFO
13
12
  src/patchy.egg-info/SOURCES.txt
14
13
  src/patchy.egg-info/dependency_links.txt
15
- src/patchy.egg-info/not-zip-safe
16
- src/patchy.egg-info/requires.txt
17
14
  src/patchy.egg-info/top_level.txt
18
15
  tests/test_cache.py
19
16
  tests/test_patch.py
@@ -30,7 +30,7 @@ def test_patch_unpatch():
30
30
  )
31
31
 
32
32
  try:
33
- patchy.api.mkdtemp = mkdtemp # type: ignore [attr-defined]
33
+ patchy.api.mkdtemp = mkdtemp # type: ignore [attr-defined,assignment]
34
34
  patchy.unpatch(sample, patch_text)
35
35
  finally:
36
36
  patchy.api.mkdtemp = orig_mkdtemp # type: ignore [attr-defined]
@@ -38,7 +38,7 @@ def test_patch_unpatch():
38
38
 
39
39
  # Check that we use the cache going forwards again
40
40
  try:
41
- patchy.api.mkdtemp = mkdtemp # type: ignore [attr-defined]
41
+ patchy.api.mkdtemp = mkdtemp # type: ignore [attr-defined,assignment]
42
42
  patchy.patch(sample, patch_text)
43
43
  finally:
44
44
  patchy.api.mkdtemp = orig_mkdtemp # type: ignore [attr-defined]
@@ -1,29 +0,0 @@
1
- [build-system]
2
- build-backend = "setuptools.build_meta"
3
- requires = [
4
- "setuptools",
5
- ]
6
-
7
- [tool.black]
8
- target-version = ['py37']
9
-
10
- [tool.pytest.ini_options]
11
- addopts = """\
12
- --strict-config
13
- --strict-markers
14
- """
15
- xfail_strict = true
16
-
17
- [tool.mypy]
18
- mypy_path = "src/"
19
- namespace_packages = false
20
- show_error_codes = true
21
- strict = true
22
- warn_unreachable = true
23
-
24
- [[tool.mypy.overrides]]
25
- module = "tests.*"
26
- allow_untyped_defs = true
27
-
28
- [tool.rstcheck]
29
- report_level = "ERROR"
patchy-2.7.0/setup.cfg DELETED
@@ -1,68 +0,0 @@
1
- [metadata]
2
- name = patchy
3
- version = 2.7.0
4
- description = Patch the inner source of python functions at runtime.
5
- long_description = file: README.rst
6
- long_description_content_type = text/x-rst
7
- url = https://github.com/adamchainz/patchy
8
- author = Adam Johnson
9
- author_email = me@adamj.eu
10
- license = MIT
11
- license_files = LICENSE
12
- classifiers =
13
- Development Status :: 5 - Production/Stable
14
- Intended Audience :: Developers
15
- License :: OSI Approved :: MIT License
16
- Natural Language :: English
17
- Operating System :: OS Independent
18
- Programming Language :: Python :: 3
19
- Programming Language :: Python :: 3 :: Only
20
- Programming Language :: Python :: 3.7
21
- Programming Language :: Python :: 3.8
22
- Programming Language :: Python :: 3.9
23
- Programming Language :: Python :: 3.10
24
- Programming Language :: Python :: 3.11
25
- Programming Language :: Python :: 3.12
26
- Typing :: Typed
27
- keywords = patchy
28
- project_urls =
29
- Changelog = https://github.com/adamchainz/patchy/blob/main/CHANGELOG.rst
30
- Mastodon = https://fosstodon.org/@adamchainz
31
- Twitter = https://twitter.com/adamchainz
32
-
33
- [options]
34
- packages = find:
35
- install_requires =
36
- pkgutil-resolve-name;python_version < "3.9"
37
- python_requires = >=3.7
38
- include_package_data = True
39
- package_dir =
40
- =src
41
- zip_safe = False
42
-
43
- [options.packages.find]
44
- where = src
45
-
46
- [coverage:run]
47
- branch = True
48
- parallel = True
49
- source =
50
- patchy
51
- tests
52
-
53
- [coverage:paths]
54
- source =
55
- src
56
- .tox/**/site-packages
57
-
58
- [coverage:report]
59
- show_missing = True
60
-
61
- [flake8]
62
- max-line-length = 88
63
- extend-ignore = E203
64
-
65
- [egg_info]
66
- tag_build =
67
- tag_date = 0
68
-
@@ -1 +0,0 @@
1
-
@@ -1,3 +0,0 @@
1
-
2
- [:python_version < "3.9"]
3
- pkgutil-resolve-name
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes