From 87b1b5716cbe8bc6e5a6f6845c53956c774648e2 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Mon, 8 Nov 2021 11:17:56 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=91=B7=20[nox]=20Support=20Python=203?= =?UTF-8?q?.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {{cookiecutter.project_name}}/noxfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_name}}/noxfile.py b/{{cookiecutter.project_name}}/noxfile.py index fc4055542..c972cb3bf 100644 --- a/{{cookiecutter.project_name}}/noxfile.py +++ b/{{cookiecutter.project_name}}/noxfile.py @@ -20,7 +20,7 @@ package = "{{cookiecutter.package_name}}" -python_versions = ["3.9", "3.8", "3.7", "3.6"] +python_versions = ["3.10", "3.9", "3.8", "3.7", "3.6"] nox.needs_version = ">= 2021.6.6" nox.options.sessions = ( "pre-commit", @@ -83,7 +83,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None: hook.write_text("\n".join(lines)) -@session(name="pre-commit", python="3.9") +@session(name="pre-commit", python="3.10") def precommit(session: Session) -> None: """Lint using pre-commit.""" args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"] @@ -105,7 +105,7 @@ def precommit(session: Session) -> None: activate_virtualenv_in_precommit_hooks(session) -@session(python="3.9") +@session(python="3.10") def safety(session: Session) -> None: """Scan dependencies for insecure packages.""" requirements = session.poetry.export_requirements() @@ -166,7 +166,7 @@ def xdoctest(session: Session) -> None: session.run("python", "-m", "xdoctest", package, *args) -@session(name="docs-build", python="3.9") +@session(name="docs-build", python="3.10") def docs_build(session: Session) -> None: """Build the documentation.""" args = session.posargs or ["docs", "docs/_build"] @@ -180,7 +180,7 @@ def docs_build(session: Session) -> None: session.run("sphinx-build", *args) -@session(python="3.9") +@session(python="3.10") def docs(session: Session) -> None: """Build and serve the documentation with live reloading on file changes.""" args = session.posargs or ["--open-browser", "docs", "docs/_build"] From a6279426d2015744f0312648a9394d7af41a623b Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Mon, 8 Nov 2021 11:18:24 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=91=B7=20[github]=20Use=20Python=203.?= =?UTF-8?q?10=20in=20Tests=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.github/workflows/tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/tests.yml b/{{cookiecutter.project_name}}/.github/workflows/tests.yml index 4d6d4e9ee..261727982 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/tests.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/tests.yml @@ -12,21 +12,23 @@ jobs: fail-fast: false matrix: include: - - { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" } - - { python-version: 3.9, os: ubuntu-latest, session: "safety" } + - { python-version: "3.10", os: ubuntu-latest, session: "pre-commit" } + - { python-version: "3.10", os: ubuntu-latest, session: "safety" } + - { python-version: "3.10", os: ubuntu-latest, session: "mypy" } - { python-version: 3.9, os: ubuntu-latest, session: "mypy" } - { python-version: 3.8, os: ubuntu-latest, session: "mypy" } - { python-version: 3.7, os: ubuntu-latest, session: "mypy" } - { python-version: 3.6, os: ubuntu-latest, session: "mypy" } + - { python-version: "3.10", os: ubuntu-latest, session: "tests" } - { python-version: 3.9, os: ubuntu-latest, session: "tests" } - { python-version: 3.8, os: ubuntu-latest, session: "tests" } - { python-version: 3.7, os: ubuntu-latest, session: "tests" } - { python-version: 3.6, os: ubuntu-latest, session: "tests" } - { python-version: 3.9, os: windows-latest, session: "tests" } - { python-version: 3.9, os: macos-latest, session: "tests" } - - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" } - - { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" } - - { python-version: 3.9, os: ubuntu-latest, session: "docs-build" } + - { python-version: "3.10", os: ubuntu-latest, session: "typeguard" } + - { python-version: "3.10", os: ubuntu-latest, session: "xdoctest" } + - { python-version: "3.10", os: ubuntu-latest, session: "docs-build" } env: NOXSESSION: {{ "${{ matrix.session }}" }} From 7da4141519ce7ea7ea90d05e922a1c8ba3f02d6a Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Mon, 8 Nov 2021 11:19:00 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=91=B7=20[github]=20Use=20Python=203.?= =?UTF-8?q?10=20in=20Release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {{cookiecutter.project_name}}/.github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/release.yml b/{{cookiecutter.project_name}}/.github/workflows/release.yml index b51af51f2..338b3e9cd 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/release.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2.2.2 with: - python-version: "3.9" + python-version: "3.10" - name: Upgrade pip run: | From 9c9e7c83fad64a9554c42aa74bc3416b29c1f38a Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Mon, 8 Nov 2021 11:19:29 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=93=A6=20[poetry]=20Add=20Trove=20cla?= =?UTF-8?q?ssifier=20for=20Python=203.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {{cookiecutter.project_name}}/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 693854b57..e33a4ca3c 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ] [tool.poetry.urls] From f1aefbc46b25cc057eab3ab9e27aae84883b6abc Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Mon, 8 Nov 2021 11:39:56 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=93=9A=20Document=20Python=203.10=20s?= =?UTF-8?q?upport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.rst | 2 +- docs/guide.rst | 60 +++++++++++++++++++++++---------------------- docs/quickstart.rst | 2 +- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/README.rst b/README.rst index 5d83313ef..c42471b68 100644 --- a/README.rst +++ b/README.rst @@ -87,7 +87,7 @@ Features - Generate command-line reference with sphinx-click_ - Manage project labels with `GitHub Labeler`_ -The template supports Python 3.6, 3.7, 3.8, and 3.9. +The template supports Python 3.6, 3.7, 3.8, 3.9, and 3.10. .. features-end diff --git a/docs/guide.rst b/docs/guide.rst index cab8845d9..0b889bbe2 100644 --- a/docs/guide.rst +++ b/docs/guide.rst @@ -145,14 +145,15 @@ using one of the commands listed in the __ https://github.com/pyenv/pyenv/wiki/Common-build-problems Install the latest point release of every supported Python version. -This project template supports Python 3.6, 3.7, 3.8, and 3.9. +This project template supports Python 3.6, 3.7, 3.8, 3.9, and 3.10. .. code:: console - $ pyenv install 3.6.12 - $ pyenv install 3.7.9 - $ pyenv install 3.8.6 - $ pyenv install 3.9.0 + $ pyenv install 3.6.15 + $ pyenv install 3.7.12 + $ pyenv install 3.8.12 + $ pyenv install 3.9.8 + $ pyenv install 3.10.0 After creating your project (see :ref:`below `), you can make these Python versions accessible in the project directory, @@ -160,7 +161,7 @@ using the following command: .. code:: console - $ pyenv local 3.9.0 3.8.6 3.7.9 3.6.12 + $ pyenv local 3.10.0 3.9.8 3.8.12 3.7.12 3.6.15 The first version listed is the one used when you type plain ``python``. Every version can be used by invoking ``python``. @@ -885,9 +886,10 @@ and easily switch between them: $ poetry env use 3.7 $ poetry env use 3.8 $ poetry env use 3.9 + $ poetry env use 3.10 Only one Poetry environment can be active at any time. -Note that ``3.9`` comes last, +Note that ``3.10`` comes last, to ensure that the current Python release is the active environment. Install your package with ``poetry install`` into each environment after creating it. @@ -1081,7 +1083,7 @@ For example, the following may be more practical during development .. code:: console - $ nox -p 3.9 -rs tests mypy + $ nox -p 3.10 -rs tests mypy .. _--reuse-existing-virtualenvs: https://nox.thea.codes/en/stable/usage.html#re-using-virtualenvs @@ -1107,15 +1109,15 @@ The following table gives an overview of the available Nox sessions: ========================================== ===================================== ================== ========= Session Description Python Default ========================================== ===================================== ================== ========= - :ref:`coverage ` Report coverage with Coverage.py_ ``3.9`` (✓) - :ref:`docs ` Build and serve Sphinx_ documentation ``3.9`` - :ref:`docs-build ` Build Sphinx_ documentation ``3.9`` ✓ - :ref:`mypy ` Type-check with mypy_ ``3.6`` … ``3.9`` ✓ - :ref:`pre-commit ` Lint with pre-commit_ ``3.9`` ✓ - :ref:`safety ` Scan dependencies with Safety_ ``3.9`` ✓ - :ref:`tests ` Run tests with pytest_ ``3.6`` … ``3.9`` ✓ - :ref:`typeguard ` Type-check with Typeguard_ ``3.6`` … ``3.9`` ✓ - :ref:`xdoctest ` Run examples with xdoctest_ ``3.6`` … ``3.9`` ✓ + :ref:`coverage ` Report coverage with Coverage.py_ ``3.10`` (✓) + :ref:`docs ` Build and serve Sphinx_ documentation ``3.10`` + :ref:`docs-build ` Build Sphinx_ documentation ``3.10`` ✓ + :ref:`mypy ` Type-check with mypy_ ``3.6`` … ``3.10`` ✓ + :ref:`pre-commit ` Lint with pre-commit_ ``3.10`` ✓ + :ref:`safety ` Scan dependencies with Safety_ ``3.10`` ✓ + :ref:`tests ` Run tests with pytest_ ``3.6`` … ``3.10`` ✓ + :ref:`typeguard ` Type-check with Typeguard_ ``3.6`` … ``3.10`` ✓ + :ref:`xdoctest ` Run examples with xdoctest_ ``3.6`` … ``3.10`` ✓ ========================================== ===================================== ================== ========= @@ -1180,7 +1182,7 @@ using the current stable release of Python: .. code:: console - $ nox --session=mypy --python=3.9 + $ nox --session=mypy --python=3.10 Use the separator ``--`` to pass additional options and arguments to ``mypy``. For example, the following command type-checks only the ``__main__`` module: @@ -1263,7 +1265,7 @@ using the current stable release of Python: .. code:: console - $ nox --session=tests --python=3.9 + $ nox --session=tests --python=3.10 Use the separator ``--`` to pass additional options to ``pytest``. For example, the following command runs only the test case ``test_main_succeeds``: @@ -1360,7 +1362,7 @@ with the current stable release of Python: .. code:: console - $ nox --session=typeguard --python=3.9 + $ nox --session=typeguard --python=3.10 Use the separator ``--`` to pass additional options and arguments to pytest. For example, the following command runs only tests for the ``__main__`` module: @@ -1403,7 +1405,7 @@ using the current stable release of Python: .. code:: console - $ nox --session=xdoctest --python=3.9 + $ nox --session=xdoctest --python=3.10 By default, the Nox session uses the ``all`` subcommand to run all examples. You can also list examples using the ``list`` subcommand, @@ -2280,14 +2282,14 @@ __ https://help.github.com/en/actions/automating-your-workflow-with-github-actio ========================================== ====================== ================== Nox session Platform Python versions ========================================== ====================== ================== - :ref:`pre-commit ` Ubuntu 3.9 - :ref:`safety ` Ubuntu 3.9 - :ref:`mypy ` Ubuntu 3.9, 3.8, 3.7, 3.6 - :ref:`tests ` Ubuntu 3.9, 3.8, 3.7, 3.6 - :ref:`tests ` Windows 3.9 - :ref:`tests ` macOS 3.9 - :ref:`coverage ` Ubuntu 3.9 - :ref:`docs-build ` Ubuntu 3.8 + :ref:`pre-commit ` Ubuntu 3.10 + :ref:`safety ` Ubuntu 3.10 + :ref:`mypy ` Ubuntu 3.10, 3.9, 3.8, 3.7, 3.6 + :ref:`tests ` Ubuntu 3.10, 3.9, 3.8, 3.7, 3.6 + :ref:`tests ` Windows 3.10 + :ref:`tests ` macOS 3.10 + :ref:`coverage ` Ubuntu 3.10 + :ref:`docs-build ` Ubuntu 3.10 ========================================== ====================== ================== The workflow uploads the generated documentation as a `workflow artifact`__. diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 7e76394ad..19638ee46 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -27,7 +27,7 @@ Install Nox_ and nox-poetry_: pipx_ is preferred, but you can also install with ``pip install --user``. -It is recommended to set up Python 3.6, 3.7, 3.8, and 3.9 using pyenv_. +It is recommended to set up Python 3.6, 3.7, 3.8, 3.9, 3.10 using pyenv_. Creating a project