From d2a063a0e736a390564c37d65d5dc250e6e8b1ab Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Thu, 10 Oct 2024 21:03:06 +0700 Subject: [PATCH 1/6] delete pymupdf from `default_module_mapping.py` when we add pymupdf as a dependencies, pants can't find pymupdf. the reason is because now pymupdf no longer expose `fitz` but `pymupdf` --- .../python/dependency_inference/default_module_mapping.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py index 27d6319af88..d2376ad24cd 100644 --- a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py +++ b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py @@ -216,7 +216,6 @@ def two_groups_hyphens_two_replacements_with_suffix( "pyjwt": ("jwt",), "pykube-ng": ("pykube",), "pymongo": ("bson", "gridfs", "pymongo"), - "pymupdf": ("fitz",), "pynacl": ("nacl",), "pyopenssl": ("OpenSSL",), "pypdf2": ("PyPDF2",), From caec7e11897672c6c58d87d02c9b5b973a45cccd Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Fri, 11 Oct 2024 10:56:23 +0700 Subject: [PATCH 2/6] Add `pymupdf` back but with `fitz` and `pymupdf` --- .../python/dependency_inference/default_module_mapping.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py index d2376ad24cd..79536ed0d3c 100644 --- a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py +++ b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py @@ -216,6 +216,7 @@ def two_groups_hyphens_two_replacements_with_suffix( "pyjwt": ("jwt",), "pykube-ng": ("pykube",), "pymongo": ("bson", "gridfs", "pymongo"), + "pymupdf": ("fitz","pymupdf"), "pynacl": ("nacl",), "pyopenssl": ("OpenSSL",), "pypdf2": ("PyPDF2",), From 40cc25c0ecd931a1ae84adfdaf7448f024c2b065 Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Fri, 11 Oct 2024 12:39:16 +0700 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=90=9B=20Fix=20issue=20https://github?= =?UTF-8?q?.com/pantsbuild/pants/issues/21517?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/notes/2.24.x.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/notes/2.24.x.md b/docs/notes/2.24.x.md index 90846e40dfe..3069e14d0f1 100644 --- a/docs/notes/2.24.x.md +++ b/docs/notes/2.24.x.md @@ -50,6 +50,9 @@ The kotlin linter, [ktlint](https://pinterest.github.io/ktlint/), has been updat #### Python +Bug Fix: +- Update default mapping on `pymupdf`, currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing https://github.com/pantsbuild/pants/issues/21517 (PR https://github.com/pantsbuild/pants/pull/21516). + Deprecations: - Pants v2.24 and later are not proactively tested in CI with Python 2.7 since [Python 2.7 is no longer supported by its maintainers as of 1 January 2020](https://www.python.org/doc/sunset-python-2/). While Pants may continue to work with Python 2.7 in the near term, Pants no longer officially supports use of Python 2.7, and, consequently, any remaining support for Python 2.7 may "bit rot" and diverge over time. Contributions to fix issues with Python 2.7 support will continue to be accepted, but will depend on any community contributions and will not constitute continued official support for Python 2.7. From 915c521f1d0789e47f80cba132a80a417daf115d Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Fri, 11 Oct 2024 12:44:59 +0700 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8D=BB=20Forgot=20to=20put=20space=20?= =?UTF-8?q?after=20comma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/notes/2.24.x.md | 2 +- .../python/dependency_inference/default_module_mapping.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/notes/2.24.x.md b/docs/notes/2.24.x.md index 3069e14d0f1..402b5f68352 100644 --- a/docs/notes/2.24.x.md +++ b/docs/notes/2.24.x.md @@ -51,7 +51,7 @@ The kotlin linter, [ktlint](https://pinterest.github.io/ktlint/), has been updat #### Python Bug Fix: -- Update default mapping on `pymupdf`, currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing https://github.com/pantsbuild/pants/issues/21517 (PR https://github.com/pantsbuild/pants/pull/21516). +- Update default mapping on `pymupdf`, currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing [#21517]( https://github.com/pantsbuild/pants/issues/21517) ([#21516] https://github.com/pantsbuild/pants/pull/21516). Deprecations: diff --git a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py index 79536ed0d3c..7613a22fdd6 100644 --- a/src/python/pants/backend/python/dependency_inference/default_module_mapping.py +++ b/src/python/pants/backend/python/dependency_inference/default_module_mapping.py @@ -216,7 +216,7 @@ def two_groups_hyphens_two_replacements_with_suffix( "pyjwt": ("jwt",), "pykube-ng": ("pykube",), "pymongo": ("bson", "gridfs", "pymongo"), - "pymupdf": ("fitz","pymupdf"), + "pymupdf": ("fitz", "pymupdf"), "pynacl": ("nacl",), "pyopenssl": ("OpenSSL",), "pypdf2": ("PyPDF2",), From e37cb4ef5272968074b404c21c95ea98efe149fb Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Fri, 11 Oct 2024 12:45:55 +0700 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=8D=BB=20Forgot=20to=20save=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/notes/2.24.x.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/notes/2.24.x.md b/docs/notes/2.24.x.md index 402b5f68352..a6f71e0fafe 100644 --- a/docs/notes/2.24.x.md +++ b/docs/notes/2.24.x.md @@ -50,8 +50,8 @@ The kotlin linter, [ktlint](https://pinterest.github.io/ktlint/), has been updat #### Python -Bug Fix: -- Update default mapping on `pymupdf`, currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing [#21517]( https://github.com/pantsbuild/pants/issues/21517) ([#21516] https://github.com/pantsbuild/pants/pull/21516). +User API Change: +- Update default mapping on `pymupdf`, accepting both `fitz` and `pymupdf` respecfully. Currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing [#21517]( https://github.com/pantsbuild/pants/issues/21517) ([#21516] https://github.com/pantsbuild/pants/pull/21516). Deprecations: From c7528cf28ed0ac0c30c3a773d81369972a7fff24 Mon Sep 17 00:00:00 2001 From: Muhammad Tsany Qudsi Date: Fri, 11 Oct 2024 22:58:06 +0700 Subject: [PATCH 6/6] Update docs/notes/2.24.x.md updated notes Co-authored-by: Benjy Weinberger --- docs/notes/2.24.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/notes/2.24.x.md b/docs/notes/2.24.x.md index a6f71e0fafe..2d50e2bad14 100644 --- a/docs/notes/2.24.x.md +++ b/docs/notes/2.24.x.md @@ -51,7 +51,7 @@ The kotlin linter, [ktlint](https://pinterest.github.io/ktlint/), has been updat #### Python User API Change: -- Update default mapping on `pymupdf`, accepting both `fitz` and `pymupdf` respecfully. Currently `pymudpdf` documentation stated that [`import fitz` is no longer valid](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation) Fixing [#21517]( https://github.com/pantsbuild/pants/issues/21517) ([#21516] https://github.com/pantsbuild/pants/pull/21516). +- Update default package mapping for `pymupdf` to match imports from both `fitz` (the legacy name) and `pymupdf` (the [currently supported name](https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation). Deprecations: