Add --use-pep517 flag to pip to silence warning in tools/venv.py, and switch codebase to src-layout (#10249)

Fixes #10252.

See further discussion here: https://github.com/pypa/pip/issues/11457

We are doing option:

> Alternatively, enable the --use-pep517 pip option, possibly with
--no-build-isolation. The --use-pip517 flag will force pip to use the
modern mechanism for editable installs. --no-build-isolation may be
needed if your project has build-time requirements beyond setuptools and
wheel. By passing this flag, you are responsible for making sure your
environment already has the required dependencies to build your package.
Once the legacy mechanism is removed, --use-pep517 will have no effect
and will essentially be enabled by default in this context.

Major changes made here include:
- Add `--use-pep517` to use the modern mechanism, which will be the only
mechanism in future pip releases
- Change to `/src` layout to appease mypy, and because for editable
installs that really is the normal way these days.
  - `cd acme && mkdir src && mv acme src/` etc.
- add `where='src'` argument to `find_packages` and add
`package_dir={'': 'src'},` in `setup.py`s
  - update `MANIFEST.in` files with new path locations 
- Update our many hardcoded filepaths
- Update `importlib-metadata` requirement to fix
double-plugin-entry-point problem in oldest tests
This commit is contained in:
ohemorange
2025-04-11 19:30:33 +00:00
committed by GitHub
parent 6de7570af0
commit 16f858547f
723 changed files with 234 additions and 207 deletions
+16 -16
View File
@@ -8,8 +8,8 @@ pytest = python -m pytest {posargs}
# Paths are listed on one line because tox seems to have inconsistent
# behavior with substitutions that contain line continuations, see
# https://github.com/tox-dev/tox/issues/2069 for more info.
mypy_strict_source_paths = certbot-ci/certbot_integration_tests certbot-ci/snap_integration_tests certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-dnsimple/certbot_dns_dnsimple certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy certbot-dns-gehirn/certbot_dns_gehirn certbot-dns-google/certbot_dns_google certbot-dns-linode/certbot_dns_linode certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-ovh/certbot_dns_ovh certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-dns-sakuracloud/certbot_dns_sakuracloud
mypy_no_strict_source_paths = acme/acme certbot/certbot certbot-apache/certbot_apache certbot-compatibility-test/certbot_compatibility_test certbot-nginx/certbot_nginx
mypy_strict_source_paths = certbot-ci/src certbot-dns-cloudflare/src certbot-dns-digitalocean/src certbot-dns-dnsimple/src certbot-dns-dnsmadeeasy/src certbot-dns-gehirn/src certbot-dns-google/src certbot-dns-linode/src certbot-dns-luadns/src certbot-dns-nsone/src certbot-dns-ovh/src certbot-dns-rfc2136/src certbot-dns-route53/src certbot-dns-sakuracloud/src
mypy_no_strict_source_paths = acme/src certbot/src certbot-apache/src certbot-compatibility-test/src certbot-nginx/src
source_paths = {[base]mypy_strict_source_paths} {[base]mypy_no_strict_source_paths}
[testenv]
@@ -162,27 +162,27 @@ deps =
-e certbot
-e certbot-apache
commands =
{toxinidir}/certbot-apache/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test --debian-modules
{toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test --debian-modules
passenv =
SERVER
allowlist_externals =
{toxinidir}/certbot-apache/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test
{toxinidir}/certbot-apache/src/certbot_apache/_internal/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/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py
{toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py
commands =
{toxinidir}/certbot-apache/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules
{toxinidir}/certbot-apache/src/certbot_apache/_internal/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/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py
{toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py
commands = {[testenv:apacheconftest-external-with-pebble]commands}
[testenv:nginxroundtrip]
@@ -228,9 +228,9 @@ deps =
-e certbot-nginx
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests \
{[base]pytest} certbot-ci/src/certbot_integration_tests \
--cov=acme --cov=certbot --cov=certbot_nginx --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
--cov-config=certbot-ci/src/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=65
coverage report --include 'certbot-nginx/*' --show-missing --fail-under=74
passenv = DOCKER_*
@@ -241,9 +241,9 @@ deps =
-e certbot
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/certbot_tests \
{[base]pytest} certbot-ci/src/certbot_integration_tests/certbot_tests \
--cov=acme --cov=certbot --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
--cov-config=certbot-ci/src/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=62
[testenv:integration-dns-rfc2136]
@@ -253,11 +253,11 @@ deps =
-e certbot-dns-rfc2136
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/rfc2136_tests \
{[base]pytest} certbot-ci/src/certbot_integration_tests/rfc2136_tests \
--dns-server=bind \
--numprocesses=1 \
--cov=acme --cov=certbot --cov=certbot_dns_rfc2136 --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
--cov-config=certbot-ci/src/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=45
coverage report --include 'certbot-dns-rfc2136/*' --show-missing --fail-under=86
@@ -266,7 +266,7 @@ description = Run integration tests with Certbot outside of the tox virtual envi
deps =
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests
{[base]pytest} certbot-ci/src/certbot_integration_tests
passenv = DOCKER_*
[testenv:integration-certbot-oldest]
@@ -277,7 +277,7 @@ deps =
basepython =
{[testenv:oldest]basepython}
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/certbot_tests
{[base]pytest} certbot-ci/src/certbot_integration_tests/certbot_tests
passenv = DOCKER_*
setenv = {[testenv:oldest]setenv}
@@ -290,7 +290,7 @@ deps =
basepython =
{[testenv:oldest]basepython}
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/nginx_tests
{[base]pytest} certbot-ci/src/certbot_integration_tests/nginx_tests
passenv = DOCKER_*
setenv = {[testenv:oldest]setenv}