Skip to content

Commit

Permalink
Merge pull request #9919 from certbot/unpin-poetry-tox
Browse files Browse the repository at this point in the history
Unpin poetry and use tox >= v4
  • Loading branch information
wgreenberg committed Apr 10, 2024
2 parents 6ecf378 + cca30ac commit 2a41402
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/jobs/extended-tests-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
PYTHON_VERSION: 3.11
TOXENV: py311
linux-isolated:
TOXENV: 'isolated-{acme,certbot,apache,cloudflare,digitalocean,dnsimple,dnsmadeeasy,gehirn,google,linode,luadns,nsone,ovh,rfc2136,route53,sakuracloud,nginx}'
TOXENV: 'isolated-acme,isolated-certbot,isolated-apache,isolated-cloudflare,isolated-digitalocean,isolated-dnsimple,isolated-dnsmadeeasy,isolated-gehirn,isolated-google,isolated-linode,isolated-luadns,isolated-nsone,isolated-ovh,isolated-rfc2136,isolated-route53,isolated-sakuracloud,isolated-nginx'
linux-boulder-v2-integration-certbot-oldest:
PYTHON_VERSION: 3.8
TOXENV: integration-certbot-oldest
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/jobs/packaging-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
displayName: Install Certbot snap
- script: |
set -e
venv/bin/python -m tox -e integration-external,apacheconftest-external-with-pebble
venv/bin/python -m tox run -e integration-external,apacheconftest-external-with-pebble
displayName: Run tox
- job: snap_dns_run
dependsOn: snaps_build
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/steps/tox-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ steps:
export TARGET_BRANCH="`echo "${BUILD_SOURCEBRANCH}" | sed -E 's!refs/(heads|tags)/!!g'`"
[ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}"
env
python3 -m tox
python3 -m tox run
env:
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
Expand Down
10 changes: 5 additions & 5 deletions certbot/docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ For debugging, we recommend putting

Once you are done with your code changes, and the tests in ``foo_test.py``
pass, run all of the unit tests for Certbot and check for coverage with ``tox
-e cover``. You should then check for code style with ``tox -e lint`` (all
-e cover``. You should then check for code style with ``tox run -e lint`` (all
files) or ``pylint --rcfile=.pylintrc path/to/file.py`` (single file at a
time).

Expand Down Expand Up @@ -163,7 +163,7 @@ With a user allowed to access your local Docker daemon, run:

.. code-block:: shell
tox -e integration
tox run -e integration
Tests will be run using pytest. A test report and a code coverage report will be
displayed at the end of the integration tests execution.
Expand Down Expand Up @@ -485,7 +485,7 @@ annotations; we can find bugs in Certbot even without a fully annotated codebase
Zulip wrote a `great guide`_ to using mypy. It’s useful, but you don’t have to read the whole thing
to start contributing to Certbot.

To run mypy on Certbot, use ``tox -e mypy`` on a machine that has Python 3 installed.
To run mypy on Certbot, use ``tox run -e mypy`` on a machine that has Python 3 installed.

Also note that OpenSSL, which we rely on, has type definitions for crypto but not SSL. We use both.
Those imports should look like this:
Expand All @@ -509,12 +509,12 @@ Steps:
something we have the time and interest to review.
1. Write your code! When doing this, you should add :ref:`mypy type annotations
<type annotations>` for any functions you add or modify. You can check that
you've done this correctly by running ``tox -e mypy`` on a machine that has
you've done this correctly by running ``tox run -e mypy`` on a machine that has
Python 3 installed.
2. Make sure your environment is set up properly and that you're in your
virtualenv. You can do this by following the instructions in the
:ref:`Getting Started <getting_started>` section.
3. Run ``tox -e lint`` to check for pylint errors. Fix any errors.
3. Run ``tox run -e lint`` to check for pylint errors. Fix any errors.
4. Run ``tox --skip-missing-interpreters`` to run all the tests we recommend
developers run locally. The ``--skip-missing-interpreters`` argument ignores
missing versions of Python needed for running the tests. Fix any errors.
Expand Down
15 changes: 6 additions & 9 deletions tools/pinning/current/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license = "Apache License 2.0"
[tool.poetry.dependencies]
python = "^3.8"

# workaround for: https://github.com/python-poetry/poetry-plugin-export/issues/183
urllib3 = ">=1.25.4,<1.27"

# Local dependencies
# Any local packages that have dependencies on other local packages must be
# listed below before the package it depends on. For instance, certbot depends
Expand Down Expand Up @@ -65,16 +68,10 @@ pylint = "3.0.2"
# Making sure that it would not get installed (Fixing https://github.com/certbot/certbot/issues/9336)
cryptography = "!= 37.0.3"

# If poetry>=1.3.0 is selected, multiple versions of virtualenv are selected
# causing problems when exporting dependencies so let's pin poetry back until
# https://github.com/python-poetry/poetry-plugin-export/issues/168 is resolved.
poetry = "<1.3.0"
# Branch 4.x of tox introduces backward incompatibility changes, so require a newer
# version of tox to keep deterministic builds.
tox = ">=4"

# Branch 4.x of tox introduces backward incompatibility changes. The tox.ini
# file in the project must be adapted accordingly before moving out of the 3.x
# branch. Once done, the following constraint should become tox >= 4 to keep
# deterministic builds.
tox = "<4"

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit 2a41402

Please sign in to comment.