diff --git a/.pylintrc b/.pylintrc index 6689b9a43..a55f129d2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -51,7 +51,7 @@ ignore=CVS # CERTBOT COMMENT # Changing this line back to the default of `ignore-paths=` is being tracked by # https://github.com/certbot/certbot/issues/7908. -ignore-paths=.*/_internal/tests/ +ignore-paths=.*/_internal/tests/,.*/apache/tests,.*/nginx/tests # Files or directories matching the regular expression patterns are skipped. # The regex matches against base names, not paths. The default value ignores diff --git a/certbot-ci/src/certbot_integration_tests/.coveragerc b/certbot-ci/src/certbot_integration_tests/.coveragerc index 2916b8597..3f497b10b 100644 --- a/certbot-ci/src/certbot_integration_tests/.coveragerc +++ b/certbot-ci/src/certbot_integration_tests/.coveragerc @@ -2,10 +2,10 @@ # Avoid false warnings because certbot packages are not installed in the thread that executes # the coverage: indeed, certbot is launched as a CLI from a subprocess. disable_warnings = module-not-imported,no-data-collected -omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot_nginx/_internal/parser_obj.py +omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot/_internal/nginx/parser_obj.py patch = subprocess parallel = True [report] # Exclude unit tests in coverage during integration tests. -omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot_nginx/_internal/parser_obj.py +omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot/_internal/nginx/parser_obj.py diff --git a/certbot-compatibility-test/nginx/README b/certbot-compatibility-test/nginx/README index f32de2148..648faace4 100644 --- a/certbot-compatibility-test/nginx/README +++ b/certbot-compatibility-test/nginx/README @@ -4,7 +4,7 @@ Right now, this is data for the roundtrip test (checking that the parser can parse each file and that the reserialized config file it generates is identical to the original). -If run in a virtualenv or otherwise so that certbot_nginx can be imported, +If run in a virtualenv or otherwise so that certbot can be imported, the roundtrip test can run as python roundtrip.py nginx-roundtrip-testdata diff --git a/certbot-compatibility-test/nginx/roundtrip.py b/certbot-compatibility-test/nginx/roundtrip.py index afc68647d..4abfaf1c4 100644 --- a/certbot-compatibility-test/nginx/roundtrip.py +++ b/certbot-compatibility-test/nginx/roundtrip.py @@ -3,7 +3,7 @@ import os import sys -from certbot_nginx._internal import nginxparser +from certbot._internal.apache import nginxparser def roundtrip(stuff): diff --git a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py index ff7115571..09464ee34 100644 --- a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py +++ b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py @@ -8,7 +8,7 @@ from unittest import mock from certbot import configuration from certbot import errors as le_errors from certbot import util as certbot_util -from certbot_apache._internal import entrypoint +from certbot._internal.apache import entrypoint from certbot_compatibility_test import errors from certbot_compatibility_test import util from certbot_compatibility_test.configurators import common as configurators_common @@ -24,7 +24,7 @@ class Proxy(configurators_common.Proxy): self.modules = self.server_root = self.test_conf = self.version = None patch = mock.patch( - "certbot_apache._internal.configurator.display_ops.select_vhost") + "certbot._internal.apache.configurator.display_ops.select_vhost") mock_display = patch.start() mock_display.side_effect = le_errors.PluginError( "Unable to determine vhost") diff --git a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py index ddfc82c77..5fa319a4a 100644 --- a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py +++ b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py @@ -7,8 +7,8 @@ from certbot import configuration from certbot_compatibility_test import errors from certbot_compatibility_test import util from certbot_compatibility_test.configurators import common as configurators_common -from certbot_nginx._internal import configurator -from certbot_nginx._internal import constants +from certbot._internal.nginx import configurator +from certbot._internal.nginx import constants class Proxy(configurators_common.Proxy): diff --git a/mypy.ini b/mypy.ini index 4314e4db8..2670294ed 100644 --- a/mypy.ini +++ b/mypy.ini @@ -13,3 +13,15 @@ strict_equality = True # this "error" code removes this visual noise. disable_error_code = annotation-unchecked disallow_untyped_defs = False +[mypy-*.apache.tests.*] +# By default, mypy prints notes without erroring about any type annotations it +# finds in untyped function bodies when check_untyped_defs is false. Disabling +# this "error" code removes this visual noise. +disable_error_code = annotation-unchecked +disallow_untyped_defs = False +[mypy-*.nginx.tests.*] +# By default, mypy prints notes without erroring about any type annotations it +# finds in untyped function bodies when check_untyped_defs is false. Disabling +# this "error" code removes this visual noise. +disable_error_code = annotation-unchecked +disallow_untyped_defs = False diff --git a/tox.ini b/tox.ini index 00366755b..45f5d13f2 100644 --- a/tox.ini +++ b/tox.ini @@ -166,27 +166,27 @@ deps = -e certbot -e certbot-apache commands = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test --debian-modules + {toxinidir}/certbot-apache/src/certbot/_internal/apache/tests/apache-conf-files/apache-conf-test --debian-modules passenv = SERVER allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test + {toxinidir}/certbot-apache/src/certbot/_internal/apache/tests/apache-conf-files/apache-conf-test [testenv:apacheconftest-external-with-pebble] description = Run apacheconftest with pebble and Certbot outside of the tox virtual environment. deps = -e certbot-ci allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot-apache/src/certbot/_internal/apache/tests/apache-conf-files/apache-conf-test-pebble.py commands = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules + {toxinidir}/certbot-apache/src/certbot/_internal/apache/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules [testenv:apacheconftest-with-pebble] deps = {[testenv:apacheconftest]deps} {[testenv:apacheconftest-external-with-pebble]deps} allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot-apache/src/certbot/_internal/apache/tests/apache-conf-files/apache-conf-test-pebble.py commands = {[testenv:apacheconftest-external-with-pebble]commands} [testenv:nginxroundtrip]