Skip to content

Commit 5f67bb9

Browse files
authored
Full cleanup of pkg_resources (certbot#9797)
Fixes certbot#9606 This PRs removes some elements that were related to pkg_resources dependency and its deprecation.
1 parent d8392bf commit 5f67bb9

File tree

7 files changed

+8
-21
lines changed

7 files changed

+8
-21
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace,
524524
# List of module names for which member attributes should not be checked
525525
# (useful for modules/projects where namespaces are manipulated during runtime
526526
# and thus existing member attributes cannot be deduced by static analysis
527-
ignored-modules=pkg_resources,confargparse,argparse
527+
ignored-modules=confargparse,argparse
528528

529529
# Show a hint with possible names when a member name was not found. The aspect
530530
# of finding the hint is based on edit distance.

certbot-dns-gehirn/certbot_dns_gehirn/_internal/tests/dns_gehirn_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for certbot_dns_gehirn._internal.dns_gehirn."""
22

33
import sys
4-
import unittest
54
from unittest import mock
65

76
import pytest

certbot-dns-ovh/certbot_dns_ovh/_internal/tests/dns_ovh_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
2222

2323
DOMAIN_NOT_FOUND = Exception('Domain example.com not found')
2424
LOGIN_ERROR = HTTPError('403 Client Error: Forbidden for url: https://eu.api.ovh.com/1.0/...', response=Response())
25+
2526
def setUp(self):
2627
super().setUp()
2728

certbot/docs/contributing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ Writing your own plugin
328328
for one example of that.
329329

330330
Certbot client supports dynamic discovery of plugins through the
331-
`setuptools entry points`_ using the `certbot.plugins` group. This
332-
way you can, for example, create a custom implementation of
331+
`importlib.metadata entry points`_ using the `certbot.plugins` group.
332+
This way you can, for example, create a custom implementation of
333333
`~certbot.interfaces.Authenticator` or the
334334
`~certbot.interfaces.Installer` without having to merge it
335335
with the core upstream source code. An example is provided in
@@ -352,8 +352,8 @@ users install it system-wide with `pip install`. Note that this will
352352
only work for users who have Certbot installed from OS packages or via
353353
pip.
354354

355-
.. _`setuptools entry points`:
356-
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points
355+
.. _`importlib.metadata entry points`:
356+
https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points
357357

358358
Writing your own plugin snap
359359
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pytest.ini

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@
2121
# updated.
2222
# 4) Ignore our own PendingDeprecationWarning about update_symlinks soon to be dropped.
2323
# See https://github.com/certbot/certbot/issues/6284.
24-
# 5) Ignore pkg_resources.declare_namespace used in a large number of Google's Python
25-
# libs. e.g. https://github.com/googleapis/google-auth-library-python/issues/1229.
26-
# It is also is used in sphinxcontrib-devhelp 1.0.2 which as of writing this
27-
# is the latest version of that library. See
28-
# https://github.com/sphinx-doc/sphinxcontrib-devhelp/blob/1.0.2/setup.py#L69.
29-
# 6) Ignore DeprecationWarning from using pkg_resources API
30-
# 7) Ignore DeprecationWarning for datetime.utcfromtimestamp() triggered
24+
# 5) Ignore DeprecationWarning for datetime.utcfromtimestamp() triggered
3125
# when importing the pytz.tzinfo module
3226
# https://github.com/stub42/pytz/issues/105
3327
filterwarnings =
@@ -36,6 +30,4 @@ filterwarnings =
3630
ignore:.*rsyncdir:DeprecationWarning
3731
ignore:'urllib3.contrib.pyopenssl:DeprecationWarning:requests_toolbelt
3832
ignore:update_symlinks is deprecated:PendingDeprecationWarning
39-
ignore:.*declare_namespace\(':DeprecationWarning
40-
ignore:pkg_resources is deprecated as an API:DeprecationWarning
4133
ignore:.*datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:pytz.tzinfo

tools/pinning/current/pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ cryptography = "!= 37.0.3"
7070
# https://github.com/python-poetry/poetry-plugin-export/issues/168 is resolved.
7171
poetry = "<1.3.0"
7272

73-
# setuptools 67.5.0 deprecated pkg_resources which we still use. Let's pin it
74-
# back until this is fixed. Doing this work is being tracked by
75-
# https://github.com/certbot/certbot/issues/9606.
76-
setuptools = "<67.5.0"
77-
7873
# Branch 4.x of tox introduces backward incompatibility changes. The tox.ini
7974
# file in the project must be adapted accordingly before moving out of the 3.x
8075
# branch. Once done, the following constraint should become tox >= 4 to keep

tools/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ s3transfer==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
147147
secretstorage==3.3.3 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "linux"
148148
semantic-version==2.10.0 ; python_version >= "3.8" and python_version < "4.0"
149149
setuptools-rust==1.7.0 ; python_version >= "3.8" and python_version < "4.0"
150-
setuptools==67.4.0 ; python_version >= "3.8" and python_version < "4.0"
150+
setuptools==68.2.2 ; python_version >= "3.8" and python_version < "4.0"
151151
shellingham==1.5.3 ; python_version >= "3.8" and python_version < "4.0"
152152
six==1.16.0 ; python_version >= "3.8" and python_version < "4.0"
153153
snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "4.0"

0 commit comments

Comments
 (0)