From 05a3c52b4d41690e0471a2e283cffb500dc0329a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 11 Sep 2019 11:25:50 +0100 Subject: [PATCH 001/206] Python 3 only --- .travis.yml | 1 - appveyor.yml | 2 +- setup.cfg | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ccac8f..8b607a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ dist: xenial language: python python: -- 2.7 - 3.6 - &latest_py3 3.7 diff --git a/appveyor.yml b/appveyor.yml index f35aa27..bfd5752 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ environment: matrix: - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python27-x64" + - PYTHON: "C:\\Python37-x64" install: # symlink python from a directory with a space diff --git a/setup.cfg b/setup.cfg index 9345869..8dc6d4e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,13 +13,12 @@ classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 [options] packages = find: include_package_data = true -python_requires = >=2.7 +python_requires = >=3.6 install_requires = setup_requires = setuptools_scm >= 1.15.0 From 757b121d940f0daf7fbe4f494b47cb1b0ed6e0c2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Nov 2019 10:31:33 -0500 Subject: [PATCH 002/206] Rename 'build-docs' to simply 'docs' (matching more popular convention). --- skeleton.md | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skeleton.md b/skeleton.md index 52b97f0..ee26e14 100644 --- a/skeleton.md +++ b/skeleton.md @@ -85,7 +85,7 @@ The skeleton assumes the developer has [tox](https://pypi.org/project/tox) insta Other environments (invoked with `tox -e {name}`) supplied include: - - a `build-docs` environment to build the documentation + - a `docs` environment to build the documentation - a `release` environment to publish the package to PyPI A pytest.ini is included to define common options around running tests. In particular: @@ -122,7 +122,7 @@ TWINE_PASSWORD={token} travis env copy TWINE_PASSWORD ## Building Documentation -Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e build-docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. +Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. In addition to building the sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. diff --git a/tox.ini b/tox.ini index d86e4ad..889af7a 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ commands = usedevelop = True extras = testing -[testenv:build-docs] +[testenv:docs] extras = docs testing From 9ef4b6e60389a8f39cc04e466d12f42861c26472 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 30 Nov 2019 21:08:31 -0500 Subject: [PATCH 003/206] Prefer 'path' to 'path.py' --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 889af7a..fa2a72f 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,7 @@ skip_install = True deps = pep517>=0.5 twine[keyring]>=1.13 - path.py + path passenv = TWINE_PASSWORD setenv = From 266a9c112ce2fb38365a13f57122fa73754555ce Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 8 Dec 2019 12:25:04 -0500 Subject: [PATCH 004/206] Cover Python 3.8 in Windows tests --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bfd5752..6a1c99a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ environment: matrix: - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python37-x64" + - PYTHON: "C:\\Python38-x64" install: # symlink python from a directory with a space From 76786bdd11eac589bdaeb9a8cea5dcacaf613225 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 20 Dec 2019 23:49:53 -0500 Subject: [PATCH 005/206] Update black in pre-commit and add blacken-docs. --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e16c59a..fe46b8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: 19.3b0 + rev: 19.10b0 hooks: - id: black + +- repo: https://github.com/asottile/blacken-docs + rev: v1.4.0 + hooks: + - id: blacken-docs From 051ce14211226aa34e11dc963cef508dd8ccdc53 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 4 Jan 2020 16:39:37 -0500 Subject: [PATCH 006/206] Test and release using Azure Pipelines --- .travis.yml | 9 ------ README.rst | 3 ++ azure-pipelines.yml | 71 +++++++++++++++++++++++++++++++++++++++++++++ skeleton.md | 34 ++++++++++++++++++---- 4 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 azure-pipelines.yml diff --git a/.travis.yml b/.travis.yml index 45cbcf9..17e45a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,15 +5,6 @@ python: - 3.6 - &latest_py3 3.8 -jobs: - fast_finish: true - include: - - stage: deploy - if: tag IS present - python: *latest_py3 - before_script: skip - script: tox -e release - cache: pip install: diff --git a/README.rst b/README.rst index 50eba56..a234ec9 100644 --- a/README.rst +++ b/README.rst @@ -3,6 +3,9 @@ .. image:: https://img.shields.io/pypi/pyversions/skeleton.svg +.. image:: https://dev.azure.com/jaraco/skeleton/_apis/build/status/jaraco.skeleton?branchName=master + :target: https://dev.azure.com/jaraco/skeleton/_build/latest?definitionId=1&branchName=master + .. image:: https://img.shields.io/travis/jaraco/skeleton/master.svg :target: https://travis-ci.org/jaraco/skeleton diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..d461bd0 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,71 @@ +# Create the project in Azure with: +# az project create --name $name --organization https://dev.azure.com/$org/ --visibility public +# then configure the pipelines (through web UI) + +trigger: + branches: + include: + - '*' + tags: + include: + - '*' + +pool: + vmimage: 'Ubuntu-18.04' + +variables: +- group: Azure secrets + +stages: +- stage: Test + jobs: + + - job: 'Test' + strategy: + matrix: + Python36: + python.version: '3.6' + Python38: + python.version: '3.8' + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -- --junit-xml=test-results.xml + displayName: 'run tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + +- stage: Publish + dependsOn: Test + jobs: + - job: 'Publish' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -e release + env: + TWINE_PASSWORD: $(PyPI-token) + displayName: 'publish to PyPI' + + condition: contains(variables['Build.SourceBranch'], 'tags') diff --git a/skeleton.md b/skeleton.md index ee26e14..7e9955c 100644 --- a/skeleton.md +++ b/skeleton.md @@ -103,23 +103,47 @@ Relies a .flake8 file to correct some default behaviors: ## Continuous Integration -The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command. +The project is pre-configured to run tests through multiple CI providers. + +### Azure Pipelines + +[Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) are the preferred provider as they provide free, fast, multi-platform services. See azure-pipelines.yml for more details. + +Features include: + +- test against multiple Python versions +- run on Ubuntu Bionic + +### Travis CI + +[Travis-CI](https://travis-ci.org) is configured through .travis.yml. Any new project must be enabled either through their web site or with the `travis enable` command. Features include: -- test against Python 2 and 3 +- test against 3 - run on Ubuntu Xenial - correct for broken IPv6 -Also provided is a minimal template for running under Appveyor (Windows). +### Appveyor + +A minimal template for running under Appveyor (Windows) is provided. ### Continuous Deployments -In addition to running tests, an additional deploy stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with Travis as the TWINE_PASSWORD environment variable. After the Travis project is created, configure the token through the web UI or with a command like the following (bash syntax): +In addition to running tests, an additional deploy stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with Azure as the `Azure secrets` variable group. This variable group needs to be created only once per organization. For example: ``` -TWINE_PASSWORD={token} travis env copy TWINE_PASSWORD +# create a resource group if none exists +az group create --name main --location eastus2 +# create the vault (try different names until something works) +az keyvault create --name secrets007 --resource-group main +# create the secret +az keyvault secret set --vault-name secrets007 --name PyPI-token --value $token ``` +Then, in the web UI for the project's Pipelines Library, create the `Azure secrets` variable group referencing the key vault name. + +For more details, see [this blog entry](https://blog.jaraco.com/configuring-azure-pipelines-with-secets/). + ## Building Documentation Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. From b07b27332dcefc9ae9ad0a4d35ca4f39fa358233 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 11 Jan 2020 17:18:12 -0500 Subject: [PATCH 007/206] Correct guidance on project creation. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d461bd0..3e80bf4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ # Create the project in Azure with: -# az project create --name $name --organization https://dev.azure.com/$org/ --visibility public +# az devops project create --name $name --organization https://dev.azure.com/$org/ --visibility public # then configure the pipelines (through web UI) trigger: From 0bf3d43d97d5466fddac708e7ca38ba95281c6e7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 18 Jan 2020 13:36:43 -0500 Subject: [PATCH 008/206] Rely on setuptools_scm 3.4 and setuptools 42. Now setup.py is optional. Remove setuptools from test environment. --- pyproject.toml | 4 +++- setup.cfg | 2 +- setup.py | 2 +- tox.ini | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3afc8c3..74cff74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,8 @@ [build-system] -requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] +requires = ["setuptools>=42", "wheel", "setuptools_scm>=3.4"] build-backend = "setuptools.build_meta" [tool.black] skip-string-normalization = true + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index 2c0f7b1..bc7a9d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ packages = find: include_package_data = true python_requires = >=3.6 install_requires = -setup_requires = setuptools_scm >= 1.15.0 +setup_requires = setuptools_scm >= 3.4 [options.extras_require] testing = diff --git a/setup.py b/setup.py index 827e955..bac24a4 100644 --- a/setup.py +++ b/setup.py @@ -3,4 +3,4 @@ import setuptools if __name__ == "__main__": - setuptools.setup(use_scm_version=True) + setuptools.setup() diff --git a/tox.ini b/tox.ini index fa2a72f..fb98930 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,6 @@ requires = [testenv] deps = - setuptools>=31.0.1 pip_version = pip commands = pytest {posargs} From d9934dc8f5dafb93ca565eb0f8ec9e0c245b8d68 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 18 Jan 2020 20:50:32 +0200 Subject: [PATCH 009/206] Spelling and capitalisation (#8) Co-authored-by: Jason R. Coombs --- skeleton.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/skeleton.md b/skeleton.md index 7e9955c..439df2f 100644 --- a/skeleton.md +++ b/skeleton.md @@ -2,9 +2,9 @@ This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. -## An SCM Managed Approach +## An SCM-Managed Approach -While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a git repo capturing the evolution and culmination of these best practices. +While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a Git repo capturing the evolution and culmination of these best practices. It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. @@ -38,7 +38,7 @@ The `--allow-unrelated-histories` is necessary because the history from the skel ## Updating -Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar git operations. +Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. @@ -46,16 +46,16 @@ Thereafter, the target project can make whatever customizations it deems relevan The features/techniques employed by the skeleton include: -- PEP 517/518 based build relying on setuptools as the build tool -- setuptools declarative configuration using setup.cfg +- PEP 517/518-based build relying on Setuptools as the build tool +- Setuptools declarative configuration using setup.cfg - tox for running tests -- A README.rst as reStructuredText with some popular badges, but with readthedocs and appveyor badges commented out +- A README.rst as reStructuredText with some popular badges, but with Read the Docs and AppVeyor badges commented out - A CHANGES.rst file intended for publishing release notes about the project -- Use of [black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) +- Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) ## Packaging Conventions -A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on setuptools (a minimum version compatible with setup.cfg declarative config). +A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on Setuptools (a minimum version compatible with setup.cfg declarative config). The setup.cfg file implements the following features: @@ -92,14 +92,14 @@ A pytest.ini is included to define common options around running tests. In parti - rely on default test discovery in the current directory - avoid recursing into common directories not containing tests -- run doctests on modules and invoke flake8 tests -- in doctests, allow unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. +- run doctests on modules and invoke Flake8 tests +- in doctests, allow Unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. - filters out known warnings caused by libraries/functionality included by the skeleton -Relies a .flake8 file to correct some default behaviors: +Relies on a .flake8 file to correct some default behaviors: - disable mutually incompatible rules W503 and W504 -- support for black format +- support for Black format ## Continuous Integration @@ -116,10 +116,10 @@ Features include: ### Travis CI -[Travis-CI](https://travis-ci.org) is configured through .travis.yml. Any new project must be enabled either through their web site or with the `travis enable` command. +[Travis CI](https://travis-ci.org) is configured through .travis.yml. Any new project must be enabled either through their web site or with the `travis enable` command. Features include: -- test against 3 +- test against Python 3 - run on Ubuntu Xenial - correct for broken IPv6 @@ -148,7 +148,7 @@ For more details, see [this blog entry](https://blog.jaraco.com/configuring-azur Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. -In addition to building the sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. +In addition to building the Sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. ## Cutting releases From 7558cfe2eb2f1ffe3676905e9871466cbc9da24f Mon Sep 17 00:00:00 2001 From: johnthagen Date: Tue, 14 Jan 2020 07:53:19 -0500 Subject: [PATCH 010/206] Line wrap LICENSE file --- LICENSE | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 5e795a6..353924b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,19 @@ Copyright Jason R. Coombs -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. From 479ac2149d872757160732bc977977ee0192ac51 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 19 Jan 2020 10:51:33 -0500 Subject: [PATCH 011/206] Finish dropping support for Python 2 (I hope). --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index bc7a9d5..3e62107 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[bdist_wheel] -universal = 1 - [metadata] license_file = LICENSE name = skeleton @@ -14,6 +11,7 @@ classifiers = Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only [options] packages = find: From 29c497286e9f8e835c68b7b4ddb9ff3635a273dc Mon Sep 17 00:00:00 2001 From: layday <31134424+layday@users.noreply.github.com> Date: Thu, 23 Jan 2020 03:48:38 +0200 Subject: [PATCH 012/206] Require toml extra for setuptools_scm (#12) * Require toml extra for setuptools_scm setuptools_scm does not know to invoke itself if it can't read pyproject.toml. This broke sdist installs for projects deriving from skeleton: $ python -m pip install zipp --no-binary zipp Collecting zipp [...] Successfully installed zipp-0.0.0 Note the version number defaulting to '0.0.0'. Building locally only works because pep517, the build tool, depends on toml which it exposes to the build environment. * Require setuptools_scm 3.4.1 at a minimum A bare [tool.setuptools_scm] does not work in 3.4.0. * fixup! Require toml extra for setuptools_scm * fixup! Require setuptools_scm 3.4.1 at a minimum --- pyproject.toml | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 74cff74..6ee7df2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm>=3.4"] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] diff --git a/setup.cfg b/setup.cfg index 3e62107..c20fa10 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ packages = find: include_package_data = true python_requires = >=3.6 install_requires = -setup_requires = setuptools_scm >= 3.4 +setup_requires = setuptools_scm[toml] >= 3.4.1 [options.extras_require] testing = From 9a7d846ae8775e5c49cc9933fa897cc761c3b20b Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 18 Jan 2020 20:53:39 +0200 Subject: [PATCH 013/206] Fix AppVeyor typo --- skeleton.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skeleton.md b/skeleton.md index 439df2f..340b65c 100644 --- a/skeleton.md +++ b/skeleton.md @@ -123,9 +123,9 @@ Features include: - run on Ubuntu Xenial - correct for broken IPv6 -### Appveyor +### AppVeyor -A minimal template for running under Appveyor (Windows) is provided. +A minimal template for running under AppVeyor (Windows) is provided. ### Continuous Deployments From 0aa6c5c191ad22bbc4ad30d0880e531d4e66c0b3 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 23 Jan 2020 22:51:29 +0200 Subject: [PATCH 014/206] Link badge to PyPI rather than static image And DRY the link --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a234ec9..4c7fd55 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,10 @@ .. image:: https://img.shields.io/pypi/v/skeleton.svg - :target: https://pypi.org/project/skeleton + :target: `PyPI link`_ .. image:: https://img.shields.io/pypi/pyversions/skeleton.svg + :target: `PyPI link`_ + +.. _PyPI link: https://pypi.org/project/skeleton .. image:: https://dev.azure.com/jaraco/skeleton/_apis/build/status/jaraco.skeleton?branchName=master :target: https://dev.azure.com/jaraco/skeleton/_build/latest?definitionId=1&branchName=master From 0b681b040f3e13793c61c1dfe6e510d9e3a8870a Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 4 Feb 2020 14:51:03 -0600 Subject: [PATCH 015/206] setup.cfg: let python-tag mirror python_requires In order to generate a wheel in accordance with PEP 425 to restrict the minimum required version of Python (3.6), the `python-tag` bdist_wheel option needs to be specified so the wheel gets tagged properly. Before: zipp-x.x.x-py3-none-any.whl After: zipp-x.x.x-py36-none-any.whl Signed-off-by: Vincent Fazio --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index c20fa10..f2643ea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,6 +13,9 @@ classifiers = Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only +[bdist_wheel] +python-tag=py36 + [options] packages = find: include_package_data = true From eb00cd0636bc3e4cef9217b2c5eccdcaebbe5d65 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 9 Feb 2020 09:29:18 -0500 Subject: [PATCH 016/206] Normalize whitespace --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f2643ea..3436e6b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ classifiers = Programming Language :: Python :: 3 :: Only [bdist_wheel] -python-tag=py36 +python-tag = py36 [options] packages = find: From 4f845452dd0f7e95b7959b8e0ea50374c73b7920 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 17 Feb 2020 11:23:25 -0500 Subject: [PATCH 017/206] Revert "setup.cfg: let python-tag mirror python_requires" This reverts commit 0b681b040f3e13793c61c1dfe6e510d9e3a8870a. Ref jaraco/zipp#42 --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3436e6b..c20fa10 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,9 +13,6 @@ classifiers = Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only -[bdist_wheel] -python-tag = py36 - [options] packages = find: include_package_data = true From 8fbd841d17a029232577d71587c02aa429874287 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 28 Feb 2020 17:36:22 -0600 Subject: [PATCH 018/206] Update to bionic for Travis. Correct comment about IPv6 workaround. --- .travis.yml | 4 ++-- skeleton.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17e45a6..923377f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic language: python python: @@ -11,7 +11,7 @@ install: - pip install tox tox-venv before_script: - # Disable IPv6. Ref travis-ci/travis-ci#8361 + # Enable IPv6. Ref travis-ci/travis-ci#8361 - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi diff --git a/skeleton.md b/skeleton.md index 340b65c..4544158 100644 --- a/skeleton.md +++ b/skeleton.md @@ -120,7 +120,7 @@ Features include: Features include: - test against Python 3 -- run on Ubuntu Xenial +- run on Ubuntu Bionic - correct for broken IPv6 ### AppVeyor From b4dd44cc7c8da44bcc8f2674d2a5d764091f63c6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 15 Mar 2020 15:05:37 -0400 Subject: [PATCH 019/206] Suppress warnings in pytest-flake8, pytest-black, and pytest-checkdocs. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 7b9b714..60d9bf7 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,5 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 --black --cov doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= + # https://github.com/pytest-dev/pytest/issues/6928 + ignore:direct construction of .*Item has been deprecated:DeprecationWarning From 2c2fee097e1898a8c00b4434f74063302aeb96e9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 27 Mar 2020 09:22:01 -0400 Subject: [PATCH 020/206] Prefer pytest-black to pytest-black-multipy --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index c20fa10..3f887a6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ testing = pytest >= 3.5, !=3.7.3 pytest-checkdocs >= 1.2.3 pytest-flake8 - pytest-black-multipy + pytest-black >= 0.3.7 pytest-cov # local From 045e6ad88af135f85365248812cbe5ddb3faf355 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 Apr 2020 14:51:43 -0400 Subject: [PATCH 021/206] Test against Windows and Mac --- azure-pipelines.yml | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..25e638b --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,80 @@ +# Create the project in Azure with: +# az devops project create --name $name --organization https://dev.azure.com/$org/ --visibility public +# then configure the pipelines (through web UI) + +trigger: + branches: + include: + - '*' + tags: + include: + - '*' + +pool: + vmImage: $(pool_vm_image) + +variables: +- group: Azure secrets + +stages: +- stage: Test + jobs: + + - job: 'Test' + strategy: + matrix: + Bionic Python 3.6: + python.version: '3.6' + pool_vm_image: Ubuntu-18.04 + Bionic Python 3.8: + python.version: '3.8' + pool_vm_image: Ubuntu-18.04 + Windows: + python.version: '3.8' + pool_vm_image: vs2017-win2016 + MacOS: + python.version: '3.8' + pool_vm_image: macos-10.15 + + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -- --junit-xml=test-results.xml + displayName: 'run tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + +- stage: Publish + dependsOn: Test + jobs: + - job: 'Publish' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -e release + env: + TWINE_PASSWORD: $(PyPI-token) + displayName: 'publish to PyPI' + + condition: contains(variables['Build.SourceBranch'], 'tags') From bb96dc3fcd738e3202423a0ed09ea9f5dd4ce50b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 25 Apr 2020 09:54:59 -0400 Subject: [PATCH 022/206] Define a default pool_vm_image --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 25e638b..fd43296 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,6 +15,8 @@ pool: variables: - group: Azure secrets +- name: pool_vm_image + value: Ubuntu-18.04 stages: - stage: Test @@ -25,10 +27,8 @@ stages: matrix: Bionic Python 3.6: python.version: '3.6' - pool_vm_image: Ubuntu-18.04 Bionic Python 3.8: python.version: '3.8' - pool_vm_image: Ubuntu-18.04 Windows: python.version: '3.8' pool_vm_image: vs2017-win2016 From f66d87899937361bea35f437ba293774f0375ca2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 27 Apr 2020 18:49:51 -0400 Subject: [PATCH 023/206] Remove tox-venv and tox-pip-version. Tox-venv is discouraged (https://github.com/tox-dev/tox-venv/issues/48#issuecomment-620227405) and tox-pip-version was only there to support tox-venv. venv is dead; long live virtualenv. --- tox.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tox.ini b/tox.ini index fb98930..ba5857a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,15 +3,10 @@ envlist = python minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true -# Ensure that a late version of pip is used even on tox-venv. -requires = - tox-pip-version>=0.0.6 - tox-venv [testenv] deps = -pip_version = pip commands = pytest {posargs} usedevelop = True From 0df8947fc97f0f0fab6e680d20d8affe5838aec3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 May 2020 23:15:53 -0400 Subject: [PATCH 024/206] Remove more references to tox-venv --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 923377f..37fa499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ python: cache: pip install: -- pip install tox tox-venv +- pip install tox before_script: # Enable IPv6. Ref travis-ci/travis-ci#8361 diff --git a/appveyor.yml b/appveyor.yml index 6a1c99a..c6f46e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,7 +18,7 @@ cache: - '%LOCALAPPDATA%\pip\Cache' test_script: - - "python -m pip install -U tox tox-venv virtualenv" + - "python -m pip install -U tox virtualenv" - "tox" version: '{build}' From 649bc7934a13b78eb1283cad9919b9f26c5426e9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 2 May 2020 07:25:43 -0400 Subject: [PATCH 025/206] Add workaround for warning emitted when junitxml is used. Ref pytest-dev/pytest#6178. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 60d9bf7..62c0f36 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,6 +2,8 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 --black --cov doctest_optionflags=ALLOW_UNICODE ELLIPSIS +# workaround for warning pytest-dev/pytest#6178 +junit_family=xunit2 filterwarnings= # https://github.com/pytest-dev/pytest/issues/6928 ignore:direct construction of .*Item has been deprecated:DeprecationWarning From 7455f2f25310b2d778a648e45d32033ccc790946 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 15:31:25 -0400 Subject: [PATCH 026/206] Include mypy for type checking during tests. --- mypy.ini | 2 ++ pytest.ini | 2 +- setup.cfg | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..976ba02 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff --git a/pytest.ini b/pytest.ini index 62c0f36..381b327 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules --flake8 --black --cov +addopts=--doctest-modules --flake8 --black --cov --mypy doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 diff --git a/setup.cfg b/setup.cfg index 3f887a6..e2dcebb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,7 @@ testing = pytest-flake8 pytest-black >= 0.3.7 pytest-cov + pytest-mypy # local From 172c52b03a77e70e92a1ee491b059464e938fde3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 22 May 2020 11:31:51 -0400 Subject: [PATCH 027/206] Ensure virtualenv is upgraded when installing tox. Fixes jaraco/path#188. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 37fa499..eed7b0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,8 @@ python: cache: pip install: -- pip install tox +# ensure virtualenv is upgraded to avoid issues like jaraco/path#188 +- pip install -U --upgrade-strategy=eager tox before_script: # Enable IPv6. Ref travis-ci/travis-ci#8361 From c764baf26c001ca5828fe99b8aa33aa55e9fd554 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 22 May 2020 23:17:49 -0400 Subject: [PATCH 028/206] Run tests on prereleases of Python on Windows. Fixes jaraco/skeleton#17. --- azure-pipelines.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd43296..2be55e7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,9 +29,12 @@ stages: python.version: '3.6' Bionic Python 3.8: python.version: '3.8' - Windows: + Windows Python 3.8: python.version: '3.8' pool_vm_image: vs2017-win2016 + Windows Python Prerelease: + python.version: '3.9' + pool_vm_image: vs2017-win2016 MacOS: python.version: '3.8' pool_vm_image: macos-10.15 @@ -39,10 +42,21 @@ stages: maxParallel: 4 steps: + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet' + condition: eq(variables['pool_vm_image'], 'vs2017-win2016') + + - powershell: | + nuget install python -Prerelease -OutputDirectory "$(Build.BinariesDirectory)" -ExcludeVersion -NonInteractive + Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools" + Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools\Scripts" + condition: and(succeeded(), and(eq(variables['python.version'], '3.9'), eq(variables['pool_vm_image'], 'vs2017-win2016'))) + - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' architecture: 'x64' + condition: and(succeeded(), ne(variables['python.version'], '3.9')) - script: python -m pip install tox displayName: 'Install tox' From fc0162baafbd984f245de359b5a64c2d997a0714 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 23 May 2020 11:52:32 -0400 Subject: [PATCH 029/206] Add workaround for python/mypy#8627. Fixes jaraco/skeleton#18. --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index e2dcebb..0cf9549 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,6 +29,8 @@ testing = pytest-black >= 0.3.7 pytest-cov pytest-mypy + # workaround for python/mypy#8627 + mypy@git+https://github.com/python/mypy # local From 814eb669c2e5436d8ebce1be845fa99e0687317b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 23 May 2020 12:17:23 -0400 Subject: [PATCH 030/206] Add 'refresh.svg' demonstrating an example of refreshing a project with the latest skeleton. Ref #7. --- docs/refresh.svg | 193 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 docs/refresh.svg diff --git a/docs/refresh.svg b/docs/refresh.svg new file mode 100644 index 0000000..04e62f0 --- /dev/null +++ b/docs/refresh.svg @@ -0,0 +1,193 @@ + + + + + + + + + + + path master $ path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton From https://github.com/jaraco/skeleton * branch HEAD -> FETCH_HEADpath master $ path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH_ path master $ git diff ...FETCH_H path master $ git diff ...FETCH_HE path master $ git diff ...FETCH_HEA path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd43296..2be55e7 100644--- a/azure-pipelines.yml+++ b/azure-pipelines.yml@@ -29,9 +29,12 @@ stages: python.version: '3.6' Bionic Python 3.8: python.version: '3.8'- Windows:+ Windows Python 3.8: pool_vm_image: vs2017-win2016+ Windows Python Prerelease:+ python.version: '3.9'+ pool_vm_image: vs2017-win2016 MacOS: pool_vm_image: macos-10.15@@ -39,10 +42,21 @@ stages: maxParallel: 4 steps:+ - task: NuGetToolInstaller@1+ displayName: 'Install NuGet'+ condition: eq(variables['pool_vm_image'], 'vs2017-win2016')++ - powershell: |+ nuget install python -Prerelease -OutputDi + nuget install python -Prerelease -OutputDirectory "$(Build.BinariesDirectory)" -ExcludeVersion -NonInteractive+ Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools"+ Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools\Scripts"+ condition: and(succeeded(), and(eq(variables['python.version'], '3.9'), eq(variables['pool_vm_image'], 'vs2017-win2016'))) - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' architecture: 'x64'+ condition: and(succeeded(), ne(variables['python.version'], '3.9')) - script: python -m pip install tox displayName: 'Install tox'diff --git a/setup.cfg b/setup.cfgindex e2dcebb..0cf9549 100644--- a/setup.cfg+++ b/setup.cfg@@ -29,6 +29,8 @@ testing = pytest-black >= 0.3.7 pytest-cov pytest-mypy+ # workaround for python/mypy#8627: + mypy@git+https://github.com/python/mypy # local(END) path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git push path master $ git push path master $ git pull path master $ git pull path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton Auto-merging setup.cfgAuto-merging azure-pipelines.ymlMerge made by the 'recursive' strategy. azure-pipelines.yml | 16 +++++++++++++++- setup.cfg | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-)path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git push path master $ git push path master $ git push Enumerating objects: 10, done. Counting objects: 50% (5/10)Counting objects: 100% (10/10), done.Delta compression using up to 8 threadsCompressing objects: 100% (4/4), done.Writing objects: 100% (4/4), 512 bytes | 512.00 KiB/s, done.Total 4 (delta 3), reused 0 (delta 0), pack-reused 0remote: Resolving deltas: 100% (3/3), completed with 3 local objects. To https://github.com/jaraco/path ff4d395..bd18026 master -> masterpath master $ + \ No newline at end of file From 169dad91b8316a7138bec2f7b51db80cab0aadc4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 23 May 2020 22:40:39 -0400 Subject: [PATCH 031/206] Move workaround for python/mypy#8627 to tox.ini, as adding it to setup.cfg prevents releases to PyPI. Fixes jaraco/skeleton#19. --- setup.cfg | 2 -- tox.ini | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0cf9549..e2dcebb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,8 +29,6 @@ testing = pytest-black >= 0.3.7 pytest-cov pytest-mypy - # workaround for python/mypy#8627 - mypy@git+https://github.com/python/mypy # local diff --git a/tox.ini b/tox.ini index ba5857a..97cc426 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,8 @@ tox_pip_extensions_ext_venv_update = true [testenv] deps = + # workaround for python/mypy#8627 + mypy@git+https://github.com/python/mypy commands = pytest {posargs} usedevelop = True From a2fc27929fe7f7d6dc87700560d58abd08ddad46 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 26 Jul 2020 03:33:59 -0400 Subject: [PATCH 032/206] Remove workaround for python/mypy#8627. Ref jaraco/skeleton#18. --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index 97cc426..ba5857a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,8 +7,6 @@ tox_pip_extensions_ext_venv_update = true [testenv] deps = - # workaround for python/mypy#8627 - mypy@git+https://github.com/python/mypy commands = pytest {posargs} usedevelop = True From e630a0c8f213e4013b57a695187755641f7537a3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Aug 2020 14:30:41 -0400 Subject: [PATCH 033/206] Create Github releases when releasing the package. Fixes jaraco/skeleton#23. --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index ba5857a..7347d95 100644 --- a/tox.ini +++ b/tox.ini @@ -26,11 +26,14 @@ deps = pep517>=0.5 twine[keyring]>=1.13 path + jaraco.develop>=7.1 passenv = TWINE_PASSWORD + GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import path; path.Path('dist').rmtree_p()" python -m pep517.build . python -m twine upload dist/* + python -m jaraco.develop.create-github-release From 8032e1d3fb114bb93736d5b6668adc4d44f6c00b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Aug 2020 15:26:29 -0400 Subject: [PATCH 034/206] Moved refresh.svg to another branch. Reference the animation from the docs. Ref jaraco/skeleton#7. --- docs/refresh.svg | 193 ----------------------------------------------- skeleton.md | 4 + 2 files changed, 4 insertions(+), 193 deletions(-) delete mode 100644 docs/refresh.svg diff --git a/docs/refresh.svg b/docs/refresh.svg deleted file mode 100644 index 04e62f0..0000000 --- a/docs/refresh.svg +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - path master $ path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton From https://github.com/jaraco/skeleton * branch HEAD -> FETCH_HEADpath master $ path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git fetch gh://jaraco/skeleton path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH path master $ git diff ...FETCH_ path master $ git diff ...FETCH_H path master $ git diff ...FETCH_HE path master $ git diff ...FETCH_HEA path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd43296..2be55e7 100644--- a/azure-pipelines.yml+++ b/azure-pipelines.yml@@ -29,9 +29,12 @@ stages: python.version: '3.6' Bionic Python 3.8: python.version: '3.8'- Windows:+ Windows Python 3.8: pool_vm_image: vs2017-win2016+ Windows Python Prerelease:+ python.version: '3.9'+ pool_vm_image: vs2017-win2016 MacOS: pool_vm_image: macos-10.15@@ -39,10 +42,21 @@ stages: maxParallel: 4 steps:+ - task: NuGetToolInstaller@1+ displayName: 'Install NuGet'+ condition: eq(variables['pool_vm_image'], 'vs2017-win2016')++ - powershell: |+ nuget install python -Prerelease -OutputDi + nuget install python -Prerelease -OutputDirectory "$(Build.BinariesDirectory)" -ExcludeVersion -NonInteractive+ Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools"+ Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools\Scripts"+ condition: and(succeeded(), and(eq(variables['python.version'], '3.9'), eq(variables['pool_vm_image'], 'vs2017-win2016'))) - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' architecture: 'x64'+ condition: and(succeeded(), ne(variables['python.version'], '3.9')) - script: python -m pip install tox displayName: 'Install tox'diff --git a/setup.cfg b/setup.cfgindex e2dcebb..0cf9549 100644--- a/setup.cfg+++ b/setup.cfg@@ -29,6 +29,8 @@ testing = pytest-black >= 0.3.7 pytest-cov pytest-mypy+ # workaround for python/mypy#8627: + mypy@git+https://github.com/python/mypy # local(END) path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git diff ...FETCH_HEAD path master $ git push path master $ git push path master $ git pull path master $ git pull path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton Auto-merging setup.cfgAuto-merging azure-pipelines.ymlMerge made by the 'recursive' strategy. azure-pipelines.yml | 16 +++++++++++++++- setup.cfg | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-)path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git pull gh://jaraco/skeleton path master $ git push path master $ git push path master $ git push Enumerating objects: 10, done. Counting objects: 50% (5/10)Counting objects: 100% (10/10), done.Delta compression using up to 8 threadsCompressing objects: 100% (4/4), done.Writing objects: 100% (4/4), 512 bytes | 512.00 KiB/s, done.Total 4 (delta 3), reused 0 (delta 0), pack-reused 0remote: Resolving deltas: 100% (3/3), completed with 3 local objects. To https://github.com/jaraco/path ff4d395..bd18026 master -> masterpath master $ - \ No newline at end of file diff --git a/skeleton.md b/skeleton.md index 4544158..17a94ed 100644 --- a/skeleton.md +++ b/skeleton.md @@ -40,6 +40,10 @@ The `--allow-unrelated-histories` is necessary because the history from the skel Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. +For example, here's a session of the [path project](https://pypi.org/project/path) pulling non-conflicting changes from the skeleton: + + + Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. # Features From 6a13942eff3b62a7b4017101c33ae752e69fbc89 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 1 Sep 2020 22:00:43 -0400 Subject: [PATCH 035/206] Add the env var mapping too. --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2be55e7..fdad0e5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -89,6 +89,7 @@ stages: tox -e release env: TWINE_PASSWORD: $(PyPI-token) + GITHUB_TOKEN: $(Github-token) displayName: 'publish to PyPI' condition: contains(variables['Build.SourceBranch'], 'tags') From 15f6272d1eb253940f82737b4f340365ee9879a9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 4 Sep 2020 18:33:17 -0400 Subject: [PATCH 036/206] Disable pytest-black and pytest-mypy on PyPy. Fixes jaraco/skeleton#22. Ref pytest-dev/pytest#7675. --- pyproject.toml | 8 ++++++++ setup.cfg | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ee7df2..9b02ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,3 +6,11 @@ build-backend = "setuptools.build_meta" skip-string-normalization = true [tool.setuptools_scm] + +# jaraco/skeleton#22 +[tool.jaraco.pytest.opts.--black] +action = "store_true" + +# jaraco/skeleton#22 +[tool.jaraco.pytest.opts.--mypy] +action = "store_true" diff --git a/setup.cfg b/setup.cfg index e2dcebb..e9dd177 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,9 +26,11 @@ testing = pytest >= 3.5, !=3.7.3 pytest-checkdocs >= 1.2.3 pytest-flake8 - pytest-black >= 0.3.7 + pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov - pytest-mypy + pytest-mypy; python_implementation != "PyPy" + # jaraco/skeleton#22 + jaraco.test >= 3 # local From 38207546aea22e38433a316c6ad9bf024de61ef3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 8 Sep 2020 19:55:53 -0400 Subject: [PATCH 037/206] Bump black and blacken-docs to latest stable versions. --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe46b8c..6639c78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: 19.10b0 + rev: stable hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: v1.4.0 + rev: v1.8.0 hooks: - id: blacken-docs From 8117892ea5da9969f49756933bcbaa576ee7c5d7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Sep 2020 14:18:23 -0400 Subject: [PATCH 038/206] Use enabled plugin configuration to enable mypy and black when the plugin is present. Ref jaraco/skeleton#22. --- pyproject.toml | 8 ++++---- pytest.ini | 2 +- setup.cfg | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9b02ee7..9cd13ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,9 +8,9 @@ skip-string-normalization = true [tool.setuptools_scm] # jaraco/skeleton#22 -[tool.jaraco.pytest.opts.--black] -action = "store_true" +[tool.jaraco.pytest.plugins.black] +addopts = "--black" # jaraco/skeleton#22 -[tool.jaraco.pytest.opts.--mypy] -action = "store_true" +[tool.jaraco.pytest.plugins.mypy] +addopts = "--mypy" diff --git a/pytest.ini b/pytest.ini index 381b327..5ffd7f7 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules --flake8 --black --cov --mypy +addopts=--doctest-modules --flake8 --cov doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 diff --git a/setup.cfg b/setup.cfg index e9dd177..eb834fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ testing = pytest-cov pytest-mypy; python_implementation != "PyPy" # jaraco/skeleton#22 - jaraco.test >= 3 + jaraco.test >= 3.1.1 # local From 678e1a973a0139c0e0ab40395dfbada6c3ea72b9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Sep 2020 19:02:55 -0400 Subject: [PATCH 039/206] Also enable flake8 and cov when the plugins are present. --- pyproject.toml | 6 ++++++ pytest.ini | 2 +- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9cd13ba..79f088a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,3 +14,9 @@ addopts = "--black" # jaraco/skeleton#22 [tool.jaraco.pytest.plugins.mypy] addopts = "--mypy" + +[tool.jaraco.pytest.plugins.flake8] +addopts = "--flake8" + +[tool.jaraco.pytest.plugins.cov] +addopts = "--cov" diff --git a/pytest.ini b/pytest.ini index 5ffd7f7..d7f0b11 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules --flake8 --cov +addopts=--doctest-modules doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 diff --git a/setup.cfg b/setup.cfg index eb834fe..6321ca7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ testing = pytest-cov pytest-mypy; python_implementation != "PyPy" # jaraco/skeleton#22 - jaraco.test >= 3.1.1 + jaraco.test >= 3.2.0 # local From ea912cf6598bd882a723518eb5cc01f1c8397094 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Oct 2020 18:09:29 -0400 Subject: [PATCH 040/206] Add workflows for running tests. Ref jaraco/skeleton#24. --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a189798 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Main + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + python: [3.6, 3.7, 3.8] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox From ce34be2f7548dd68f74e5a0fb98f5b796b076900 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Oct 2020 19:55:49 -0400 Subject: [PATCH 041/206] Cut releases from Github Actions instead of Azure Pipelines. Ref jaraco/skeleton#24. --- .github/workflows/main.yml | 22 +++++++++++++++++++++- azure-pipelines.yml | 23 ----------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a189798..b3dd81f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Main +name: Automated Tests on: [push, pull_request] @@ -20,3 +20,23 @@ jobs: python -m pip install tox - name: Run tests run: tox + + release: + needs: test + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install tox + run: | + python -m pip install tox + - name: Release + run: tox -e release + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fdad0e5..6d31899 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -70,26 +70,3 @@ stages: testResultsFiles: '**/test-results.xml' testRunTitle: 'Python $(python.version)' condition: succeededOrFailed() - -- stage: Publish - dependsOn: Test - jobs: - - job: 'Publish' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.8' - architecture: 'x64' - - - script: python -m pip install tox - displayName: 'Install tox' - - - script: | - tox -e release - env: - TWINE_PASSWORD: $(PyPI-token) - GITHUB_TOKEN: $(Github-token) - displayName: 'publish to PyPI' - - condition: contains(variables['Build.SourceBranch'], 'tags') From dcd7cbda05754898cc9723c9b36e41a92cb3e139 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Oct 2020 06:12:09 -0400 Subject: [PATCH 042/206] Refresh docs to prefer Github Actions to Azure Pipelines. Ref jaraco/skeleton#24. --- skeleton.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/skeleton.md b/skeleton.md index 17a94ed..c6b0cd0 100644 --- a/skeleton.md +++ b/skeleton.md @@ -56,6 +56,7 @@ The features/techniques employed by the skeleton include: - A README.rst as reStructuredText with some popular badges, but with Read the Docs and AppVeyor badges commented out - A CHANGES.rst file intended for publishing release notes about the project - Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) +- Integrated type checking through [mypy](https://github.com/python/mypy/). ## Packaging Conventions @@ -109,9 +110,20 @@ Relies on a .flake8 file to correct some default behaviors: The project is pre-configured to run tests through multiple CI providers. +### Github Actions + +[Github Actions](https://docs.github.com/en/free-pro-team@latest/actions) are the preferred provider as they provide free, fast, multi-platform services with straightforward configuration. Configured in `.github/workflows`. + +Features include: +- test against multiple Python versions +- run on late (and updated) platform versions +- automated releases of tagged commits + ### Azure Pipelines -[Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) are the preferred provider as they provide free, fast, multi-platform services. See azure-pipelines.yml for more details. +[Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) were adopted for free, fast, multi-platform services. See azure-pipelines.yml for more details. + +Azure Pipelines require many [complicated setup steps](https://github.com/Azure/azure-devops-cli-extension/issues/968) that have not been readily automated. Features include: @@ -133,20 +145,13 @@ A minimal template for running under AppVeyor (Windows) is provided. ### Continuous Deployments -In addition to running tests, an additional deploy stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with Azure as the `Azure secrets` variable group. This variable group needs to be created only once per organization. For example: +In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: ``` -# create a resource group if none exists -az group create --name main --location eastus2 -# create the vault (try different names until something works) -az keyvault create --name secrets007 --resource-group main -# create the secret -az keyvault secret set --vault-name secrets007 --name PyPI-token --value $token +pip-run -q setuptools jaraco.develop -- -m jaraco.develop.add-github-secret PYPI_TOKEN $TOKEN --project org/repo ``` -Then, in the web UI for the project's Pipelines Library, create the `Azure secrets` variable group referencing the key vault name. - -For more details, see [this blog entry](https://blog.jaraco.com/configuring-azure-pipelines-with-secets/). + ## Building Documentation From 5474714ed2622af66674fafe62ae01180c0adf81 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Oct 2020 14:20:21 -0400 Subject: [PATCH 043/206] Use RTD v2 config --- .readthedocs.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 8ae4468..cc69854 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,5 +1,6 @@ +version: 2 python: - version: 3 - extra_requirements: - - docs - pip_install: true + install: + - path: . + extra_requirements: + - docs From 6ad08b8489ac1c1eba37d32525fa7fa8465076c9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 22 Oct 2020 14:08:14 -0400 Subject: [PATCH 044/206] Test on Python 3.9. Skip 3.7 to avoid creating too many builds. Release on 3.9. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3dd81f..8c5c232 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,13 +6,13 @@ jobs: test: strategy: matrix: - python: [3.6, 3.7, 3.8] + python: [3.6, 3.8, 3.9] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 - name: Setup Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - name: Install tox @@ -29,9 +29,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Setup Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Install tox run: | python -m pip install tox From ca9ad41aeb98be511d9451706a9e29dd5016df00 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 22 Oct 2020 14:09:25 -0400 Subject: [PATCH 045/206] Drop tests on Travis, Appveyor, and Azure Pipelines. --- .travis.yml | 19 ------------ README.rst | 11 ++----- appveyor.yml | 24 --------------- azure-pipelines.yml | 72 --------------------------------------------- skeleton.md | 26 +--------------- 5 files changed, 4 insertions(+), 148 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 azure-pipelines.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eed7b0a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -dist: bionic -language: python - -python: -- 3.6 -- &latest_py3 3.8 - -cache: pip - -install: -# ensure virtualenv is upgraded to avoid issues like jaraco/path#188 -- pip install -U --upgrade-strategy=eager tox - -before_script: - # Enable IPv6. Ref travis-ci/travis-ci#8361 - - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; - fi -script: tox diff --git a/README.rst b/README.rst index 4c7fd55..69554ef 100644 --- a/README.rst +++ b/README.rst @@ -6,18 +6,13 @@ .. _PyPI link: https://pypi.org/project/skeleton -.. image:: https://dev.azure.com/jaraco/skeleton/_apis/build/status/jaraco.skeleton?branchName=master - :target: https://dev.azure.com/jaraco/skeleton/_build/latest?definitionId=1&branchName=master - -.. image:: https://img.shields.io/travis/jaraco/skeleton/master.svg - :target: https://travis-ci.org/jaraco/skeleton +.. image:: https://github.com/jaraco/skeleton/workflows/Automated%20Tests/badge.svg + :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22Automated+Tests%22 + :alt: Automated Tests .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: Black -.. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg -.. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master - .. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest .. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c6f46e4..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,24 +0,0 @@ -environment: - - APPVEYOR: true - - matrix: - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python38-x64" - -install: - # symlink python from a directory with a space - - "mklink /d \"C:\\Program Files\\Python\" %PYTHON%" - - "SET PYTHON=\"C:\\Program Files\\Python\"" - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - -build: off - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -test_script: - - "python -m pip install -U tox virtualenv" - - "tox" - -version: '{build}' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6d31899..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Create the project in Azure with: -# az devops project create --name $name --organization https://dev.azure.com/$org/ --visibility public -# then configure the pipelines (through web UI) - -trigger: - branches: - include: - - '*' - tags: - include: - - '*' - -pool: - vmImage: $(pool_vm_image) - -variables: -- group: Azure secrets -- name: pool_vm_image - value: Ubuntu-18.04 - -stages: -- stage: Test - jobs: - - - job: 'Test' - strategy: - matrix: - Bionic Python 3.6: - python.version: '3.6' - Bionic Python 3.8: - python.version: '3.8' - Windows Python 3.8: - python.version: '3.8' - pool_vm_image: vs2017-win2016 - Windows Python Prerelease: - python.version: '3.9' - pool_vm_image: vs2017-win2016 - MacOS: - python.version: '3.8' - pool_vm_image: macos-10.15 - - maxParallel: 4 - - steps: - - task: NuGetToolInstaller@1 - displayName: 'Install NuGet' - condition: eq(variables['pool_vm_image'], 'vs2017-win2016') - - - powershell: | - nuget install python -Prerelease -OutputDirectory "$(Build.BinariesDirectory)" -ExcludeVersion -NonInteractive - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools" - Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)\python\tools\Scripts" - condition: and(succeeded(), and(eq(variables['python.version'], '3.9'), eq(variables['pool_vm_image'], 'vs2017-win2016'))) - - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - condition: and(succeeded(), ne(variables['python.version'], '3.9')) - - - script: python -m pip install tox - displayName: 'Install tox' - - - script: | - tox -- --junit-xml=test-results.xml - displayName: 'run tests' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/skeleton.md b/skeleton.md index c6b0cd0..7c3956c 100644 --- a/skeleton.md +++ b/skeleton.md @@ -108,7 +108,7 @@ Relies on a .flake8 file to correct some default behaviors: ## Continuous Integration -The project is pre-configured to run tests through multiple CI providers. +The project is pre-configured to run Continuous Integration tests. ### Github Actions @@ -119,30 +119,6 @@ Features include: - run on late (and updated) platform versions - automated releases of tagged commits -### Azure Pipelines - -[Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) were adopted for free, fast, multi-platform services. See azure-pipelines.yml for more details. - -Azure Pipelines require many [complicated setup steps](https://github.com/Azure/azure-devops-cli-extension/issues/968) that have not been readily automated. - -Features include: - -- test against multiple Python versions -- run on Ubuntu Bionic - -### Travis CI - -[Travis CI](https://travis-ci.org) is configured through .travis.yml. Any new project must be enabled either through their web site or with the `travis enable` command. - -Features include: -- test against Python 3 -- run on Ubuntu Bionic -- correct for broken IPv6 - -### AppVeyor - -A minimal template for running under AppVeyor (Windows) is provided. - ### Continuous Deployments In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: From 1311cecaad5e176eb7604a045d16dcd6c7353a45 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 23 Oct 2020 10:18:23 -0400 Subject: [PATCH 046/206] use add-github-secrets, which infers the secrets needed from the github workflow. --- skeleton.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/skeleton.md b/skeleton.md index 7c3956c..ec421c2 100644 --- a/skeleton.md +++ b/skeleton.md @@ -124,11 +124,9 @@ Features include: In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: ``` -pip-run -q setuptools jaraco.develop -- -m jaraco.develop.add-github-secret PYPI_TOKEN $TOKEN --project org/repo +pip-run -q jaraco.develop -- -m jaraco.develop.add-github-secrets ``` - - ## Building Documentation Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. From 95ce6f33cc095df6d0a5f239e075a610eefbe262 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 28 Oct 2020 20:58:20 -0400 Subject: [PATCH 047/206] Use inline flags with local scope. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 41b5355..433d185 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ url='{package_url}/issues/{issue}', ), dict( - pattern=r'^(?m)((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n', + pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( From 27f7c53a66c077cea17896496330bab97f1db54b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 19 Nov 2020 22:02:41 -0500 Subject: [PATCH 048/206] Honor TOX_WORK_DIR if set. Workaround for tox-dev/tox#20. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 7347d95..7233b94 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ envlist = python minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true +toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] From c681f6748acaea1bf0b706528c36327cc94a6eed Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 8 Dec 2020 16:29:09 -0500 Subject: [PATCH 049/206] Collapse skeleton history from archive/2020-12 --- .coveragerc | 5 ++ .flake8 | 9 +++ .github/workflows/main.yml | 42 +++++++++++ .pre-commit-config.yaml | 10 +++ .readthedocs.yml | 6 ++ CHANGES.rst | 0 LICENSE | 19 +++++ README.rst | 18 +++++ docs/conf.py | 26 +++++++ docs/history.rst | 8 +++ docs/index.rst | 22 ++++++ mypy.ini | 2 + pyproject.toml | 22 ++++++ pytest.ini | 9 +++ setup.cfg | 45 ++++++++++++ setup.py | 6 ++ skeleton.md | 144 +++++++++++++++++++++++++++++++++++++ tox.ini | 40 +++++++++++ 18 files changed, 433 insertions(+) create mode 100644 .coveragerc create mode 100644 .flake8 create mode 100644 .github/workflows/main.yml create mode 100644 .pre-commit-config.yaml create mode 100644 .readthedocs.yml create mode 100644 CHANGES.rst create mode 100644 LICENSE create mode 100644 README.rst create mode 100644 docs/conf.py create mode 100644 docs/history.rst create mode 100644 docs/index.rst create mode 100644 mypy.ini create mode 100644 pyproject.toml create mode 100644 pytest.ini create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 skeleton.md create mode 100644 tox.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..4582306 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,5 @@ +[run] +omit = .tox/* + +[report] +show_missing = True diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..790c109 --- /dev/null +++ b/.flake8 @@ -0,0 +1,9 @@ +[flake8] +max-line-length = 88 +ignore = + # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 + W503 + # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 + W504 + # Black creates whitespace before colon + E203 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8c5c232 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: Automated Tests + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + python: [3.6, 3.8, 3.9] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox + + release: + needs: test + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install tox + run: | + python -m pip install tox + - name: Release + run: tox -e release + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6639c78 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/psf/black + rev: stable + hooks: + - id: black + +- repo: https://github.com/asottile/blacken-docs + rev: v1.8.0 + hooks: + - id: blacken-docs diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..cc69854 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,6 @@ +version: 2 +python: + install: + - path: . + extra_requirements: + - docs diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..353924b --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright Jason R. Coombs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..69554ef --- /dev/null +++ b/README.rst @@ -0,0 +1,18 @@ +.. image:: https://img.shields.io/pypi/v/skeleton.svg + :target: `PyPI link`_ + +.. image:: https://img.shields.io/pypi/pyversions/skeleton.svg + :target: `PyPI link`_ + +.. _PyPI link: https://pypi.org/project/skeleton + +.. image:: https://github.com/jaraco/skeleton/workflows/Automated%20Tests/badge.svg + :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22Automated+Tests%22 + :alt: Automated Tests + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code style: Black + +.. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest +.. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..433d185 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker'] + +master_doc = "index" + +link_files = { + '../CHANGES.rst': dict( + using=dict(GH='https://github.com'), + replace=[ + dict( + pattern=r'(Issue #|\B#)(?P\d+)', + url='{package_url}/issues/{issue}', + ), + dict( + pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', + with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', + ), + dict( + pattern=r'PEP[- ](?P\d+)', + url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', + ), + ], + ) +} diff --git a/docs/history.rst b/docs/history.rst new file mode 100644 index 0000000..8e21750 --- /dev/null +++ b/docs/history.rst @@ -0,0 +1,8 @@ +:tocdepth: 2 + +.. _changes: + +History +******* + +.. include:: ../CHANGES (links).rst diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..d14131b --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,22 @@ +Welcome to skeleton documentation! +======================================== + +.. toctree:: + :maxdepth: 1 + + history + + +.. automodule:: skeleton + :members: + :undoc-members: + :show-inheritance: + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..976ba02 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..79f088a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.1"] +build-backend = "setuptools.build_meta" + +[tool.black] +skip-string-normalization = true + +[tool.setuptools_scm] + +# jaraco/skeleton#22 +[tool.jaraco.pytest.plugins.black] +addopts = "--black" + +# jaraco/skeleton#22 +[tool.jaraco.pytest.plugins.mypy] +addopts = "--mypy" + +[tool.jaraco.pytest.plugins.flake8] +addopts = "--flake8" + +[tool.jaraco.pytest.plugins.cov] +addopts = "--cov" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..d7f0b11 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,9 @@ +[pytest] +norecursedirs=dist build .tox .eggs +addopts=--doctest-modules +doctest_optionflags=ALLOW_UNICODE ELLIPSIS +# workaround for warning pytest-dev/pytest#6178 +junit_family=xunit2 +filterwarnings= + # https://github.com/pytest-dev/pytest/issues/6928 + ignore:direct construction of .*Item has been deprecated:DeprecationWarning diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..6321ca7 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,45 @@ +[metadata] +license_file = LICENSE +name = skeleton +author = Jason R. Coombs +author_email = jaraco@jaraco.com +description = skeleton +long_description = file:README.rst +url = https://github.com/jaraco/skeleton +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + +[options] +packages = find: +include_package_data = true +python_requires = >=3.6 +install_requires = +setup_requires = setuptools_scm[toml] >= 3.4.1 + +[options.extras_require] +testing = + # upstream + pytest >= 3.5, !=3.7.3 + pytest-checkdocs >= 1.2.3 + pytest-flake8 + pytest-black >= 0.3.7; python_implementation != "PyPy" + pytest-cov + pytest-mypy; python_implementation != "PyPy" + # jaraco/skeleton#22 + jaraco.test >= 3.2.0 + + # local + +docs = + # upstream + sphinx + jaraco.packaging >= 3.2 + rst.linker >= 1.9 + + # local + +[options.entry_points] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..bac24a4 --- /dev/null +++ b/setup.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import setuptools + +if __name__ == "__main__": + setuptools.setup() diff --git a/skeleton.md b/skeleton.md new file mode 100644 index 0000000..ec421c2 --- /dev/null +++ b/skeleton.md @@ -0,0 +1,144 @@ +# Overview + +This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. + +## An SCM-Managed Approach + +While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a Git repo capturing the evolution and culmination of these best practices. + +It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. + +The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. + +Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. + +# Usage + +## new projects + +To use skeleton for a new project, simply pull the skeleton into a new project: + +``` +$ git init my-new-project +$ cd my-new-project +$ git pull gh://jaraco/skeleton +``` + +Now customize the project to suit your individual project needs. + +## existing projects + +If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. + +``` +$ git merge skeleton --allow-unrelated-histories +``` + +The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. + +## Updating + +Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. + +For example, here's a session of the [path project](https://pypi.org/project/path) pulling non-conflicting changes from the skeleton: + + + +Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. + +# Features + +The features/techniques employed by the skeleton include: + +- PEP 517/518-based build relying on Setuptools as the build tool +- Setuptools declarative configuration using setup.cfg +- tox for running tests +- A README.rst as reStructuredText with some popular badges, but with Read the Docs and AppVeyor badges commented out +- A CHANGES.rst file intended for publishing release notes about the project +- Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) +- Integrated type checking through [mypy](https://github.com/python/mypy/). + +## Packaging Conventions + +A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on Setuptools (a minimum version compatible with setup.cfg declarative config). + +The setup.cfg file implements the following features: + +- Assumes universal wheel for release +- Advertises the project's LICENSE file (MIT by default) +- Reads the README.rst file into the long description +- Some common Trove classifiers +- Includes all packages discovered in the repo +- Data files in the package are also included (not just Python files) +- Declares the required Python versions +- Declares install requirements (empty by default) +- Declares setup requirements for legacy environments +- Supplies two 'extras': + - testing: requirements for running tests + - docs: requirements for building docs + - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts +- Placeholder for defining entry points + +Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: + +- derive the project version from SCM tags +- ensure that all files committed to the repo are automatically included in releases + +## Running Tests + +The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). + +Other environments (invoked with `tox -e {name}`) supplied include: + + - a `docs` environment to build the documentation + - a `release` environment to publish the package to PyPI + +A pytest.ini is included to define common options around running tests. In particular: + +- rely on default test discovery in the current directory +- avoid recursing into common directories not containing tests +- run doctests on modules and invoke Flake8 tests +- in doctests, allow Unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. +- filters out known warnings caused by libraries/functionality included by the skeleton + +Relies on a .flake8 file to correct some default behaviors: + +- disable mutually incompatible rules W503 and W504 +- support for Black format + +## Continuous Integration + +The project is pre-configured to run Continuous Integration tests. + +### Github Actions + +[Github Actions](https://docs.github.com/en/free-pro-team@latest/actions) are the preferred provider as they provide free, fast, multi-platform services with straightforward configuration. Configured in `.github/workflows`. + +Features include: +- test against multiple Python versions +- run on late (and updated) platform versions +- automated releases of tagged commits + +### Continuous Deployments + +In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: + +``` +pip-run -q jaraco.develop -- -m jaraco.develop.add-github-secrets +``` + +## Building Documentation + +Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. + +In addition to building the Sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. + +## Cutting releases + +By default, tagged commits are released through the continuous integration deploy stage. + +Releases may also be cut manually by invoking the tox environment `release` with the PyPI token set as the TWINE_PASSWORD: + +``` +TWINE_PASSWORD={token} tox -e release +``` diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..7233b94 --- /dev/null +++ b/tox.ini @@ -0,0 +1,40 @@ +[tox] +envlist = python +minversion = 3.2 +# https://github.com/jaraco/skeleton/issues/6 +tox_pip_extensions_ext_venv_update = true +toxworkdir={env:TOX_WORK_DIR:.tox} + + +[testenv] +deps = +commands = + pytest {posargs} +usedevelop = True +extras = testing + +[testenv:docs] +extras = + docs + testing +changedir = docs +commands = + python -m sphinx . {toxinidir}/build/html + +[testenv:release] +skip_install = True +deps = + pep517>=0.5 + twine[keyring]>=1.13 + path + jaraco.develop>=7.1 +passenv = + TWINE_PASSWORD + GITHUB_TOKEN +setenv = + TWINE_USERNAME = {env:TWINE_USERNAME:__token__} +commands = + python -c "import path; path.Path('dist').rmtree_p()" + python -m pep517.build . + python -m twine upload dist/* + python -m jaraco.develop.create-github-release From 2667241f44fed464948cbd140bed1b17cfe4e826 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Dec 2020 23:29:03 -0500 Subject: [PATCH 050/206] Update skeleton description to describe the periodic collapse. Fixes #27. --- skeleton.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/skeleton.md b/skeleton.md index ec421c2..dd8ec01 100644 --- a/skeleton.md +++ b/skeleton.md @@ -46,6 +46,26 @@ For example, here's a session of the [path project](https://pypi.org/project/pat Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. +## Periodic Collapse + +In late 2020, this project [introduced](https://github.com/jaraco/skeleton/issues/27) the idea of a periodic but infrequent (O(years)) collapse of commits to limit the number of commits a new consumer will need to accept to adopt the skeleton. + +The full history of commits is collapsed into a single commit and that commit becomes the new mainline head. + +When one of these collapse operations happens, any project that previously pulled from the skeleton will no longer have a related history with that new main branch. For those projects, the skeleton provides a "handoff" branch that reconciles the two branches. Any project that has previously merged with the skeleton but now gets an error "fatal: refusing to merge unrelated histories" should instead use the handoff branch once to incorporate the new main branch. + +``` +$ git pull https://github.com/jaraco/skeleton 2020-handoff +``` + +This handoff needs to be pulled just once and thereafter the project can pull from the main head. + +The archive and handoff branches from prior collapses are indicate here: + +| refresh | archive | handoff | +|---------|-----------------|--------------| +| 2020-12 | archive/2020-12 | 2020-handoff | + # Features The features/techniques employed by the skeleton include: From 150321caba0dc73489b61d6b5bbfbed52b795ae7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 13 Dec 2020 14:03:23 -0500 Subject: [PATCH 051/206] Enable automerge --- .github/workflows/automerge.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..4f70acf --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,27 @@ +name: automerge +on: + pull_request: + types: + - labeled + - unlabeled + - synchronize + - opened + - edited + - ready_for_review + - reopened + - unlocked + pull_request_review: + types: + - submitted + check_suite: + types: + - completed + status: {} +jobs: + automerge: + runs-on: ubuntu-latest + steps: + - name: automerge + uses: "pascalgn/automerge-action@v0.12.0" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 4b1334629e1cb254a1b6853f045f2615b79ec9e1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 29 Dec 2020 09:56:52 -0500 Subject: [PATCH 052/206] Automatically inject project name in docs heading. --- docs/index.rst | 4 ++-- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index d14131b..325842b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -Welcome to skeleton documentation! -======================================== +Welcome to |project| documentation! +=================================== .. toctree:: :maxdepth: 1 diff --git a/setup.cfg b/setup.cfg index 6321ca7..4fc095b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ testing = docs = # upstream sphinx - jaraco.packaging >= 3.2 + jaraco.packaging >= 8.2 rst.linker >= 1.9 # local From cfe99a5a7941f9f8785dd3ec12d1df94e9134411 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 29 Dec 2020 21:27:53 -0500 Subject: [PATCH 053/206] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6639c78..c15ab0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: stable + rev: 20.8b1 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: v1.8.0 + rev: v1.9.1 hooks: - id: blacken-docs From 060d491a9aaacfe457ad365cfd60b611fc9f5bcf Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 30 Dec 2020 10:57:25 -0500 Subject: [PATCH 054/206] Rename 'Automated Tests' to simply 'tests' --- .github/workflows/main.yml | 2 +- README.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c5c232..6a8ff00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Automated Tests +name: tests on: [push, pull_request] diff --git a/README.rst b/README.rst index 69554ef..128e61e 100644 --- a/README.rst +++ b/README.rst @@ -6,9 +6,9 @@ .. _PyPI link: https://pypi.org/project/skeleton -.. image:: https://github.com/jaraco/skeleton/workflows/Automated%20Tests/badge.svg - :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22Automated+Tests%22 - :alt: Automated Tests +.. image:: https://github.com/jaraco/skeleton/workflows/tests/badge.svg + :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22tests%22 + :alt: tests .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black From 2b839bad1c2189f4eeb0f74c4a2455ba6687741b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 30 Dec 2020 12:06:13 -0500 Subject: [PATCH 055/206] Add note about automatic merging of PRs and the requirements and limitations. --- skeleton.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skeleton.md b/skeleton.md index dd8ec01..0938f89 100644 --- a/skeleton.md +++ b/skeleton.md @@ -138,6 +138,8 @@ Features include: - test against multiple Python versions - run on late (and updated) platform versions - automated releases of tagged commits +- [automatic merging of PRs](https://github.com/marketplace/actions/merge-pull-requests) (requires [protecting branches with required status checks](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks), [not possible through API](https://github.community/t/set-all-status-checks-to-be-required-as-branch-protection-using-the-github-api/119493)) + ### Continuous Deployments From a36768aa363c8f7b54aae00e11f895ff06337532 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 30 Dec 2020 22:20:46 -0500 Subject: [PATCH 056/206] Prefer pytest-enabler to jaraco.test --- pyproject.toml | 10 ++++------ setup.cfg | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 79f088a..b6ebc0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,16 +7,14 @@ skip-string-normalization = true [tool.setuptools_scm] -# jaraco/skeleton#22 -[tool.jaraco.pytest.plugins.black] +[pytest.enabler.black] addopts = "--black" -# jaraco/skeleton#22 -[tool.jaraco.pytest.plugins.mypy] +[pytest.enabler.mypy] addopts = "--mypy" -[tool.jaraco.pytest.plugins.flake8] +[pytest.enabler.flake8] addopts = "--flake8" -[tool.jaraco.pytest.plugins.cov] +[pytest.enabler.cov] addopts = "--cov" diff --git a/setup.cfg b/setup.cfg index 4fc095b..d5010f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,8 +29,7 @@ testing = pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov pytest-mypy; python_implementation != "PyPy" - # jaraco/skeleton#22 - jaraco.test >= 3.2.0 + pytest-enabler # local From 3e876d7906fa6387ab6ac9a9bff8659762363017 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 8 Jan 2021 23:14:07 -0500 Subject: [PATCH 057/206] Enable complexity limit. Fixes jaraco/skeleton#34. --- .flake8 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.flake8 b/.flake8 index 790c109..59a51f8 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,9 @@ [flake8] max-line-length = 88 + +# jaraco/skeleton#34 +max-complexity = 10 + ignore = # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 W503 From 1731fbebe9f6655a203e6e08ab309f9916ea6f65 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 9 Jan 2021 05:21:12 +0100 Subject: [PATCH 058/206] Replace pep517.build with build (#37) * Replace pep517.build with build Resolves #30 * Prefer simple usage Co-authored-by: Jason R. Coombs --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 7233b94..249f97c 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ commands = [testenv:release] skip_install = True deps = - pep517>=0.5 + build twine[keyring]>=1.13 path jaraco.develop>=7.1 @@ -35,6 +35,6 @@ setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import path; path.Path('dist').rmtree_p()" - python -m pep517.build . + python -m build python -m twine upload dist/* python -m jaraco.develop.create-github-release From a9b3f681dea9728235c2a9c68165f7b5cbf350ab Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 9 Jan 2021 05:27:24 +0100 Subject: [PATCH 059/206] Use license_files instead of license_file in meta (#35) Singular `license_file` is deprecated since wheel v0.32.0. Refs: * https://wheel.readthedocs.io/en/stable/news.html * https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d5010f7..88bc263 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] -license_file = LICENSE +license_files = + LICENSE name = skeleton author = Jason R. Coombs author_email = jaraco@jaraco.com From 77fbe1df4af6d8f75f44440e89ee1bc249c9f2e0 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 9 Jan 2021 05:37:11 +0100 Subject: [PATCH 060/206] Use `extend-ignore` in flake8 config (#33) * Use `extend-ignore` in flake8 config This option allows to add extra ignored rules to the default list instead of replacing it. The default exclusions are: E121, E123, E126, E226, E24, E704, W503 and W504. Fixes #28. Refs: * https://github.com/pypa/setuptools/pull/2486/files#r541943356 * https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-ignore * https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore * Enable complexity limit. Fixes jaraco/skeleton#34. * Replace pep517.build with build (#37) * Replace pep517.build with build Resolves #30 * Prefer simple usage Co-authored-by: Jason R. Coombs * Use license_files instead of license_file in meta (#35) Singular `license_file` is deprecated since wheel v0.32.0. Refs: * https://wheel.readthedocs.io/en/stable/news.html * https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file Co-authored-by: Jason R. Coombs --- .flake8 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index 59a51f8..48b2e24 100644 --- a/.flake8 +++ b/.flake8 @@ -4,10 +4,6 @@ max-line-length = 88 # jaraco/skeleton#34 max-complexity = 10 -ignore = - # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 - W503 - # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 - W504 +extend-ignore = # Black creates whitespace before colon E203 From 0df40810ec54590c888ae0e4073d73f731c91f4a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 15 Jan 2021 19:16:28 -0500 Subject: [PATCH 061/206] Add support for namespace packages. Closes jaraco/skeleton#40. --- setup.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 88bc263..106763e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,12 +15,18 @@ classifiers = Programming Language :: Python :: 3 :: Only [options] -packages = find: +packages = find_namespace: include_package_data = true python_requires = >=3.6 install_requires = setup_requires = setuptools_scm[toml] >= 3.4.1 +[options.packages.find] +exclude = + build* + docs* + tests* + [options.extras_require] testing = # upstream From 51298a2cc4faa7253e9fe41d7a9574cf9aac997c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 9 Feb 2021 23:08:58 -0500 Subject: [PATCH 062/206] Normalize indentation --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 106763e..8df8d27 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,9 +23,9 @@ setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find] exclude = - build* - docs* - tests* + build* + docs* + tests* [options.extras_require] testing = From 743af7249d56e55a7c2c5f3111958ceee008d8ea Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 21 Feb 2021 13:04:46 -0500 Subject: [PATCH 063/206] Exclude dist from discovered packages. Fixes jaraco/skeleton#46. --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 8df8d27..af24641 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,7 @@ setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find] exclude = build* + dist* docs* tests* From 38fff62edb5e282f144dc77cc1bf5555367336d9 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Sat, 6 Feb 2021 23:03:13 +0300 Subject: [PATCH 064/206] Added an .editorconfig. Pull request jaraco/skeleton#43. --- .editorconfig | 15 +++++++++++++++ pytest.ini | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6385b57 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +insert_final_newline = true +end_of_line = lf + +[*.py] +indent_style = space + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/pytest.ini b/pytest.ini index d7f0b11..016063b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,5 +5,5 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= - # https://github.com/pytest-dev/pytest/issues/6928 - ignore:direct construction of .*Item has been deprecated:DeprecationWarning + # https://github.com/pytest-dev/pytest/issues/6928 + ignore:direct construction of .*Item has been deprecated:DeprecationWarning From 5e416793c008c5ef285c37828072fbea5ced6d08 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 21 Feb 2021 21:34:35 -0500 Subject: [PATCH 065/206] It's no longer necessary to filter this warning and it's not a warning anymore. --- pytest.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 016063b..6bf69af 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,5 +5,3 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= - # https://github.com/pytest-dev/pytest/issues/6928 - ignore:direct construction of .*Item has been deprecated:DeprecationWarning From d9a13c77ce2a3efea70c97d219ca4335c0f03c40 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 21 Feb 2021 21:36:53 -0500 Subject: [PATCH 066/206] Bump minimum pytest --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index af24641..81f70ee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ exclude = [options.extras_require] testing = # upstream - pytest >= 3.5, !=3.7.3 + pytest >= 4.6 pytest-checkdocs >= 1.2.3 pytest-flake8 pytest-black >= 0.3.7; python_implementation != "PyPy" From bf9fae2c0df316dc837d56ae68880620733d5ff6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 6 Mar 2021 09:57:43 -0500 Subject: [PATCH 067/206] Require twine 3 with keyring unconditionally required. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 249f97c..a9a50b0 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ commands = skip_install = True deps = build - twine[keyring]>=1.13 + twine>=3 path jaraco.develop>=7.1 passenv = From 7bdab57872da46ef6a5a7f5ea9099a197bdc3131 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Mar 2021 12:23:48 -0500 Subject: [PATCH 068/206] Add comments indicating why the exclusions are present --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 81f70ee..dd215c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,8 +34,10 @@ testing = pytest >= 4.6 pytest-checkdocs >= 1.2.3 pytest-flake8 + # python_implementation: workaround for jaraco/skeleton#22 pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov + # python_implementation: workaround for jaraco/skeleton#22 pytest-mypy; python_implementation != "PyPy" pytest-enabler From 14312a5bd75d3313ffd3e14fc7fbbc2a9b05cee5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Mar 2021 12:24:21 -0500 Subject: [PATCH 069/206] Exclude mypy on Python 3.10 as workaround for python/typed_ast#156. --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index dd215c6..55497f8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,8 @@ testing = pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov # python_implementation: workaround for jaraco/skeleton#22 - pytest-mypy; python_implementation != "PyPy" + # python_version: workaround for python/typed_ast#156 + pytest-mypy; python_implementation != "PyPy" and python_version < "3.10" pytest-enabler # local From af5445115af0cb68e671a678538a0207389586be Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Mar 2021 12:30:25 -0500 Subject: [PATCH 070/206] Bump minimums on pytest-checkdocs and pytest-enabler as found on Setuptools. --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 55497f8..3f6610b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ exclude = testing = # upstream pytest >= 4.6 - pytest-checkdocs >= 1.2.3 + pytest-checkdocs >= 2.4 pytest-flake8 # python_implementation: workaround for jaraco/skeleton#22 pytest-black >= 0.3.7; python_implementation != "PyPy" @@ -40,7 +40,7 @@ testing = # python_implementation: workaround for jaraco/skeleton#22 # python_version: workaround for python/typed_ast#156 pytest-mypy; python_implementation != "PyPy" and python_version < "3.10" - pytest-enabler + pytest-enabler >= 1.0.1 # local From 86efb884f805a9e1f64661ec758f3bd084fed515 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Mar 2021 12:53:54 -0500 Subject: [PATCH 071/206] Also deny black on Python 3.10 as workaround for python/typed_ast#156. --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3f6610b..52876d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,8 @@ testing = pytest-checkdocs >= 2.4 pytest-flake8 # python_implementation: workaround for jaraco/skeleton#22 - pytest-black >= 0.3.7; python_implementation != "PyPy" + # python_version: workaround for python/typed_ast#156 + pytest-black >= 0.3.7; python_implementation != "PyPy" and python_version < "3.10" pytest-cov # python_implementation: workaround for jaraco/skeleton#22 # python_version: workaround for python/typed_ast#156 From 7fe4ab8294a843622d20face7f9f6ccddb2d0a14 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 15 Mar 2021 18:31:04 -0400 Subject: [PATCH 072/206] Add leading */ to coverage.run.omit. Workaround for pytest-dev/pytest-cov#456. --- .coveragerc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 4582306..6a34e66 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,7 @@ [run] -omit = .tox/* +omit = + # leading `*/` for pytest-dev/pytest-cov#456 + */.tox/* [report] show_missing = True From 6e2d0ba00b60c10466b0e040e2d4b1206c3f0b3d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Apr 2021 20:38:58 -0400 Subject: [PATCH 073/206] Remove automerge. Fixes jaraco/skeleton#49. --- .github/workflows/automerge.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 4f70acf..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: automerge -on: - pull_request: - types: - - labeled - - unlabeled - - synchronize - - opened - - edited - - ready_for_review - - reopened - - unlocked - pull_request_review: - types: - - submitted - check_suite: - types: - - completed - status: {} -jobs: - automerge: - runs-on: ubuntu-latest - steps: - - name: automerge - uses: "pascalgn/automerge-action@v0.12.0" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 2f690f6083feea9a16ea3711f391d598a2ed1228 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Apr 2021 21:19:48 -0400 Subject: [PATCH 074/206] Enable dependabot (#50) * Added a config for dependabot. * Update features list for dependabot. Co-authored-by: KOLANICH --- .github/dependabot.yml | 8 ++++++++ skeleton.md | 1 + 2 files changed, 9 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..89ff339 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: "all" diff --git a/skeleton.md b/skeleton.md index 0938f89..af5f2ca 100644 --- a/skeleton.md +++ b/skeleton.md @@ -77,6 +77,7 @@ The features/techniques employed by the skeleton include: - A CHANGES.rst file intended for publishing release notes about the project - Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) - Integrated type checking through [mypy](https://github.com/python/mypy/). +- Dependabot enabled to enable supply chain security. ## Packaging Conventions From 6c1c45bc1ce8ab01d91324a46c584172664a0104 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Apr 2021 21:52:29 -0400 Subject: [PATCH 075/206] Replace md file with badge linking to documentation site. Fixes jaraco/skeleton#47. --- README.rst | 3 + skeleton.md | 167 ---------------------------------------------------- 2 files changed, 3 insertions(+), 167 deletions(-) delete mode 100644 skeleton.md diff --git a/README.rst b/README.rst index 128e61e..a3e1b74 100644 --- a/README.rst +++ b/README.rst @@ -16,3 +16,6 @@ .. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest .. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2021-informational + :target: https://blog.jaraco.com/skeleton diff --git a/skeleton.md b/skeleton.md deleted file mode 100644 index af5f2ca..0000000 --- a/skeleton.md +++ /dev/null @@ -1,167 +0,0 @@ -# Overview - -This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. - -## An SCM-Managed Approach - -While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a Git repo capturing the evolution and culmination of these best practices. - -It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. - -The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. - -Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5beab2d5) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. - -# Usage - -## new projects - -To use skeleton for a new project, simply pull the skeleton into a new project: - -``` -$ git init my-new-project -$ cd my-new-project -$ git pull gh://jaraco/skeleton -``` - -Now customize the project to suit your individual project needs. - -## existing projects - -If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. - -``` -$ git merge skeleton --allow-unrelated-histories -``` - -The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. - -## Updating - -Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar Git operations. - -For example, here's a session of the [path project](https://pypi.org/project/path) pulling non-conflicting changes from the skeleton: - - - -Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. - -## Periodic Collapse - -In late 2020, this project [introduced](https://github.com/jaraco/skeleton/issues/27) the idea of a periodic but infrequent (O(years)) collapse of commits to limit the number of commits a new consumer will need to accept to adopt the skeleton. - -The full history of commits is collapsed into a single commit and that commit becomes the new mainline head. - -When one of these collapse operations happens, any project that previously pulled from the skeleton will no longer have a related history with that new main branch. For those projects, the skeleton provides a "handoff" branch that reconciles the two branches. Any project that has previously merged with the skeleton but now gets an error "fatal: refusing to merge unrelated histories" should instead use the handoff branch once to incorporate the new main branch. - -``` -$ git pull https://github.com/jaraco/skeleton 2020-handoff -``` - -This handoff needs to be pulled just once and thereafter the project can pull from the main head. - -The archive and handoff branches from prior collapses are indicate here: - -| refresh | archive | handoff | -|---------|-----------------|--------------| -| 2020-12 | archive/2020-12 | 2020-handoff | - -# Features - -The features/techniques employed by the skeleton include: - -- PEP 517/518-based build relying on Setuptools as the build tool -- Setuptools declarative configuration using setup.cfg -- tox for running tests -- A README.rst as reStructuredText with some popular badges, but with Read the Docs and AppVeyor badges commented out -- A CHANGES.rst file intended for publishing release notes about the project -- Use of [Black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) -- Integrated type checking through [mypy](https://github.com/python/mypy/). -- Dependabot enabled to enable supply chain security. - -## Packaging Conventions - -A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on Setuptools (a minimum version compatible with setup.cfg declarative config). - -The setup.cfg file implements the following features: - -- Assumes universal wheel for release -- Advertises the project's LICENSE file (MIT by default) -- Reads the README.rst file into the long description -- Some common Trove classifiers -- Includes all packages discovered in the repo -- Data files in the package are also included (not just Python files) -- Declares the required Python versions -- Declares install requirements (empty by default) -- Declares setup requirements for legacy environments -- Supplies two 'extras': - - testing: requirements for running tests - - docs: requirements for building docs - - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts -- Placeholder for defining entry points - -Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: - -- derive the project version from SCM tags -- ensure that all files committed to the repo are automatically included in releases - -## Running Tests - -The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). - -Other environments (invoked with `tox -e {name}`) supplied include: - - - a `docs` environment to build the documentation - - a `release` environment to publish the package to PyPI - -A pytest.ini is included to define common options around running tests. In particular: - -- rely on default test discovery in the current directory -- avoid recursing into common directories not containing tests -- run doctests on modules and invoke Flake8 tests -- in doctests, allow Unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. -- filters out known warnings caused by libraries/functionality included by the skeleton - -Relies on a .flake8 file to correct some default behaviors: - -- disable mutually incompatible rules W503 and W504 -- support for Black format - -## Continuous Integration - -The project is pre-configured to run Continuous Integration tests. - -### Github Actions - -[Github Actions](https://docs.github.com/en/free-pro-team@latest/actions) are the preferred provider as they provide free, fast, multi-platform services with straightforward configuration. Configured in `.github/workflows`. - -Features include: -- test against multiple Python versions -- run on late (and updated) platform versions -- automated releases of tagged commits -- [automatic merging of PRs](https://github.com/marketplace/actions/merge-pull-requests) (requires [protecting branches with required status checks](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks), [not possible through API](https://github.community/t/set-all-status-checks-to-be-required-as-branch-protection-using-the-github-api/119493)) - - -### Continuous Deployments - -In addition to running tests, an additional publish stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with each Github project (or org) `PYPI_TOKEN` [secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets). Example: - -``` -pip-run -q jaraco.develop -- -m jaraco.develop.add-github-secrets -``` - -## Building Documentation - -Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. - -In addition to building the Sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. - -## Cutting releases - -By default, tagged commits are released through the continuous integration deploy stage. - -Releases may also be cut manually by invoking the tox environment `release` with the PyPI token set as the TWINE_PASSWORD: - -``` -TWINE_PASSWORD={token} tox -e release -``` From 8698127dbd17b47d1d07e35bee3725fecb69670b Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 26 Apr 2021 04:10:20 +0200 Subject: [PATCH 076/206] Make sphinx fail on any warnings (#36) This change adds `nitpicky=True` (which is an equivalent of `-n`) to make Sphinx emit warnings for any references to non-existing targets. Then, it adds `-W` to make it fail whenever a single warning is seen. Finally, `--keep-going` allows Sphinx to print out all the warnings before exiting instead of showing just one and bailing. Resolves #29 Refs: * https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-n * https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-W * https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-keep-going --- docs/conf.py | 3 +++ tox.ini | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 433d185..f65d1fa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,3 +24,6 @@ ], ) } + +# Be strict about any broken references: +nitpicky = True diff --git a/tox.ini b/tox.ini index a9a50b0..6984890 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ extras = testing changedir = docs commands = - python -m sphinx . {toxinidir}/build/html + python -m sphinx -W --keep-going . {toxinidir}/build/html [testenv:release] skip_install = True From 4a734d4841b0ad5fddad3c2524e512f608c82d74 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 20 May 2021 14:01:53 -0400 Subject: [PATCH 077/206] Test on Python 3.10 --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a8ff00..7d6b455 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,10 @@ jobs: test: strategy: matrix: - python: [3.6, 3.8, 3.9] + python: + - 3.6 + - 3.9 + - 3.10.0-alpha - 3.10.99 platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: From 1b165200642e74a4c2acebf7fedb28e732a17881 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 26 May 2021 10:40:46 -0400 Subject: [PATCH 078/206] Remove setup_requires, obviated by build-requires in pyproject.toml. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 52876d5..e768c6b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,6 @@ packages = find_namespace: include_package_data = true python_requires = >=3.6 install_requires = -setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find] exclude = From 85d08db3ef3811bd208995254e7e9c9658cf710d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 3 Jun 2021 19:55:51 -0400 Subject: [PATCH 079/206] Suppress deprecation warnings in flake8 and packaging.tags. Ref pypa/packaging#433. --- pytest.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pytest.ini b/pytest.ini index 6bf69af..31b114f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,3 +5,7 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= + # Suppress deprecation warning in flake8 + ignore:SelectableGroups dict interface is deprecated::flake8 + # Suppress deprecation warning in pypa/packaging#433 + ignore:The distutils package is deprecated::packaging.tags From 5a8384e53c59a886f982739c02572732afa76c7f Mon Sep 17 00:00:00 2001 From: Brian Rutledge Date: Sat, 12 Jun 2021 10:10:07 -0400 Subject: [PATCH 080/206] Use shutil for rmtree --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 6984890..3ca2af3 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,6 @@ skip_install = True deps = build twine>=3 - path jaraco.develop>=7.1 passenv = TWINE_PASSWORD @@ -34,7 +33,7 @@ passenv = setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = - python -c "import path; path.Path('dist').rmtree_p()" + python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)" python -m build python -m twine upload dist/* python -m jaraco.develop.create-github-release From 14787e69e793d68c8ac17f010dc45891ee0a492c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 16 Jul 2021 09:03:21 -0400 Subject: [PATCH 081/206] Rely on setuptools 56 and drop the explicit mention of the license file in favor of simple discovery. --- pyproject.toml | 2 +- setup.cfg | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b6ebc0b..28bd788 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.1"] +requires = ["setuptools>=56", "wheel", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] diff --git a/setup.cfg b/setup.cfg index e768c6b..53387b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,4 @@ [metadata] -license_files = - LICENSE name = skeleton author = Jason R. Coombs author_email = jaraco@jaraco.com From 212e995cd366010a8c372ea2fedfbb8be471e5cb Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 16 Jul 2021 09:07:59 -0400 Subject: [PATCH 082/206] Remove workaround for python/typed_ast#156. --- setup.cfg | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 53387b6..80fd268 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,12 +32,10 @@ testing = pytest-checkdocs >= 2.4 pytest-flake8 # python_implementation: workaround for jaraco/skeleton#22 - # python_version: workaround for python/typed_ast#156 - pytest-black >= 0.3.7; python_implementation != "PyPy" and python_version < "3.10" + pytest-black >= 0.3.7; python_implementation != "PyPy" pytest-cov # python_implementation: workaround for jaraco/skeleton#22 - # python_version: workaround for python/typed_ast#156 - pytest-mypy; python_implementation != "PyPy" and python_version < "3.10" + pytest-mypy; python_implementation != "PyPy" pytest-enabler >= 1.0.1 # local From 498b965a805224420c8cde5969bf342a41766227 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 16 Jul 2021 09:19:05 -0400 Subject: [PATCH 083/206] Use line continuations to indicate which exclusions are for which workarounds. --- setup.cfg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 80fd268..69eb0ee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,11 +31,13 @@ testing = pytest >= 4.6 pytest-checkdocs >= 2.4 pytest-flake8 - # python_implementation: workaround for jaraco/skeleton#22 - pytest-black >= 0.3.7; python_implementation != "PyPy" + pytest-black >= 0.3.7; \ + # workaround for jaraco/skeleton#22 + python_implementation != "PyPy" pytest-cov - # python_implementation: workaround for jaraco/skeleton#22 - pytest-mypy; python_implementation != "PyPy" + pytest-mypy; \ + # workaround for jaraco/skeleton#22 + python_implementation != "PyPy" pytest-enabler >= 1.0.1 # local From 719a7ced8a1713b7fe94d842a8f6fec7425b8a0a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 21 Jul 2021 17:33:29 -0400 Subject: [PATCH 084/206] Remove blacken docs as it cannot honor Python's default repr. Ref asottile/blacken-docs#62. --- .pre-commit-config.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c15ab0c..f66bf56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,3 @@ repos: rev: 20.8b1 hooks: - id: black - -- repo: https://github.com/asottile/blacken-docs - rev: v1.9.1 - hooks: - - id: blacken-docs From a76a548d0f25947d2594d36b784d029a6ada977f Mon Sep 17 00:00:00 2001 From: Alan Fregtman <941331+darkvertex@users.noreply.github.com> Date: Mon, 26 Jul 2021 10:55:08 -0400 Subject: [PATCH 085/206] .editorconfig: Set max_line_length to 88 for Python files. --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 6385b57..b8aeea1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,7 @@ end_of_line = lf [*.py] indent_style = space +max_line_length = 88 [*.{yml,yaml}] indent_style = space From 8ea55f2fb26bd77997f0e9435bab2d41376a76d4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 17 Sep 2021 21:23:38 -0400 Subject: [PATCH 086/206] Add intersphinx mappings for Python to prevent spurious nitpicky failures. Fixes jaraco/skeleton#51. --- docs/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index f65d1fa..4ae7409 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,3 +27,10 @@ # Be strict about any broken references: nitpicky = True + +# Include Python intersphinx mapping to prevent failures +# jaraco/skeleton#51 +extensions += ['sphinx.ext.intersphinx'] +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), +} From dc43378c8accd85321b42e3fe69fcb87e5266006 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 5 Oct 2021 22:45:21 -0400 Subject: [PATCH 087/206] Test on Python 3.10 (final). --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7d6b455..6aad7f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,8 +9,11 @@ jobs: python: - 3.6 - 3.9 - - 3.10.0-alpha - 3.10.99 - platform: [ubuntu-latest, macos-latest, windows-latest] + - "3.10" + platform: + - ubuntu-latest + - macos-latest + - windows-latest runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 @@ -34,7 +37,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Install tox run: | python -m pip install tox From 5823e9ca9d242b733a5ff3c8e2c22e13ec0a4c01 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 7 Oct 2021 19:52:04 -0400 Subject: [PATCH 088/206] Rely on pytest 6 and drop workaround for pytest-dev/pytest#6178. --- pytest.ini | 2 -- setup.cfg | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pytest.ini b/pytest.ini index 31b114f..9ecdba4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,8 +2,6 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules doctest_optionflags=ALLOW_UNICODE ELLIPSIS -# workaround for warning pytest-dev/pytest#6178 -junit_family=xunit2 filterwarnings= # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 diff --git a/setup.cfg b/setup.cfg index 69eb0ee..0f7d652 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ exclude = [options.extras_require] testing = # upstream - pytest >= 4.6 + pytest >= 6 pytest-checkdocs >= 2.4 pytest-flake8 pytest-black >= 0.3.7; \ From aae281a9ff6c9a1fa9daad82c79457e8770a1c7e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 22 Oct 2021 14:19:58 -0400 Subject: [PATCH 089/206] Remove wheel from build requirements. It's implied for wheel builds. Ref pypa/setuptools#1498. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 28bd788..190b355 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=56", "wheel", "setuptools_scm[toml]>=3.4.1"] +requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] From 0019b0af43b9e381e2f0b14753d1bf40ce204490 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Nov 2021 20:08:49 -0500 Subject: [PATCH 090/206] Require Python 3.7 or later. --- .github/workflows/main.yml | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6aad7f1..5424298 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: python: - - 3.6 + - 3.7 - 3.9 - "3.10" platform: diff --git a/setup.cfg b/setup.cfg index 0f7d652..bd1da7a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ classifiers = [options] packages = find_namespace: include_package_data = true -python_requires = >=3.6 +python_requires = >=3.7 install_requires = [options.packages.find] From eca1c4ca6e104c8add280c721cbb365196f55ac7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Nov 2021 20:38:46 -0500 Subject: [PATCH 091/206] Remove filtered warnings, addressed upstream. --- pytest.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 9ecdba4..ec965b2 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,5 +5,3 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 - # Suppress deprecation warning in pypa/packaging#433 - ignore:The distutils package is deprecated::packaging.tags From 4f9825dafa8d13a5f8b8bd8eb8bfc6414329cb18 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 1 Feb 2022 04:09:17 -0500 Subject: [PATCH 092/206] Update badge year --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a3e1b74..c82c642 100644 --- a/README.rst +++ b/README.rst @@ -17,5 +17,5 @@ .. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest .. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2021-informational +.. image:: https://img.shields.io/badge/skeleton-2022-informational :target: https://blog.jaraco.com/skeleton From 7e01b721c237ee4947e3b9d6e56bb03a028f3f6a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 1 Feb 2022 04:11:54 -0500 Subject: [PATCH 093/206] Remove setup.py, no longer needed. --- setup.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index bac24a4..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import setuptools - -if __name__ == "__main__": - setuptools.setup() From 8949d1a1169c9271ceb8aab3f1deea9d82e2fa0d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 4 Feb 2022 21:45:52 -0500 Subject: [PATCH 094/206] Add exclusions for pytest 7 deprecations in plugins. Fixes jaraco/skeleton#57. --- pytest.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pytest.ini b/pytest.ini index ec965b2..52f19be 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,3 +5,14 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 + + # shopkeep/pytest-black#55 + ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestRemovedIn8Warning + + # tholo/pytest-flake8#83 + ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestRemovedIn8Warning + + # dbader/pytest-mypy#131 + ignore:The \(fspath. py.path.local\) argument to MypyFile is deprecated.:pytest.PytestRemovedIn8Warning From badffe9af9b79dff781f6768bcf48fbd8abd0945 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 5 Feb 2022 14:29:09 -0500 Subject: [PATCH 095/206] Use the parent category PytestDeprecationWarning, which is available on older pytest versions. Fixes jaraco/skeleton#57. --- pytest.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pytest.ini b/pytest.ini index 52f19be..cbbe3b1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -8,11 +8,11 @@ filterwarnings= # shopkeep/pytest-black#55 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning - ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestRemovedIn8Warning + ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning # tholo/pytest-flake8#83 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning - ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestRemovedIn8Warning + ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning # dbader/pytest-mypy#131 - ignore:The \(fspath. py.path.local\) argument to MypyFile is deprecated.:pytest.PytestRemovedIn8Warning + ignore:The \(fspath. py.path.local\) argument to MypyFile is deprecated.:pytest.PytestDeprecationWarning From 96ea56305df99a3c13334d42ea45f779cab2c505 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 10 Feb 2022 20:36:16 -0500 Subject: [PATCH 096/206] Bump pytest-mypy and remove workaround for dbader/pytest-mypy#131. --- pytest.ini | 3 --- setup.cfg | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pytest.ini b/pytest.ini index cbbe3b1..b6880c8 100644 --- a/pytest.ini +++ b/pytest.ini @@ -13,6 +13,3 @@ filterwarnings= # tholo/pytest-flake8#83 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning - - # dbader/pytest-mypy#131 - ignore:The \(fspath. py.path.local\) argument to MypyFile is deprecated.:pytest.PytestDeprecationWarning diff --git a/setup.cfg b/setup.cfg index bd1da7a..1b048af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ testing = # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-cov - pytest-mypy; \ + pytest-mypy >= 0.9.1; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-enabler >= 1.0.1 From a9ea801a43fc62a569cf60e1c28e477ba510d8a0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 10 Feb 2022 21:58:57 -0500 Subject: [PATCH 097/206] Require jaraco.packaging 9 adding compatibility for projects with no setup.py file. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 1b048af..3b7ac30 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ testing = docs = # upstream sphinx - jaraco.packaging >= 8.2 + jaraco.packaging >= 9 rst.linker >= 1.9 # local From f22eb5b60adbe158e458614ea0380a9071c39347 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Sat, 12 Feb 2022 09:50:31 +0000 Subject: [PATCH 098/206] Ignore flake8/black warnings with pytest 7.0.1 (jaraco/skeleton#58) --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index b6880c8..80e98cc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -9,7 +9,9 @@ filterwarnings= # shopkeep/pytest-black#55 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning + ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning # tholo/pytest-flake8#83 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning + ignore:Flake8Item is an Item subclass and should not be a collector:pytest.PytestWarning From 04fe68a96ee8e3d3ca521b4abbfe53203063f9d9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 19 Feb 2022 21:14:39 -0500 Subject: [PATCH 099/206] Ran pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f66bf56..edf6f55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.1.0 hooks: - id: black From 1a6b828304e7a8896b55d9ebf83f481ba7ebd568 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 22 Apr 2022 17:43:46 +0200 Subject: [PATCH 100/206] Inject check job into CI workflow as ultimate flag (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a job that is able to accurately signal whether all the expectations of the required jobs to succeed are met. This job can then be used as a source of truth for judging whether "CI passes" and can be used in the branch protection. It also plays a role of a convenient "gate" — this is the only job that would have to be listed in the branch protection as opposed to listing every single job name generated by the test matrix (and they all have different names — it's not possible to just select one `test` job name). Ref: https://github.com/re-actors/alls-green#why --- .github/workflows/main.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5424298..b54fd6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,23 @@ jobs: - name: Run tests run: tox + check: # This job does nothing and is only used for the branch protection + if: always() + + needs: + - test + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + release: - needs: test + needs: + - check if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest From 10bf1b1fb9e09e9836bea9e2edec620cd9eea7f9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 4 Jun 2022 21:37:40 -0400 Subject: [PATCH 101/206] Add Python 3.11 into the matrix using workaround from actions/setup-python#213. Drop 3.9 from matrix for efficiency. --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b54fd6a..6468ee0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,9 +7,11 @@ jobs: strategy: matrix: python: - - 3.7 - - 3.9 - - "3.10" + # Build on pre-releases until stable, then stable releases. + # actions/setup-python#213 + - ~3.7.0-0 + - ~3.10.0-0 + - ~3.11.0-0 platform: - ubuntu-latest - macos-latest From a4f5b769793af19f7b858816889c1bf026f55f5c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 5 Jun 2022 04:47:15 +0300 Subject: [PATCH 102/206] Update base URL for PEPs (#61) --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 4ae7409..319b138 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,7 @@ ), dict( pattern=r'PEP[- ](?P\d+)', - url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', + url='https://peps.python.org/pep-{pep_number:0>4}/', ), ], ) From 74f337fec4c233b3a6750fa64b61d03c189d9416 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Sun, 5 Jun 2022 02:50:24 +0100 Subject: [PATCH 103/206] Update Github actions to v3 (#62) --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6468ee0..948da05 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,9 +18,9 @@ jobs: - windows-latest runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} - name: Install tox @@ -50,9 +50,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.10" - name: Install tox From e719f86c138a750f0c4599cd01cb8067b1ca95c8 Mon Sep 17 00:00:00 2001 From: wim glenn Date: Sun, 5 Jun 2022 15:01:02 -0500 Subject: [PATCH 104/206] exclude build env from cov reporting (#60) * Update .coveragerc * Keep whitespace consistent. Co-authored-by: Jason R. Coombs --- .coveragerc | 1 + 1 file changed, 1 insertion(+) diff --git a/.coveragerc b/.coveragerc index 6a34e66..01164f6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,6 +2,7 @@ omit = # leading `*/` for pytest-dev/pytest-cov#456 */.tox/* + */pep517-build-env-* [report] show_missing = True From 6dcd157a7057ec8e1f1f6afebe2115f55df4aaed Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 15 Jun 2022 20:57:40 -0400 Subject: [PATCH 105/206] Prefer spaces for rst. Fixes jaraco/skeleton#64. --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index b8aeea1..304196f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,6 @@ max_line_length = 88 [*.{yml,yaml}] indent_style = space indent_size = 2 + +[*.rst] +indent_style = space From 2678a7e82d581c07691575d90cd255b64ee63a27 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 22 Jun 2022 15:56:54 -0400 Subject: [PATCH 106/206] Honor PEP 518 with pytest-enabler. --- pyproject.toml | 8 ++++---- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 190b355..60de242 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,14 @@ skip-string-normalization = true [tool.setuptools_scm] -[pytest.enabler.black] +[tool.pytest-enabler.black] addopts = "--black" -[pytest.enabler.mypy] +[tool.pytest-enabler.mypy] addopts = "--mypy" -[pytest.enabler.flake8] +[tool.pytest-enabler.flake8] addopts = "--flake8" -[pytest.enabler.cov] +[tool.pytest-enabler.cov] addopts = "--cov" diff --git a/setup.cfg b/setup.cfg index 3b7ac30..baa37e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ testing = pytest-mypy >= 0.9.1; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" - pytest-enabler >= 1.0.1 + pytest-enabler >= 1.3 # local From fea1e7cdd57d330f22ac54512ae2df19083c6ec7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 11 Jul 2022 18:53:07 -0400 Subject: [PATCH 107/206] Ran pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edf6f55..af50201 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.6.0 hooks: - id: black From 325916c8240b8b3c7c41f24b664ca591e8555ea9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Jul 2022 10:12:46 -0400 Subject: [PATCH 108/206] Use '-dev' for every Python version. Ref actions/setup-python#213. --- .github/workflows/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 948da05..de49ba8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,11 +7,9 @@ jobs: strategy: matrix: python: - # Build on pre-releases until stable, then stable releases. - # actions/setup-python#213 - - ~3.7.0-0 - - ~3.10.0-0 - - ~3.11.0-0 + - 3.7 + - '3.10' + - '3.11' platform: - ubuntu-latest - macos-latest @@ -22,7 +20,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.python }}-dev - name: Install tox run: | python -m pip install tox From 424717b9e9f7c66379e809eb4e35daae827a1533 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Jul 2022 10:18:19 -0400 Subject: [PATCH 109/206] Use Python 3.11 for cutting releases. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de49ba8..3ce62d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.11-dev" - name: Install tox run: | python -m pip install tox From c64902b8cafa8062398ef173278a21b042b03a77 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 30 Jul 2022 19:26:15 -0400 Subject: [PATCH 110/206] Pin flake8. Workaround for tholo/pytest-flake8#87. --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index baa37e5..1ab9350 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,6 +31,8 @@ testing = pytest >= 6 pytest-checkdocs >= 2.4 pytest-flake8 + # workaround for tholo/pytest-flake8#87 + flake8 < 5 pytest-black >= 0.3.7; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" From abcc15683d3abe229a0e0d07f1afa05a24e2ef8c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 18 Aug 2022 16:06:12 -0400 Subject: [PATCH 111/206] Update to setup-python v4. Fixes jaraco/skeleton#65. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ce62d9..d17b64d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }}-dev - name: Install tox From 47c2cb324e20f784289496ef3a7b19a1cd23d196 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 18 Aug 2022 21:42:40 -0400 Subject: [PATCH 112/206] Also update release to v4 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d17b64d..63fa1e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.11-dev" - name: Install tox From 27c55340e745741773e875402d20ecbb7fade521 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Sep 2022 08:31:09 -0400 Subject: [PATCH 113/206] Add PyPy to the test matrix on Linux. Fixes jaraco/skeleton#63. Adds a 'dev' factor to the matrix as workaround for actions/setup-python#508. --- .github/workflows/main.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63fa1e8..46e1ec9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,20 +7,26 @@ jobs: strategy: matrix: python: - - 3.7 - - '3.10' - - '3.11' + - "3.7" + - "3.10" + - "3.11" + # Workaround for actions/setup-python#508 + dev: + - -dev platform: - ubuntu-latest - macos-latest - windows-latest + include: + - python: pypy3.9 + platform: ubuntu-latest runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python }}-dev + python-version: ${{ matrix.python }}${{ matrix.dev }} - name: Install tox run: | python -m pip install tox @@ -52,7 +58,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.11-dev" + python-version: 3.11-dev - name: Install tox run: | python -m pip install tox From b4f0ae621594316e56cede2856b6a5be605a893c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Sep 2022 08:46:38 -0400 Subject: [PATCH 114/206] When rendering docs, preserve the syntax for defaults. Fixes jaraco/path#197. Incidentally, re-organize the extensions a bit for clarity. --- docs/conf.py | 12 ++++++++++-- setup.cfg | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 319b138..9fef70a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,10 +1,15 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker'] +extensions = [ + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', +] master_doc = "index" +# Link dates and other references in the changelog +extensions += ['rst.linker'] link_files = { '../CHANGES.rst': dict( using=dict(GH='https://github.com'), @@ -25,7 +30,7 @@ ) } -# Be strict about any broken references: +# Be strict about any broken references nitpicky = True # Include Python intersphinx mapping to prevent failures @@ -34,3 +39,6 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), } + +# Preserve authored syntax for defaults +autodoc_preserve_defaults = True diff --git a/setup.cfg b/setup.cfg index 1ab9350..1d2be99 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,7 @@ testing = docs = # upstream - sphinx + sphinx >= 3.5 jaraco.packaging >= 9 rst.linker >= 1.9 From 679eebb215c80c7376a1df02c77fd368347620b0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 30 Sep 2022 12:41:25 -0400 Subject: [PATCH 115/206] Adopt furo theme for docs. --- docs/conf.py | 1 + setup.cfg | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 9fef70a..fa741a8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,6 +7,7 @@ ] master_doc = "index" +html_theme = "furo" # Link dates and other references in the changelog extensions += ['rst.linker'] diff --git a/setup.cfg b/setup.cfg index 1d2be99..a0d86eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,6 +49,7 @@ docs = sphinx >= 3.5 jaraco.packaging >= 9 rst.linker >= 1.9 + furo # local From b2412262dc1dd5d3d697e551d86acee4d5519bb6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 30 Sep 2022 13:30:09 -0400 Subject: [PATCH 116/206] Indicate to use latest Python version (workaround for readthedocs/readthedocs.org/#9623). Requires also specifying the OS version (workaround for readthedocs/readthedocs.org#9635). --- .readthedocs.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index cc69854..6bef349 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,3 +4,10 @@ python: - path: . extra_requirements: - docs + +# workaround for readthedocs/readthedocs.org#9623 +build: + # workaround for readthedocs/readthedocs.org#9635 + os: ubuntu-22.04 + tools: + python: "3" From e95c54fe607aaa980a064b6490312483381ba0ab Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 9 Oct 2022 11:35:13 -0400 Subject: [PATCH 117/206] GHA pretty env (#67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🎨 Make the GHA log is clean and colorized This patch sets up root-level environment variables shared by all the workflow jobs. They include: * Disabling undesired `pip`'s warnings/suggestions * Requesting the executed apps color their output unconditionally * Letting `tox` pass those requests to underlying/wrapped programs * Reformat without end of line comments. Group into sections. * Avoid numerics for booleans where possible. Choose arbitrary numeric where any numeric is accepted. Co-authored-by: Sviatoslav Sydorenko --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46e1ec9..102e0e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,36 @@ name: tests on: [push, pull_request] +env: + # Environment variables to support color support (jaraco/skeleton#66): + # Request colored output from CLI tools supporting it. Different tools + # interpret the value differently. For some, just being set is sufficient. + # For others, it must be a non-zero integer. For yet others, being set + # to a non-empty value is sufficient. + FORCE_COLOR: -106 + # MyPy's color enforcement (must be a non-zero number) + MYPY_FORCE_COLOR: -42 + # Recognized by the `py` package, dependency of `pytest` (must be "1") + PY_COLORS: 1 + # Make tox-wrapped tools see color requests + TOX_TESTENV_PASSENV: >- + FORCE_COLOR + MYPY_FORCE_COLOR + NO_COLOR + PY_COLORS + PYTEST_THEME + PYTEST_THEME_MODE + + # Suppress noisy pip warnings + PIP_DISABLE_PIP_VERSION_CHECK: 'true' + PIP_NO_PYTHON_VERSION_WARNING: 'true' + PIP_NO_WARN_SCRIPT_LOCATION: 'true' + + # Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream + # Must be "1". + TOX_PARALLEL_NO_SPINNER: 1 + + jobs: test: strategy: From 54675240d4b4d2452a3777c5156f688e42a6c985 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 13 Oct 2022 15:00:05 -0400 Subject: [PATCH 118/206] rename `.readthedocs.yml` to `.readthedocs.yaml` (RTD docs indicate that `.readthedocs.yml` will be deprecated) (#68) --- .readthedocs.yml => .readthedocs.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .readthedocs.yml => .readthedocs.yaml (100%) diff --git a/.readthedocs.yml b/.readthedocs.yaml similarity index 100% rename from .readthedocs.yml rename to .readthedocs.yaml From da84e5c7dabacf379165a0829b2f1741060ee2c6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 8 Nov 2022 05:25:30 -0500 Subject: [PATCH 119/206] Pin mypy to '<0.990' due to realpython/pytest-mypy#141 --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index a0d86eb..503cbfd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,8 @@ testing = pytest-mypy >= 0.9.1; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" + # workaround for realpython/pytest-mypy#141 + mypy < 0.990 pytest-enabler >= 1.3 # local From f999a531587170b577da64d4bfb67a68b9aec106 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 21 Oct 2022 11:14:42 -0400 Subject: [PATCH 120/206] Remove the hyperlink for the Python versions badge. The PyPI badge is a better anchor for the hyperlink. --- README.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index c82c642..39459a4 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,7 @@ .. image:: https://img.shields.io/pypi/v/skeleton.svg - :target: `PyPI link`_ + :target: https://pypi.org/project/skeleton .. image:: https://img.shields.io/pypi/pyversions/skeleton.svg - :target: `PyPI link`_ - -.. _PyPI link: https://pypi.org/project/skeleton .. image:: https://github.com/jaraco/skeleton/workflows/tests/badge.svg :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22tests%22 From 401287d8d0f9fb0365149983f5ca42618f00a6d8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 9 Nov 2022 19:32:49 -0500 Subject: [PATCH 121/206] Apply explicit_package_bases for mypy and unpin the version. Ref python/mypy#14057. --- mypy.ini | 3 +++ setup.cfg | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mypy.ini b/mypy.ini index 976ba02..b6f9727 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,2 +1,5 @@ [mypy] ignore_missing_imports = True +# required to support namespace packages +# https://github.com/python/mypy/issues/14057 +explicit_package_bases = True diff --git a/setup.cfg b/setup.cfg index 503cbfd..a0d86eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,8 +40,6 @@ testing = pytest-mypy >= 0.9.1; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" - # workaround for realpython/pytest-mypy#141 - mypy < 0.990 pytest-enabler >= 1.3 # local From 56b6f1d1d7a975b27f96c4e15a20077914b4c554 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 18 Nov 2022 22:32:51 -0500 Subject: [PATCH 122/206] Add Python 3.12 to matrix. Only test 3.8-3.10 on Linux. --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 102e0e2..3a28be3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,8 +38,8 @@ jobs: matrix: python: - "3.7" - - "3.10" - "3.11" + - "3.12" # Workaround for actions/setup-python#508 dev: - -dev @@ -48,6 +48,12 @@ jobs: - macos-latest - windows-latest include: + - python: "3.8" + platform: ubuntu-latest + - python: "3.9" + platform: ubuntu-latest + - python: "3.10" + platform: ubuntu-latest - python: pypy3.9 platform: ubuntu-latest runs-on: ${{ matrix.platform }} From 9e13598ce4b81c2c964dd555fa407bb3ba4cc607 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 19 Nov 2022 09:36:01 -0500 Subject: [PATCH 123/206] Disable flake8 on Python 3.12. Workaround for tholo/pytest-flake8#87. --- setup.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a0d86eb..a8f80ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,9 @@ testing = # upstream pytest >= 6 pytest-checkdocs >= 2.4 - pytest-flake8 + pytest-flake8; \ + # workaround for tholo/pytest-flake8#87 + python_version < "3.12" # workaround for tholo/pytest-flake8#87 flake8 < 5 pytest-black >= 0.3.7; \ From 9708c37ef0d286c4e907adc59f46cc92262e3bf1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Dec 2022 09:10:17 -0500 Subject: [PATCH 124/206] Honor ResourceWarnings. Fixes jaraco/skeleton#73. --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index 80e98cc..2c2817b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,6 +3,9 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= + # Ensure ResourceWarnings are emitted + default::ResourceWarning + # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 From 86a55c8320e2706d0f92e3248c29351bff83da4b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Dec 2022 19:18:02 -0500 Subject: [PATCH 125/206] tox 4 requires a boolean value, so use '1' to FORCE_COLOR. Fixes jaraco/skeleton#74. --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a28be3..e1e7bf1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,8 +7,10 @@ env: # Request colored output from CLI tools supporting it. Different tools # interpret the value differently. For some, just being set is sufficient. # For others, it must be a non-zero integer. For yet others, being set - # to a non-empty value is sufficient. - FORCE_COLOR: -106 + # to a non-empty value is sufficient. For tox, it must be one of + # , 0, 1, false, no, off, on, true, yes. The only enabling value + # in common is "1". + FORCE_COLOR: 1 # MyPy's color enforcement (must be a non-zero number) MYPY_FORCE_COLOR: -42 # Recognized by the `py` package, dependency of `pytest` (must be "1") From ef521390cb51a12eab5c4155900f45dc2c89d507 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Dec 2022 23:17:14 -0500 Subject: [PATCH 126/206] Remove unnecessary shebang and encoding header in docs conf. --- docs/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index fa741a8..c204339 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - extensions = [ 'sphinx.ext.autodoc', 'jaraco.packaging.sphinx', From c68ac3b7a3001502f681722dc55dff70a3169276 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Dec 2022 21:04:34 -0500 Subject: [PATCH 127/206] Prevent Python 3.12 from blocking checks. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1e7bf1..9d02856 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,6 +59,7 @@ jobs: - python: pypy3.9 platform: ubuntu-latest runs-on: ${{ matrix.platform }} + continue-on-error: ${{ matrix.python == '3.12' }} steps: - uses: actions/checkout@v3 - name: Setup Python From 82465b907d5131a57862a7242d64d610c3a05039 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Dec 2022 20:46:15 -0500 Subject: [PATCH 128/206] Build docs in CI, including sphinx-lint. --- .github/workflows/main.yml | 17 +++++++++++++++++ setup.cfg | 1 + tox.ini | 1 + 3 files changed, 19 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d02856..9629a26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,11 +72,28 @@ jobs: - name: Run tests run: tox + docs: + runs-on: ubuntu-latest + env: + TOXENV: docs + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }}${{ matrix.dev }} + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox + check: # This job does nothing and is only used for the branch protection if: always() needs: - test + - docs runs-on: ubuntu-latest diff --git a/setup.cfg b/setup.cfg index a8f80ce..c062c7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,6 +52,7 @@ docs = jaraco.packaging >= 9 rst.linker >= 1.9 furo + sphinx-lint # local diff --git a/tox.ini b/tox.ini index 3ca2af3..42ae685 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,7 @@ extras = changedir = docs commands = python -m sphinx -W --keep-going . {toxinidir}/build/html + python -m sphinxlint [testenv:release] skip_install = True From eb2bdc83a7d3cfd1c2bc3aeae39a900d654a6839 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2023 03:17:24 -0500 Subject: [PATCH 129/206] Update badge for 2023 --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 39459a4..af0efb0 100644 --- a/README.rst +++ b/README.rst @@ -14,5 +14,5 @@ .. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest .. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2022-informational +.. image:: https://img.shields.io/badge/skeleton-2023-informational :target: https://blog.jaraco.com/skeleton From f9e01d2197d18b2b21976bae6e5b7f90b683bc4f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 18 Jan 2023 21:33:18 -0500 Subject: [PATCH 130/206] ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default. --- pytest.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 2c2817b..1e6adf0 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,6 @@ [pytest] norecursedirs=dist build .tox .eggs addopts=--doctest-modules -doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= # Ensure ResourceWarnings are emitted default::ResourceWarning From 284359e5123eb6a9f975092d1fb17dfa814d1594 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 27 Jan 2023 17:56:30 -0500 Subject: [PATCH 131/206] Enable default encoding warning where available. See PEP 597. --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 42ae685..5a67821 100644 --- a/tox.ini +++ b/tox.ini @@ -8,10 +8,13 @@ toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] deps = +setenv = + PYTHONWARNDEFAULTENCODING = 1 commands = pytest {posargs} usedevelop = True -extras = testing +extras = + testing [testenv:docs] extras = From f18255faba76a6a86bf3fa6f73da9d974262aebd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 27 Jan 2023 18:19:23 -0500 Subject: [PATCH 132/206] Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67. --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index 1e6adf0..bd7d0b5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -17,3 +17,6 @@ filterwarnings= ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning ignore:Flake8Item is an Item subclass and should not be a collector:pytest.PytestWarning + + # shopkeep/pytest-black#67 + ignore:'encoding' argument not specified::pytest_black From 0d9c6f0f5b6182cdac448270dbc0529f91b50bd9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 27 Jan 2023 18:50:22 -0500 Subject: [PATCH 133/206] Exempt warning. Workaround for realpython/pytest-mypy#152 --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index bd7d0b5..69d95b2 100644 --- a/pytest.ini +++ b/pytest.ini @@ -20,3 +20,6 @@ filterwarnings= # shopkeep/pytest-black#67 ignore:'encoding' argument not specified::pytest_black + + # realpython/pytest-mypy#152 + ignore:'encoding' argument not specified::pytest_mypy From 5f095d18d76f7ae36e57fa3241da341b0f9cd365 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 7 Feb 2023 09:54:15 -0500 Subject: [PATCH 134/206] Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750). --- pytest.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pytest.ini b/pytest.ini index 69d95b2..5b6ddc4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,6 +2,8 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules filterwarnings= + ## upstream + # Ensure ResourceWarnings are emitted default::ResourceWarning @@ -23,3 +25,8 @@ filterwarnings= # realpython/pytest-mypy#152 ignore:'encoding' argument not specified::pytest_mypy + + # python/cpython#100750 + ignore::EncodingWarning:platform + + ## end upstream From 6f7ac885c61eb74df8c2db435cdbec412da06fe6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 9 Feb 2023 03:52:03 -0500 Subject: [PATCH 135/206] Remove reference to EncodingWarning as it doesn't exist on some Pythons. --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 5b6ddc4..99a2519 100644 --- a/pytest.ini +++ b/pytest.ini @@ -27,6 +27,6 @@ filterwarnings= ignore:'encoding' argument not specified::pytest_mypy # python/cpython#100750 - ignore::EncodingWarning:platform + ignore:'encoding' argument not specified::platform ## end upstream From 9650fc184fc120a21623d8f92d03ee4ccbaa89d8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 16 Feb 2023 16:43:22 -0500 Subject: [PATCH 136/206] Revert "exclude build env from cov reporting (jaraco/skeleton#60)" This reverts commit e719f86c138a750f0c4599cd01cb8067b1ca95c8. The issue seems to have been addressed somehow. Ref pytest-dev/pytest-cov#538. --- .coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 01164f6..6a34e66 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,6 @@ omit = # leading `*/` for pytest-dev/pytest-cov#456 */.tox/* - */pep517-build-env-* [report] show_missing = True From 56cdf46aa19450d58b4a56af6553a0225762ae4b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 16 Feb 2023 21:12:36 -0500 Subject: [PATCH 137/206] Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56. --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index 6a34e66..0287948 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,6 +2,8 @@ omit = # leading `*/` for pytest-dev/pytest-cov#456 */.tox/* +disable_warnings = + couldnt-parse [report] show_missing = True From 109f8c09ddb4904dc3f83307473520b2250ccb30 Mon Sep 17 00:00:00 2001 From: Joyce Date: Sat, 18 Mar 2023 13:25:16 -0300 Subject: [PATCH 138/206] Feat: initial permissions to main.yml (jaraco/skeleton#76) Signed-off-by: Joyce --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9629a26..3fa1c81 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,9 @@ name: tests on: [push, pull_request] +permissions: + contents: read + env: # Environment variables to support color support (jaraco/skeleton#66): # Request colored output from CLI tools supporting it. Different tools @@ -104,6 +107,8 @@ jobs: jobs: ${{ toJSON(needs) }} release: + permissions: + contents: write needs: - check if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') From 5957d58266e479f124b31f30e4322e798fdf386b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 10 Apr 2023 21:57:33 -0400 Subject: [PATCH 139/206] Remove unnecessary and incorrect copyright notice. Fixes jaraco/skeleton#78. --- LICENSE | 2 -- 1 file changed, 2 deletions(-) diff --git a/LICENSE b/LICENSE index 353924b..1bb5a44 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,3 @@ -Copyright Jason R. Coombs - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the From d2ec0473f8d4c25cc6f696e70ba110e1061e4dfe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 10 May 2023 20:27:17 -0400 Subject: [PATCH 140/206] Replace flake8 with ruff. Fixes jaraco/skeleton#79 and sheds debt. --- .flake8 | 9 --------- pyproject.toml | 6 +++--- pytest.ini | 8 -------- setup.cfg | 6 +----- 4 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 48b2e24..0000000 --- a/.flake8 +++ /dev/null @@ -1,9 +0,0 @@ -[flake8] -max-line-length = 88 - -# jaraco/skeleton#34 -max-complexity = 10 - -extend-ignore = - # Black creates whitespace before colon - E203 diff --git a/pyproject.toml b/pyproject.toml index 60de242..d5f3487 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,8 @@ addopts = "--black" [tool.pytest-enabler.mypy] addopts = "--mypy" -[tool.pytest-enabler.flake8] -addopts = "--flake8" - [tool.pytest-enabler.cov] addopts = "--cov" + +[tool.pytest-enabler.ruff] +addopts = "--ruff" diff --git a/pytest.ini b/pytest.ini index 99a2519..94515aa 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,19 +7,11 @@ filterwarnings= # Ensure ResourceWarnings are emitted default::ResourceWarning - # Suppress deprecation warning in flake8 - ignore:SelectableGroups dict interface is deprecated::flake8 - # shopkeep/pytest-black#55 ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning - # tholo/pytest-flake8#83 - ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning - ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning - ignore:Flake8Item is an Item subclass and should not be a collector:pytest.PytestWarning - # shopkeep/pytest-black#67 ignore:'encoding' argument not specified::pytest_black diff --git a/setup.cfg b/setup.cfg index c062c7b..6b31311 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,11 +30,6 @@ testing = # upstream pytest >= 6 pytest-checkdocs >= 2.4 - pytest-flake8; \ - # workaround for tholo/pytest-flake8#87 - python_version < "3.12" - # workaround for tholo/pytest-flake8#87 - flake8 < 5 pytest-black >= 0.3.7; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" @@ -43,6 +38,7 @@ testing = # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-enabler >= 1.3 + pytest-ruff # local From 96ebfe14538c2279b54dd19567e5922880b4fdf3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 28 May 2023 12:31:51 -0400 Subject: [PATCH 141/206] Make substitution fields more prominent and distinct from true 'skeleton' references. (#71) Fixes #70 --- README.rst | 14 +++++++------- docs/index.rst | 2 +- setup.cfg | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index af0efb0..1f66d19 100644 --- a/README.rst +++ b/README.rst @@ -1,18 +1,18 @@ -.. image:: https://img.shields.io/pypi/v/skeleton.svg - :target: https://pypi.org/project/skeleton +.. image:: https://img.shields.io/pypi/v/PROJECT.svg + :target: https://pypi.org/project/PROJECT -.. image:: https://img.shields.io/pypi/pyversions/skeleton.svg +.. image:: https://img.shields.io/pypi/pyversions/PROJECT.svg -.. image:: https://github.com/jaraco/skeleton/workflows/tests/badge.svg - :target: https://github.com/jaraco/skeleton/actions?query=workflow%3A%22tests%22 +.. image:: https://github.com/PROJECT_PATH/workflows/tests/badge.svg + :target: https://github.com/PROJECT_PATH/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: Black -.. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest -.. :target: https://skeleton.readthedocs.io/en/latest/?badge=latest +.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest +.. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2023-informational :target: https://blog.jaraco.com/skeleton diff --git a/docs/index.rst b/docs/index.rst index 325842b..53117d1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,7 @@ Welcome to |project| documentation! history -.. automodule:: skeleton +.. automodule:: PROJECT :members: :undoc-members: :show-inheritance: diff --git a/setup.cfg b/setup.cfg index 6b31311..0cee3d3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,10 @@ [metadata] -name = skeleton +name = PROJECT author = Jason R. Coombs author_email = jaraco@jaraco.com -description = skeleton +description = PROJECT_DESCRIPTION long_description = file:README.rst -url = https://github.com/jaraco/skeleton +url = https://github.com/PROJECT_PATH classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers From 4ce054b47df31b4845968043c8772ee4a604390a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 28 May 2023 20:15:16 -0400 Subject: [PATCH 142/206] Suppress EncodingWarning in build.env. Ref pypa/build#615. --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index 94515aa..3d30458 100644 --- a/pytest.ini +++ b/pytest.ini @@ -21,4 +21,7 @@ filterwarnings= # python/cpython#100750 ignore:'encoding' argument not specified::platform + # pypa/build#615 + ignore:'encoding' argument not specified:EncodingWarning:build.env + ## end upstream From a0acaace3e29937d0711b3de8019cd3fe4799cf7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 28 May 2023 20:29:31 -0400 Subject: [PATCH 143/206] Remove reference to EncodingWarning as it doesn't exist on some Pythons. --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 3d30458..d9a15ed 100644 --- a/pytest.ini +++ b/pytest.ini @@ -22,6 +22,6 @@ filterwarnings= ignore:'encoding' argument not specified::platform # pypa/build#615 - ignore:'encoding' argument not specified:EncodingWarning:build.env + ignore:'encoding' argument not specified::build.env ## end upstream From 6f754807a0abd25e0b52f024df2072d53f336974 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Jun 2023 09:49:46 -0400 Subject: [PATCH 144/206] Update RTD boilerplate to new issue. Ref readthedocs/readthedocs.org#10401. --- .readthedocs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6bef349..053c728 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,9 +5,8 @@ python: extra_requirements: - docs -# workaround for readthedocs/readthedocs.org#9623 +# required boilerplate readthedocs/readthedocs.org#10401 build: - # workaround for readthedocs/readthedocs.org#9635 os: ubuntu-22.04 tools: python: "3" From e7cd730d0d708c8f1f3eb28a29927f3475b3e855 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Jun 2023 21:27:17 -0400 Subject: [PATCH 145/206] Add badge for Ruff. --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 1f66d19..b703d49 100644 --- a/README.rst +++ b/README.rst @@ -7,6 +7,10 @@ :target: https://github.com/PROJECT_PATH/actions?query=workflow%3A%22tests%22 :alt: tests +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff + .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: Black From 241541c07c9c30e48b57d59e527ef923d05c82d6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 16 Jun 2023 14:11:22 -0400 Subject: [PATCH 146/206] Remove inclusion of python version for docs --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3fa1c81..93471ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,8 +83,6 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }}${{ matrix.dev }} - name: Install tox run: | python -m pip install tox From 74b0d396c87892e9122c96994cf2c26329141208 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 19 Jun 2023 21:11:01 -0400 Subject: [PATCH 147/206] Adopt towncrier for managing changelog. Fixes jaraco/skeleton#83. Renamed CHANGES.rst to NEWS.rst to align with towncrier defaults. --- CHANGES.rst => NEWS.rst | 0 docs/conf.py | 2 +- docs/history.rst | 2 +- towncrier.toml | 2 ++ tox.ini | 9 +++++++++ 5 files changed, 13 insertions(+), 2 deletions(-) rename CHANGES.rst => NEWS.rst (100%) create mode 100644 towncrier.toml diff --git a/CHANGES.rst b/NEWS.rst similarity index 100% rename from CHANGES.rst rename to NEWS.rst diff --git a/docs/conf.py b/docs/conf.py index c204339..3215048 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ # Link dates and other references in the changelog extensions += ['rst.linker'] link_files = { - '../CHANGES.rst': dict( + '../NEWS.rst': dict( using=dict(GH='https://github.com'), replace=[ dict( diff --git a/docs/history.rst b/docs/history.rst index 8e21750..5bdc232 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -5,4 +5,4 @@ History ******* -.. include:: ../CHANGES (links).rst +.. include:: ../NEWS (links).rst diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 0000000..6fa480e --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,2 @@ +[tool.towncrier] +title_format = "{version}" diff --git a/tox.ini b/tox.ini index 5a67821..32b031d 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,15 @@ commands = python -m sphinx -W --keep-going . {toxinidir}/build/html python -m sphinxlint +[testenv:finalize] +skip_install = True +deps = + towncrier + jaraco.develop +passenv = * +commands = + python -m jaraco.develop.towncrier build --yes + [testenv:release] skip_install = True deps = From cd145f4080ef0e954aa4716fc3f240c508a5693c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 22 Jun 2023 23:34:21 -0400 Subject: [PATCH 148/206] Replace workaround for actions/setup-python#508 with 'allow-prereleases' --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93471ce..00b2129 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,9 +45,6 @@ jobs: - "3.7" - "3.11" - "3.12" - # Workaround for actions/setup-python#508 - dev: - - -dev platform: - ubuntu-latest - macos-latest @@ -68,7 +65,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python }}${{ matrix.dev }} + python-version: ${{ matrix.python }} + allow-prereleases: true - name: Install tox run: | python -m pip install tox From 07a87ea9d8671ea4f529858201866e3f78fa3afc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 23 Jun 2023 12:59:50 -0400 Subject: [PATCH 149/206] Remove tox boilerplate, no longer necessary with later versions of tox. --- tox.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tox.ini b/tox.ini index 32b031d..4e8e709 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,4 @@ [tox] -envlist = python -minversion = 3.2 -# https://github.com/jaraco/skeleton/issues/6 -tox_pip_extensions_ext_venv_update = true toxworkdir={env:TOX_WORK_DIR:.tox} From 3b7d8a912d54ccf88f79eea0dfc903d101067bb5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Jun 2023 20:55:42 -0400 Subject: [PATCH 150/206] Require Python 3.8 or later. --- .github/workflows/main.yml | 4 +--- newsfragments/+drop-py37.feature.rst | 1 + setup.cfg | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 newsfragments/+drop-py37.feature.rst diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00b2129..7cc4fb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: strategy: matrix: python: - - "3.7" + - "3.8" - "3.11" - "3.12" platform: @@ -50,8 +50,6 @@ jobs: - macos-latest - windows-latest include: - - python: "3.8" - platform: ubuntu-latest - python: "3.9" platform: ubuntu-latest - python: "3.10" diff --git a/newsfragments/+drop-py37.feature.rst b/newsfragments/+drop-py37.feature.rst new file mode 100644 index 0000000..ccabdaa --- /dev/null +++ b/newsfragments/+drop-py37.feature.rst @@ -0,0 +1 @@ +Require Python 3.8 or later. diff --git a/setup.cfg b/setup.cfg index 0cee3d3..75a50d4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ classifiers = [options] packages = find_namespace: include_package_data = true -python_requires = >=3.7 +python_requires = >=3.8 install_requires = [options.packages.find] From 8e83c3f0bc7baab5f2db37487526e374a1f68494 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 23 Jun 2023 19:52:23 -0400 Subject: [PATCH 151/206] Expand 'finalize' to commit and tag the change. --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 4e8e709..1093e02 100644 --- a/tox.ini +++ b/tox.ini @@ -25,10 +25,11 @@ commands = skip_install = True deps = towncrier - jaraco.develop + jaraco.develop >= 7.23 passenv = * commands = - python -m jaraco.develop.towncrier build --yes + python -m jaraco.develop.finalize + [testenv:release] skip_install = True From 74ba8acbe019de9f30dee6d319c8621caac070ae Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Jun 2023 22:23:40 -0400 Subject: [PATCH 152/206] Leverage pytest-enabler 2.2 for the default config. --- pyproject.toml | 12 ------------ setup.cfg | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d5f3487..dce944d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,15 +6,3 @@ build-backend = "setuptools.build_meta" skip-string-normalization = true [tool.setuptools_scm] - -[tool.pytest-enabler.black] -addopts = "--black" - -[tool.pytest-enabler.mypy] -addopts = "--mypy" - -[tool.pytest-enabler.cov] -addopts = "--cov" - -[tool.pytest-enabler.ruff] -addopts = "--ruff" diff --git a/setup.cfg b/setup.cfg index 75a50d4..a9ca2a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ testing = pytest-mypy >= 0.9.1; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" - pytest-enabler >= 1.3 + pytest-enabler >= 2.2 pytest-ruff # local From cca49a4481167049f6bdd0f8038e685e5b8e929f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 3 Jul 2023 15:18:58 -0400 Subject: [PATCH 153/206] Prefer 3.x for Python version (latest stable). --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cc4fb8..f54dfbc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.11-dev + python-version: 3.x - name: Install tox run: | python -m pip install tox From c29955f9be8e44b2ea5fea12f86b7bd46a0b3958 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 4 Jul 2023 11:53:15 -0400 Subject: [PATCH 154/206] Collapse skeleton history. Workaround for jaraco/skeleton#87. --- .coveragerc | 9 ++ .editorconfig | 19 ++++ .github/dependabot.yml | 8 ++ .github/workflows/main.yml | 124 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 5 ++ .readthedocs.yaml | 12 +++ LICENSE | 17 ++++ NEWS.rst | 0 README.rst | 22 +++++ docs/conf.py | 42 +++++++++ docs/history.rst | 8 ++ docs/index.rst | 22 +++++ mypy.ini | 5 ++ newsfragments/+drop-py37.feature.rst | 1 + pyproject.toml | 8 ++ pytest.ini | 27 ++++++ setup.cfg | 55 ++++++++++++ towncrier.toml | 2 + tox.ini | 49 +++++++++++ 19 files changed, 435 insertions(+) create mode 100644 .coveragerc create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/main.yml create mode 100644 .pre-commit-config.yaml create mode 100644 .readthedocs.yaml create mode 100644 LICENSE create mode 100644 NEWS.rst create mode 100644 README.rst create mode 100644 docs/conf.py create mode 100644 docs/history.rst create mode 100644 docs/index.rst create mode 100644 mypy.ini create mode 100644 newsfragments/+drop-py37.feature.rst create mode 100644 pyproject.toml create mode 100644 pytest.ini create mode 100644 setup.cfg create mode 100644 towncrier.toml create mode 100644 tox.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..0287948 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ +[run] +omit = + # leading `*/` for pytest-dev/pytest-cov#456 + */.tox/* +disable_warnings = + couldnt-parse + +[report] +show_missing = True diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..304196f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +insert_final_newline = true +end_of_line = lf + +[*.py] +indent_style = space +max_line_length = 88 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.rst] +indent_style = space diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..89ff339 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: "all" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f54dfbc --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,124 @@ +name: tests + +on: [push, pull_request] + +permissions: + contents: read + +env: + # Environment variables to support color support (jaraco/skeleton#66): + # Request colored output from CLI tools supporting it. Different tools + # interpret the value differently. For some, just being set is sufficient. + # For others, it must be a non-zero integer. For yet others, being set + # to a non-empty value is sufficient. For tox, it must be one of + # , 0, 1, false, no, off, on, true, yes. The only enabling value + # in common is "1". + FORCE_COLOR: 1 + # MyPy's color enforcement (must be a non-zero number) + MYPY_FORCE_COLOR: -42 + # Recognized by the `py` package, dependency of `pytest` (must be "1") + PY_COLORS: 1 + # Make tox-wrapped tools see color requests + TOX_TESTENV_PASSENV: >- + FORCE_COLOR + MYPY_FORCE_COLOR + NO_COLOR + PY_COLORS + PYTEST_THEME + PYTEST_THEME_MODE + + # Suppress noisy pip warnings + PIP_DISABLE_PIP_VERSION_CHECK: 'true' + PIP_NO_PYTHON_VERSION_WARNING: 'true' + PIP_NO_WARN_SCRIPT_LOCATION: 'true' + + # Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream + # Must be "1". + TOX_PARALLEL_NO_SPINNER: 1 + + +jobs: + test: + strategy: + matrix: + python: + - "3.8" + - "3.11" + - "3.12" + platform: + - ubuntu-latest + - macos-latest + - windows-latest + include: + - python: "3.9" + platform: ubuntu-latest + - python: "3.10" + platform: ubuntu-latest + - python: pypy3.9 + platform: ubuntu-latest + runs-on: ${{ matrix.platform }} + continue-on-error: ${{ matrix.python == '3.12' }} + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + allow-prereleases: true + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox + + docs: + runs-on: ubuntu-latest + env: + TOXENV: docs + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox + + check: # This job does nothing and is only used for the branch protection + if: always() + + needs: + - test + - docs + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + + release: + permissions: + contents: write + needs: + - check + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Install tox + run: | + python -m pip install tox + - name: Release + run: tox -e release + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..af50201 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: +- repo: https://github.com/psf/black + rev: 22.6.0 + hooks: + - id: black diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..053c728 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,12 @@ +version: 2 +python: + install: + - path: . + extra_requirements: + - docs + +# required boilerplate readthedocs/readthedocs.org#10401 +build: + os: ubuntu-22.04 + tools: + python: "3" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1bb5a44 --- /dev/null +++ b/LICENSE @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/NEWS.rst b/NEWS.rst new file mode 100644 index 0000000..e69de29 diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..b703d49 --- /dev/null +++ b/README.rst @@ -0,0 +1,22 @@ +.. image:: https://img.shields.io/pypi/v/PROJECT.svg + :target: https://pypi.org/project/PROJECT + +.. image:: https://img.shields.io/pypi/pyversions/PROJECT.svg + +.. image:: https://github.com/PROJECT_PATH/workflows/tests/badge.svg + :target: https://github.com/PROJECT_PATH/actions?query=workflow%3A%22tests%22 + :alt: tests + +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json + :target: https://github.com/astral-sh/ruff + :alt: Ruff + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code style: Black + +.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest +.. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2023-informational + :target: https://blog.jaraco.com/skeleton diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..3215048 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,42 @@ +extensions = [ + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', +] + +master_doc = "index" +html_theme = "furo" + +# Link dates and other references in the changelog +extensions += ['rst.linker'] +link_files = { + '../NEWS.rst': dict( + using=dict(GH='https://github.com'), + replace=[ + dict( + pattern=r'(Issue #|\B#)(?P\d+)', + url='{package_url}/issues/{issue}', + ), + dict( + pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', + with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', + ), + dict( + pattern=r'PEP[- ](?P\d+)', + url='https://peps.python.org/pep-{pep_number:0>4}/', + ), + ], + ) +} + +# Be strict about any broken references +nitpicky = True + +# Include Python intersphinx mapping to prevent failures +# jaraco/skeleton#51 +extensions += ['sphinx.ext.intersphinx'] +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), +} + +# Preserve authored syntax for defaults +autodoc_preserve_defaults = True diff --git a/docs/history.rst b/docs/history.rst new file mode 100644 index 0000000..5bdc232 --- /dev/null +++ b/docs/history.rst @@ -0,0 +1,8 @@ +:tocdepth: 2 + +.. _changes: + +History +******* + +.. include:: ../NEWS (links).rst diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..53117d1 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,22 @@ +Welcome to |project| documentation! +=================================== + +.. toctree:: + :maxdepth: 1 + + history + + +.. automodule:: PROJECT + :members: + :undoc-members: + :show-inheritance: + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..b6f9727 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,5 @@ +[mypy] +ignore_missing_imports = True +# required to support namespace packages +# https://github.com/python/mypy/issues/14057 +explicit_package_bases = True diff --git a/newsfragments/+drop-py37.feature.rst b/newsfragments/+drop-py37.feature.rst new file mode 100644 index 0000000..ccabdaa --- /dev/null +++ b/newsfragments/+drop-py37.feature.rst @@ -0,0 +1 @@ +Require Python 3.8 or later. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dce944d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[build-system] +requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] +build-backend = "setuptools.build_meta" + +[tool.black] +skip-string-normalization = true + +[tool.setuptools_scm] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..d9a15ed --- /dev/null +++ b/pytest.ini @@ -0,0 +1,27 @@ +[pytest] +norecursedirs=dist build .tox .eggs +addopts=--doctest-modules +filterwarnings= + ## upstream + + # Ensure ResourceWarnings are emitted + default::ResourceWarning + + # shopkeep/pytest-black#55 + ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning + ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning + + # shopkeep/pytest-black#67 + ignore:'encoding' argument not specified::pytest_black + + # realpython/pytest-mypy#152 + ignore:'encoding' argument not specified::pytest_mypy + + # python/cpython#100750 + ignore:'encoding' argument not specified::platform + + # pypa/build#615 + ignore:'encoding' argument not specified::build.env + + ## end upstream diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a9ca2a8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,55 @@ +[metadata] +name = PROJECT +author = Jason R. Coombs +author_email = jaraco@jaraco.com +description = PROJECT_DESCRIPTION +long_description = file:README.rst +url = https://github.com/PROJECT_PATH +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + +[options] +packages = find_namespace: +include_package_data = true +python_requires = >=3.8 +install_requires = + +[options.packages.find] +exclude = + build* + dist* + docs* + tests* + +[options.extras_require] +testing = + # upstream + pytest >= 6 + pytest-checkdocs >= 2.4 + pytest-black >= 0.3.7; \ + # workaround for jaraco/skeleton#22 + python_implementation != "PyPy" + pytest-cov + pytest-mypy >= 0.9.1; \ + # workaround for jaraco/skeleton#22 + python_implementation != "PyPy" + pytest-enabler >= 2.2 + pytest-ruff + + # local + +docs = + # upstream + sphinx >= 3.5 + jaraco.packaging >= 9 + rst.linker >= 1.9 + furo + sphinx-lint + + # local + +[options.entry_points] diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 0000000..6fa480e --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,2 @@ +[tool.towncrier] +title_format = "{version}" diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..1093e02 --- /dev/null +++ b/tox.ini @@ -0,0 +1,49 @@ +[tox] +toxworkdir={env:TOX_WORK_DIR:.tox} + + +[testenv] +deps = +setenv = + PYTHONWARNDEFAULTENCODING = 1 +commands = + pytest {posargs} +usedevelop = True +extras = + testing + +[testenv:docs] +extras = + docs + testing +changedir = docs +commands = + python -m sphinx -W --keep-going . {toxinidir}/build/html + python -m sphinxlint + +[testenv:finalize] +skip_install = True +deps = + towncrier + jaraco.develop >= 7.23 +passenv = * +commands = + python -m jaraco.develop.finalize + + +[testenv:release] +skip_install = True +deps = + build + twine>=3 + jaraco.develop>=7.1 +passenv = + TWINE_PASSWORD + GITHUB_TOKEN +setenv = + TWINE_USERNAME = {env:TWINE_USERNAME:__token__} +commands = + python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)" + python -m build + python -m twine upload dist/* + python -m jaraco.develop.create-github-release From 972d1b3033afba89ffa20e6c492c4d02742e8a9d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 5 Jul 2023 22:20:28 -0400 Subject: [PATCH 155/206] Add links to project home page and pypi. Fixes jaraco/skeleton#77. --- docs/index.rst | 4 ++++ setup.cfg | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 53117d1..5a3c677 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,6 +1,10 @@ Welcome to |project| documentation! =================================== +.. sidebar-links:: + :home: + :pypi: + .. toctree:: :maxdepth: 1 diff --git a/setup.cfg b/setup.cfg index a9ca2a8..46f7bdf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ testing = docs = # upstream sphinx >= 3.5 - jaraco.packaging >= 9 + jaraco.packaging >= 9.3 rst.linker >= 1.9 furo sphinx-lint From 747c2a36524f83b84a3d9497121313bb5751b877 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 6 Jul 2023 08:59:49 -0400 Subject: [PATCH 156/206] Replace redundant step names with simple 'Run'. --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f54dfbc..b822409 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - name: Install tox run: | python -m pip install tox - - name: Run tests + - name: Run run: tox docs: @@ -82,7 +82,7 @@ jobs: - name: Install tox run: | python -m pip install tox - - name: Run tests + - name: Run run: tox check: # This job does nothing and is only used for the branch protection @@ -117,7 +117,7 @@ jobs: - name: Install tox run: | python -m pip install tox - - name: Release + - name: Run run: tox -e release env: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} From c43962adf34c28c22573093419e5e98b2e57cc07 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 10 Jul 2023 23:34:53 -0400 Subject: [PATCH 157/206] Remove TOX_WORK_DIR workaround, no longer necessary with tox 4. Ref tox-dev/tox#3050. --- tox.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tox.ini b/tox.ini index 1093e02..e51d652 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,3 @@ -[tox] -toxworkdir={env:TOX_WORK_DIR:.tox} - - [testenv] deps = setenv = From 0e2032c4754c598ba75e467c64009ba4490ddea9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 31 Aug 2023 18:42:14 -0400 Subject: [PATCH 158/206] Pin against sphinx 7.2.5 as workaround for sphinx/sphinx-doc#11662. Closes jaraco/skeleton#88. --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 46f7bdf..4f184c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,8 @@ testing = docs = # upstream sphinx >= 3.5 + # workaround for sphinx/sphinx-doc#11662 + sphinx < 7.2.5 jaraco.packaging >= 9.3 rst.linker >= 1.9 furo From 92d2d8e1aff997f3877239230c9490ed9cdd1222 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Sep 2023 18:46:27 -0400 Subject: [PATCH 159/206] Allow GITHUB_* settings to pass through to tests. --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b822409..67d9d3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,10 @@ env: # Must be "1". TOX_PARALLEL_NO_SPINNER: 1 + # Ensure tests can sense settings about the environment + TOX_OVERRIDE: >- + testenv.pass_env+=GITHUB_* + jobs: test: From f3dc1f4776c94a9a4a7c0e8c5b49c532b0a7d411 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Sep 2023 18:49:13 -0400 Subject: [PATCH 160/206] Remove spinner disablement. If it's not already fixed upstream, that's where it should be fixed. --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67d9d3b..30c9615 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,10 +32,6 @@ env: PIP_NO_PYTHON_VERSION_WARNING: 'true' PIP_NO_WARN_SCRIPT_LOCATION: 'true' - # Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream - # Must be "1". - TOX_PARALLEL_NO_SPINNER: 1 - # Ensure tests can sense settings about the environment TOX_OVERRIDE: >- testenv.pass_env+=GITHUB_* From 0484daa8a6f72c9ad4e1784f9181c2488a191d8e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Sep 2023 18:53:55 -0400 Subject: [PATCH 161/206] Clean up 'color' environment variables. The TOX_TESTENV_PASSENV hasn't been useful for some time and by its mere presence wasted a lot of time today under the assumption that it's doing something. Instead, just rely on one variable FORCE_COLOR. If it's not honored, then that should be the fix upstream. --- .github/workflows/main.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30c9615..f302854 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,26 +6,8 @@ permissions: contents: read env: - # Environment variables to support color support (jaraco/skeleton#66): - # Request colored output from CLI tools supporting it. Different tools - # interpret the value differently. For some, just being set is sufficient. - # For others, it must be a non-zero integer. For yet others, being set - # to a non-empty value is sufficient. For tox, it must be one of - # , 0, 1, false, no, off, on, true, yes. The only enabling value - # in common is "1". + # Environment variable to support color support (jaraco/skeleton#66) FORCE_COLOR: 1 - # MyPy's color enforcement (must be a non-zero number) - MYPY_FORCE_COLOR: -42 - # Recognized by the `py` package, dependency of `pytest` (must be "1") - PY_COLORS: 1 - # Make tox-wrapped tools see color requests - TOX_TESTENV_PASSENV: >- - FORCE_COLOR - MYPY_FORCE_COLOR - NO_COLOR - PY_COLORS - PYTEST_THEME - PYTEST_THEME_MODE # Suppress noisy pip warnings PIP_DISABLE_PIP_VERSION_CHECK: 'true' From b02bf32bae729d53bdb7c9649d6ec36afdb793ee Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Sep 2023 13:27:03 -0400 Subject: [PATCH 162/206] Add diff-cover check to Github Actions CI. Closes jaraco/skeleton#90. --- .github/workflows/main.yml | 18 ++++++++++++++++++ tox.ini | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f302854..fa326a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,24 @@ jobs: - name: Run run: tox + diffcov: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Install tox + run: | + python -m pip install tox + - name: Evaluate coverage + run: tox + env: + TOXENV: diffcov + docs: runs-on: ubuntu-latest env: diff --git a/tox.ini b/tox.ini index e51d652..3b4414b 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,14 @@ usedevelop = True extras = testing +[testenv:diffcov] +deps = + diff-cover +commands = + pytest {posargs} --cov-report xml + diff-cover coverage.xml --compare-branch=origin/main --html-report diffcov.html + diff-cover coverage.xml --compare-branch=origin/main --fail-under=100 + [testenv:docs] extras = docs From a6256e2935468b72a61aa7fda1e036faef3bfb3d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Sep 2023 13:59:47 -0400 Subject: [PATCH 163/206] Add descriptions to the tox environments. Closes jaraco/skeleton#91. --- tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tox.ini b/tox.ini index 3b4414b..1950b4e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,5 @@ [testenv] +description = perform primary checks (tests, style, types, coverage) deps = setenv = PYTHONWARNDEFAULTENCODING = 1 @@ -9,6 +10,7 @@ extras = testing [testenv:diffcov] +description = run tests and check that diff from main is covered deps = diff-cover commands = @@ -17,6 +19,7 @@ commands = diff-cover coverage.xml --compare-branch=origin/main --fail-under=100 [testenv:docs] +description = build the documentation extras = docs testing @@ -26,6 +29,7 @@ commands = python -m sphinxlint [testenv:finalize] +description = assemble changelog and tag a release skip_install = True deps = towncrier @@ -36,6 +40,7 @@ commands = [testenv:release] +description = publish the package to PyPI and GitHub skip_install = True deps = build From 928e9a86d61d3a660948bcba7689f90216cc8243 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Sep 2023 14:10:31 -0400 Subject: [PATCH 164/206] Add FORCE_COLOR to the TOX_OVERRIDE for GHA. Requires tox 4.11.1. Closes jaraco/skeleton#89. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa326a2..28e3678 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ env: # Ensure tests can sense settings about the environment TOX_OVERRIDE: >- - testenv.pass_env+=GITHUB_* + testenv.pass_env+=GITHUB_*,FORCE_COLOR jobs: From ca1831c2148fe5ddbffd001de76ff5f6005f812c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 18 Sep 2023 11:05:36 -0400 Subject: [PATCH 165/206] Prefer ``pass_env`` in tox config. Preferred failure mode for tox-dev/tox#3127 and closes jaraco/skeleton#92. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 1950b4e..33da3de 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ skip_install = True deps = towncrier jaraco.develop >= 7.23 -passenv = * +pass_env = * commands = python -m jaraco.develop.finalize @@ -46,7 +46,7 @@ deps = build twine>=3 jaraco.develop>=7.1 -passenv = +pass_env = TWINE_PASSWORD GITHUB_TOKEN setenv = From 03f03e7802b0842b41f70b2b1c17ab26551a7533 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 Nov 2023 09:43:46 -0500 Subject: [PATCH 166/206] Limit sphinxlint jobs to 1. Workaround for sphinx-contrib/sphinx-lint#83. --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 33da3de..331eeed 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,9 @@ extras = changedir = docs commands = python -m sphinx -W --keep-going . {toxinidir}/build/html - python -m sphinxlint + python -m sphinxlint \ + # workaround for sphinx-contrib/sphinx-lint#83 + --jobs 1 [testenv:finalize] description = assemble changelog and tag a release From 75d9cc1b7cb6f84e7a16a83ec3abb9a478fdb130 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Nov 2023 19:57:45 +0600 Subject: [PATCH 167/206] Upgrade GitHub Actions checkout (jaraco/skeleton#94) Also, upgrade from `pypy3.9` to `pypy3.10` and remove the `continue-on-error` for Python 3.12. As recommended at jaraco/cssutils#41 --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28e3678..1082866 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,12 +36,12 @@ jobs: platform: ubuntu-latest - python: "3.10" platform: ubuntu-latest - - python: pypy3.9 + - python: pypy3.10 platform: ubuntu-latest runs-on: ${{ matrix.platform }} - continue-on-error: ${{ matrix.python == '3.12' }} + continue-on-error: ${{ matrix.python == '3.13' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: @@ -56,7 +56,7 @@ jobs: diffcov: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python @@ -76,7 +76,7 @@ jobs: env: TOXENV: docs steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 - name: Install tox @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: From 5732ebeeaa9480f8cd80c96a3183d7b247f27214 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Nov 2023 20:08:10 +0600 Subject: [PATCH 168/206] GitHub Actions: Combine tox jobs diffcov and docs (jaraco/skeleton#95) Code reuse Co-authored-by: Jason R. Coombs --- .github/workflows/main.yml | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1082866..9682985 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,12 +48,15 @@ jobs: python-version: ${{ matrix.python }} allow-prereleases: true - name: Install tox - run: | - python -m pip install tox + run: python -m pip install tox - name: Run run: tox - diffcov: + collateral: + strategy: + fail-fast: false + matrix: + job: [diffcov, docs] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -64,33 +67,16 @@ jobs: with: python-version: 3.x - name: Install tox - run: | - python -m pip install tox - - name: Evaluate coverage - run: tox - env: - TOXENV: diffcov - - docs: - runs-on: ubuntu-latest - env: - TOXENV: docs - steps: - - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v4 - - name: Install tox - run: | - python -m pip install tox - - name: Run - run: tox + run: python -m pip install tox + - name: Eval ${{ matrix.job }} + run: tox -e ${{ matrix.job }} check: # This job does nothing and is only used for the branch protection if: always() needs: - test - - docs + - collateral runs-on: ubuntu-latest @@ -115,8 +101,7 @@ jobs: with: python-version: 3.x - name: Install tox - run: | - python -m pip install tox + run: python -m pip install tox - name: Run run: tox -e release env: From 26f420a97e73a2ab695023f6cc21f5c786d2b289 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 28 Nov 2023 11:43:20 -0500 Subject: [PATCH 169/206] Remove news fragment after allowing time to be processed downstream. --- newsfragments/+drop-py37.feature.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 newsfragments/+drop-py37.feature.rst diff --git a/newsfragments/+drop-py37.feature.rst b/newsfragments/+drop-py37.feature.rst deleted file mode 100644 index ccabdaa..0000000 --- a/newsfragments/+drop-py37.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Require Python 3.8 or later. From 33dd01267b6a886217bae3ebd5df5b689e2ab722 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 29 Nov 2023 13:21:17 -0500 Subject: [PATCH 170/206] Suppress deprecation warning in dateutil. Workaround for dateutil/dateutil#1284. --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index d9a15ed..f9533b5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -24,4 +24,7 @@ filterwarnings= # pypa/build#615 ignore:'encoding' argument not specified::build.env + # dateutil/dateutil#1284 + ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil.tz.tz + ## end upstream From 97a5f44787ac5a928534cdf724210c429621435c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 4 Dec 2023 15:53:37 -0500 Subject: [PATCH 171/206] Update Github Actions badge per actions/starter-workflows#1525. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index b703d49..41bcfbe 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ .. image:: https://img.shields.io/pypi/pyversions/PROJECT.svg -.. image:: https://github.com/PROJECT_PATH/workflows/tests/badge.svg +.. image:: https://github.com/PROJECT_PATH/actions/workflows/main.yml/badge.svg :target: https://github.com/PROJECT_PATH/actions?query=workflow%3A%22tests%22 :alt: tests From 8bff8b034a0bbf0273a38f0a0cc41e3a52b26864 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 5 Dec 2023 15:48:52 +0100 Subject: [PATCH 172/206] Enable testing merge queues @ GitHub Actions CI/CD (jaraco/skeleton#93) This allows org-hosted projects to start enabling merge queues in the repository settings. With that, GitHub would trigger a separate event against a merge commit derived from merging several pull requests with the target branch. --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9682985..387d01a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,11 @@ name: tests -on: [push, pull_request] +on: + merge_group: + push: + branches-ignore: + - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + pull_request: permissions: contents: read From e4bd6091a1fbe26fe113051f0f47875d627c7ed2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 11 Dec 2023 10:46:32 -0500 Subject: [PATCH 173/206] Separate collateral jobs on different lines for easier override/extension. --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 387d01a..a079bbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,9 @@ jobs: strategy: fail-fast: false matrix: - job: [diffcov, docs] + job: + - diffcov + - docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 596e6834c8a037c935338afe92e0b9c5ffa1768f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 19 Dec 2023 18:29:16 -0500 Subject: [PATCH 174/206] Drop minimum requirement on pytest-mypy as most environments are already running much later. Closes jaraco/skeleton#96. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4f184c7..20c5dd7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ testing = # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-cov - pytest-mypy >= 0.9.1; \ + pytest-mypy; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-enabler >= 2.2 From b8c6c1530ef937521b60aabb0ecd98a8b5dca761 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 23 Dec 2023 00:25:02 +0100 Subject: [PATCH 175/206] Use the ruff formatter (jaraco/skeleton#99) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use the ruff formatter, instead of black Based on: - ruff-pre-commit README.md | Using Ruff with pre-commit https://github.com/astral-sh/ruff-pre-commit/blob/main/README.md - The Ruff Formatter | Conflicting lint rules https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules Support for the ruff formatter was added to pytest-ruff by commits from October 2023, released the same day as versions 0.2 and 0.2.1. Hence, it makes sense to require pytest-ruff ≥ 0.2.1 now. Support for `quote-style = "preserve"` was added to ruff in the last couple of weeks, therefore require the latest version, ruff ≥ 0.1.8. This option is equivalent to `skip-string-normalization` in black. Closes jaraco/skeleton#101. --------- Co-authored-by: Jason R. Coombs --- .pre-commit-config.yaml | 7 ++++--- README.rst | 4 ---- pyproject.toml | 3 --- pytest.ini | 8 -------- ruff.toml | 22 ++++++++++++++++++++++ setup.cfg | 5 +---- 6 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 ruff.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af50201..5a4a7e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ repos: -- repo: https://github.com/psf/black - rev: 22.6.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.8 hooks: - - id: black + - id: ruff + - id: ruff-format diff --git a/README.rst b/README.rst index 41bcfbe..2fabcf3 100644 --- a/README.rst +++ b/README.rst @@ -11,10 +11,6 @@ :target: https://github.com/astral-sh/ruff :alt: Ruff -.. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Code style: Black - .. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest .. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest diff --git a/pyproject.toml b/pyproject.toml index dce944d..a853c57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,4 @@ requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" -[tool.black] -skip-string-normalization = true - [tool.setuptools_scm] diff --git a/pytest.ini b/pytest.ini index f9533b5..022a723 100644 --- a/pytest.ini +++ b/pytest.ini @@ -7,14 +7,6 @@ filterwarnings= # Ensure ResourceWarnings are emitted default::ResourceWarning - # shopkeep/pytest-black#55 - ignore: is not using a cooperative constructor:pytest.PytestDeprecationWarning - ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning - ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning - - # shopkeep/pytest-black#67 - ignore:'encoding' argument not specified::pytest_black - # realpython/pytest-mypy#152 ignore:'encoding' argument not specified::pytest_mypy diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..7ed133b --- /dev/null +++ b/ruff.toml @@ -0,0 +1,22 @@ +[lint] +extend-ignore = [ + # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules + "W191", + "E111", + "E114", + "E117", + "D206", + "D300", + "Q000", + "Q001", + "Q002", + "Q003", + "COM812", + "COM819", + "ISC001", + "ISC002", +] + +[format] +# https://docs.astral.sh/ruff/settings/#format-quote-style +quote-style = "preserve" diff --git a/setup.cfg b/setup.cfg index 20c5dd7..1d2729b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,15 +30,12 @@ testing = # upstream pytest >= 6 pytest-checkdocs >= 2.4 - pytest-black >= 0.3.7; \ - # workaround for jaraco/skeleton#22 - python_implementation != "PyPy" pytest-cov pytest-mypy; \ # workaround for jaraco/skeleton#22 python_implementation != "PyPy" pytest-enabler >= 2.2 - pytest-ruff + pytest-ruff >= 0.2.1 # local From a9c5dd5a4eab9f4132d62344cdbad24e077c650e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 24 Dec 2023 12:08:46 -0500 Subject: [PATCH 176/206] Remove sole entry for branches-ignore. Workaround for and closes jaraco/skeleton#103. --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a079bbf..cf94f7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,8 @@ on: merge_group: push: branches-ignore: - - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + # disabled for jaraco/skeleton#103 + # - gh-readonly-queue/** # Temporary merge queue-related GH-made branches pull_request: permissions: From db0d581685d4fc2a16d392d4dedffe622e9a355c Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 26 Dec 2023 15:58:23 +0100 Subject: [PATCH 177/206] =?UTF-8?q?ruff:=20extended-ignore=20=E2=86=92=20i?= =?UTF-8?q?gnore=20(jaraco/skeleton#105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applies Repo-Review suggestion: RF201: Avoid using deprecated config settings extend-ignore deprecated, use ignore instead (identical) --- ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff.toml b/ruff.toml index 7ed133b..795cca1 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ [lint] -extend-ignore = [ +ignore = [ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", "E111", From f6d9e107365ca270ec843898c05bb8e43dc6987a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 2 Jan 2024 17:56:53 -0500 Subject: [PATCH 178/206] Bump year on badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2fabcf3..efabeee 100644 --- a/README.rst +++ b/README.rst @@ -14,5 +14,5 @@ .. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest .. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest -.. image:: https://img.shields.io/badge/skeleton-2023-informational +.. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton From dbcb0747110d074112f27e2699856acfc4ba8ea3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 6 Jan 2024 20:09:59 -0500 Subject: [PATCH 179/206] Remove build and dist from excludes. It appears they are not needed and their presence blocks the names of packages like 'builder' and 'distutils'. Ref pypa/distutils#224. --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 1d2729b..c2e8287 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,8 +20,6 @@ install_requires = [options.packages.find] exclude = - build* - dist* docs* tests* From d27890573088a6a0292139c5e30466debd7dc1dd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Jan 2024 12:26:16 -0500 Subject: [PATCH 180/206] Exclude docs and tests directories properly per Setuptools behavior. --- setup.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index c2e8287..c5aa1af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,8 +20,11 @@ install_requires = [options.packages.find] exclude = - docs* - tests* + # duplicate exclusions for pypa/setuptools#2688 + docs + docs.* + tests + tests.* [options.extras_require] testing = From 63535c6efd3516a7ef35c862c24ef5b6d43c8494 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 7 Jan 2024 12:49:05 -0500 Subject: [PATCH 181/206] Rely on default discovery for good heuristics for finding packages. --- setup.cfg | 9 --------- 1 file changed, 9 deletions(-) diff --git a/setup.cfg b/setup.cfg index c5aa1af..fe99eaf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,19 +13,10 @@ classifiers = Programming Language :: Python :: 3 :: Only [options] -packages = find_namespace: include_package_data = true python_requires = >=3.8 install_requires = -[options.packages.find] -exclude = - # duplicate exclusions for pypa/setuptools#2688 - docs - docs.* - tests - tests.* - [options.extras_require] testing = # upstream From 29e5d34af962e59e92c501ebb988dcaf192b114e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 4 Feb 2024 10:15:04 -0500 Subject: [PATCH 182/206] Enable preview to enable preserving quotes. --- ruff.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruff.toml b/ruff.toml index 795cca1..e61ca8b 100644 --- a/ruff.toml +++ b/ruff.toml @@ -18,5 +18,7 @@ ignore = [ ] [format] +# Enable preview, required for quote-style = "preserve" +preview = true # https://docs.astral.sh/ruff/settings/#format-quote-style quote-style = "preserve" From 2a402a39f154d9a6cf4621e8c5d22bace749b55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Tue, 6 Feb 2024 23:01:32 +0100 Subject: [PATCH 183/206] Tweak coverage configuration for type checking (jaraco/skeleton#97) * Tweak coverage configuration for type checking * Use `exclude_also` instead of `exclude_lines` Co-authored-by: Sviatoslav Sydorenko * Add reference to the issue. --------- Co-authored-by: Sviatoslav Sydorenko Co-authored-by: Jason R. Coombs --- .coveragerc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.coveragerc b/.coveragerc index 0287948..35b98b1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -7,3 +7,7 @@ disable_warnings = [report] show_missing = True +exclude_also = + # jaraco/skeleton#97 + @overload + if TYPE_CHECKING: From 68ac292eb37ce92e992e6fab05a44ad86f32e8f1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Feb 2024 16:53:46 -0500 Subject: [PATCH 184/206] Use latest versions in RTD boilerplate. --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 053c728..6848906 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,6 +7,6 @@ python: # required boilerplate readthedocs/readthedocs.org#10401 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: "3" + python: latest From 178d254379ed260eb537f48722703f819eaa8235 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 12 Feb 2024 16:02:29 -0500 Subject: [PATCH 185/206] Remove Sphinx pin. Ref sphinx-doc/sphinx#11662. --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index fe99eaf..400a72a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,8 +34,6 @@ testing = docs = # upstream sphinx >= 3.5 - # workaround for sphinx/sphinx-doc#11662 - sphinx < 7.2.5 jaraco.packaging >= 9.3 rst.linker >= 1.9 furo From 779219ce3ecbf4477da062658a1d0b2d5bf4f77f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Feb 2024 10:38:06 -0500 Subject: [PATCH 186/206] Include deps from the base config in diffcov. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 331eeed..4c39a5b 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,7 @@ extras = [testenv:diffcov] description = run tests and check that diff from main is covered deps = + {[testenv]deps} diff-cover commands = pytest {posargs} --cov-report xml From d1c5444126aeacefee3949b30136446ab99979d8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 2 Mar 2024 10:33:21 -0500 Subject: [PATCH 187/206] Enable complexity check and pycodestyle warnings. Closes jaraco/skeleton#110. --- ruff.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruff.toml b/ruff.toml index e61ca8b..6c5b000 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,8 @@ [lint] +select = [ + "C901", + "W", +] ignore = [ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", From b434f69238b4ee517ae20978afa19f3cd1ed8f1f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 2 Mar 2024 14:05:46 -0500 Subject: [PATCH 188/206] Use 'extend-select' to avoid disabling the default config. Ref jaraco/skeleton#110. --- ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff.toml b/ruff.toml index 6c5b000..7061298 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,5 +1,5 @@ [lint] -select = [ +extend-select = [ "C901", "W", ] From a0d0c4b7e87fbfd04cee2546ba452858587516fd Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 21 Mar 2024 15:34:23 -0400 Subject: [PATCH 189/206] Allow mypy on PyPy (jaraco/skeleton#111) https://github.com/pypa/setuptools/pull/4257 shows that mypy now works with PyPy --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 400a72a..6fa73b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,9 +23,7 @@ testing = pytest >= 6 pytest-checkdocs >= 2.4 pytest-cov - pytest-mypy; \ - # workaround for jaraco/skeleton#22 - python_implementation != "PyPy" + pytest-mypy pytest-enabler >= 2.2 pytest-ruff >= 0.2.1 From c9a7f97ba83be124e173713f5c24564c2b6dd49e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 21 Mar 2024 15:49:52 -0400 Subject: [PATCH 190/206] Re-enable ignoring of temporary merge queue branches. Closes jaraco/skeleton#103. --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf94f7d..143b098 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,11 @@ on: merge_group: push: branches-ignore: - # disabled for jaraco/skeleton#103 - # - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + # temporary GH branches relating to merge queues (jaraco/skeleton#93) + - gh-readonly-queue/** + tags: + # required if branches-ignore is supplied (jaraco/skeleton#103) + - '**' pull_request: permissions: From d72c6a081b67ce18eae654bf3c8d2d627af6939e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 23 Mar 2024 13:46:21 -0400 Subject: [PATCH 191/206] Fetch unshallow clones in readthedocs. Closes jaraco/skeleton#114. --- .readthedocs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6848906..85dfea9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,3 +10,7 @@ build: os: ubuntu-lts-latest tools: python: latest + # post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114 + jobs: + post_checkout: + - git fetch --unshallow || true From 3fc7a935dfc0e5c8e330a29efc5518c464795cf8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Mar 2024 21:11:46 -0400 Subject: [PATCH 192/206] Move Python 3.11 out of the test matrix. Probably should have done this when moving continue-on-error to Python 3.13. --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 143b098..a15c74a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,6 @@ jobs: matrix: python: - "3.8" - - "3.11" - "3.12" platform: - ubuntu-latest @@ -45,6 +44,8 @@ jobs: platform: ubuntu-latest - python: "3.10" platform: ubuntu-latest + - python: "3.11" + platform: ubuntu-latest - python: pypy3.10 platform: ubuntu-latest runs-on: ${{ matrix.platform }} From 6ff02e0eefcd90e271cefd326b460ecfa0e3eb9e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 31 Mar 2024 04:27:11 -0400 Subject: [PATCH 193/206] Configure pytest to support namespace packages. Ref pytest-dev/pytest#12112. --- pytest.ini | 5 ++++- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 022a723..9a0f3bc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,9 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules +addopts= + --doctest-modules + --import-mode importlib +consider_namespace_packages=true filterwarnings= ## upstream diff --git a/setup.cfg b/setup.cfg index 6fa73b6..f46b6cb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ install_requires = [options.extras_require] testing = # upstream - pytest >= 6 + pytest >= 6, != 8.1.1 pytest-checkdocs >= 2.4 pytest-cov pytest-mypy From 34ba6b2ec0650c8c70d9285a0c7ee1a126406807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Mon, 1 Apr 2024 17:47:04 +0200 Subject: [PATCH 194/206] Add link to blog entry from jaraco/skeleton#115 above CI build matrix. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a15c74a..ac0ff69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ env: jobs: test: strategy: + # https://blog.jaraco.com/efficient-use-of-ci-resources/ matrix: python: - "3.8" From 7ad4f2fa9fb2b030d3ecc231fc24de181705622d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 16 Apr 2024 10:31:45 -0400 Subject: [PATCH 195/206] Pin against pytest 8.1.x due to pytest-dev/pytest#12194. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f46b6cb..05ac4c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ install_requires = [options.extras_require] testing = # upstream - pytest >= 6, != 8.1.1 + pytest >= 6, != 8.1.* pytest-checkdocs >= 2.4 pytest-cov pytest-mypy From 16710141936291c5525ee1f3569b62bcd3805b82 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 17 Apr 2024 19:19:25 -0400 Subject: [PATCH 196/206] Move changes to news to align with towncrier defaults --- CHANGES.rst => NEWS.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CHANGES.rst => NEWS.rst (100%) diff --git a/CHANGES.rst b/NEWS.rst similarity index 100% rename from CHANGES.rst rename to NEWS.rst From f08471b080c70ad0be5838f6b7009ee18873fc21 Mon Sep 17 00:00:00 2001 From: bswck Date: Thu, 18 Apr 2024 01:49:58 +0200 Subject: [PATCH 197/206] Reformat with Ruff --- kustomize/generators.py | 26 +++++++++--------- kustomize/main.py | 27 ++++++++++++------- tests/base.py | 4 +-- .../attributes_as_dict/python/configMap.py | 7 +++-- .../attributes_as_dict/python/deployment.py | 20 +++++++------- .../attributes_as_dict/python/service.py | 4 +-- tests/fixtures/attrs/python/deployment.py | 20 +++++++------- tests/fixtures/attrs/python/service.py | 4 +-- .../python/base/configMap.py | 2 +- .../python/base/deployment.py | 20 +++++++------- .../base_and_overlays/python/base/service.py | 4 +-- .../dataclasses_/python/deployment.py | 20 +++++++------- tests/fixtures/dataclasses_/python/service.py | 4 +-- tests/fixtures/kubernetes/python/configMap.py | 9 ++++--- .../fixtures/kubernetes/python/deployment.py | 20 +++++++------- tests/fixtures/kubernetes/python/service.py | 4 +-- .../fixtures/kubernetes11/python/configMap.py | 9 ++++--- .../kubernetes11/python/deployment.py | 20 +++++++------- tests/fixtures/kubernetes11/python/service.py | 4 +-- .../patchesJson6902/python/configMap.py | 2 +- .../patchesJson6902/python/deployment.py | 20 +++++++------- .../patchesJson6902/python/kustomization.py | 2 +- .../patchesJson6902/python/service.py | 4 +-- .../fixtures/simple_dict/python/deployment.py | 20 +++++++------- tests/fixtures/simple_dict/python/service.py | 4 +-- .../simple_dict_defaults/python/configMap.py | 2 +- .../simple_dict_defaults/python/deployment.py | 20 +++++++------- .../simple_dict_defaults/python/service.py | 4 +-- .../python/deployments/deployment.py | 20 +++++++------- .../python/services/service.py | 4 +-- tests/fixtures/to_dict/python/configMap.py | 7 +++-- tests/fixtures/to_dict/python/deployment.py | 20 +++++++------- tests/fixtures/to_dict/python/service.py | 4 +-- .../tuple_multiple/python/configMap.py | 4 +-- .../tuple_multiple/python/deployment.py | 20 +++++++------- .../fixtures/tuple_multiple/python/service.py | 4 +-- .../tuple_multiple_attr/python/deployment.py | 20 +++++++------- .../tuple_multiple_attr/python/service.py | 4 +-- tests/test_main.py | 9 ++++--- 39 files changed, 221 insertions(+), 201 deletions(-) diff --git a/kustomize/generators.py b/kustomize/generators.py index 02c9329..f941e89 100644 --- a/kustomize/generators.py +++ b/kustomize/generators.py @@ -60,12 +60,11 @@ def build(self, dest_path: Path) -> Path: return self.build_path -def generate( - source_path: Path, dest_path: Path, attr_name: str = 'kustomization'): +def generate(source_path: Path, dest_path: Path, attr_name: str = 'kustomization'): source_path = source_path.absolute() dest_path = dest_path.absolute() - for (dirpath, dirnames, filenames) in os.walk(str(source_path)): + for dirpath, dirnames, filenames in os.walk(str(source_path)): for dirname in dirnames: down_source_path = source_path / dirname down_dest_path = dest_path / dirname @@ -78,8 +77,7 @@ def _generate_for_source(source_path: Path, dest_path: Path, attr_name: str): if not (source_path / 'kustomization.py').is_file(): return - logger.info( - 'Generating kustomization from %s to %s', source_path, dest_path) + logger.info('Generating kustomization from %s to %s', source_path, dest_path) prepended = False source_path_str = str(source_path) @@ -99,7 +97,7 @@ def _generate_for_source(source_path: Path, dest_path: Path, attr_name: str): def _dump_data(data, path): logger.debug('Dumping data into %s', path) os.makedirs(os.path.dirname(path), mode=0o755, exist_ok=True) - with open(str(path), 'w') as f: + with open(str(path), 'w', encoding='utf-8') as f: if isinstance(data, tuple): yaml.safe_dump_all(clean_data(data), f) else: @@ -138,8 +136,7 @@ def _get_kustomization_data(attr_name, dest_path): if kustomization.get(extension_name) is None: continue extensions = [ - Extension.from_reference(string) - for string in kustomization[extension_name] + Extension.from_reference(string) for string in kustomization[extension_name] ] kustomization[extension_name] = [ str(resource.build(dest_path)) for resource in extensions @@ -165,11 +162,12 @@ def is_attr_class(obj) -> bool: def _is_kubernetes(obj): return ( - hasattr(obj, 'to_dict') and - hasattr(obj, 'attribute_map') and - ( + hasattr(obj, 'to_dict') + and hasattr(obj, 'attribute_map') + and ( # python-kubernetes<11 - hasattr(obj, 'swagger_types') or + hasattr(obj, 'swagger_types') + or # python-kubernetes>=11 hasattr(obj, 'openapi_types') ) @@ -212,8 +210,7 @@ def _k8s_to_serializable(obj): def to_dict_or_dicts(obj): - logger.debug( - 'Transforming object of type %s into dict or dicts', type(obj)) + logger.debug('Transforming object of type %s into dict or dicts', type(obj)) if isinstance(obj, tuple): return tuple(to_dict_or_dicts(o) for o in obj) if _is_kubernetes(obj): @@ -228,6 +225,7 @@ def to_dict_or_dicts(obj): elif is_attr_class(obj): logger.debug('Object is from attr class, using it for conversion') import attr + obj = attr.asdict(obj, recurse=True) elif hasattr(obj, '__dict__'): obj = obj.__dict__ diff --git a/kustomize/main.py b/kustomize/main.py index d1de796..3d0b987 100644 --- a/kustomize/main.py +++ b/kustomize/main.py @@ -5,28 +5,35 @@ def _get_options(args): - parser = argparse.ArgumentParser(description=""" + parser = argparse.ArgumentParser( + description=""" Generates a kustomization directory based on similar Python files. The generated directory can then be used by Kustomize. - """) + """ + ) parser.add_argument( - '--attr-name', '-a', default='kustomization', required=False, - help='Name of the attribute from the kustomization.py files.' + '--attr-name', + '-a', + default='kustomization', + required=False, + help='Name of the attribute from the kustomization.py files.', ) parser.add_argument( - '--verbose', '-v', default=False, action='store_true', - help='Print debug logs to stdout.' + '--verbose', + '-v', + default=False, + action='store_true', + help='Print debug logs to stdout.', ) parser.add_argument( - 'source_path', - help='Source directory with Python kustomization files.' + 'source_path', help='Source directory with Python kustomization files.' ) parser.add_argument( 'dest_path', help=( - 'Destination directory where the Kustomize YAML files will be ' - 'put at.') + 'Destination directory where the Kustomize YAML files will be ' 'put at.' + ), ) return parser.parse_args(args) diff --git a/tests/base.py b/tests/base.py index 545cd62..8c08c1d 100644 --- a/tests/base.py +++ b/tests/base.py @@ -10,9 +10,9 @@ def assert_yaml_dirs_equal(a, b): assert len(a_files) == len(b_files) for a_file, b_file in zip(a_files, b_files): - with open(str(a_file)) as f: + with open(str(a_file), encoding='utf-8') as f: a_data = tuple(yaml.safe_load_all(f)) - with open(str(b_file)) as f: + with open(str(b_file), encoding='utf-8') as f: b_data = tuple(yaml.safe_load_all(f)) for a_datum, b_datum in zip(a_data, b_data): diff --git a/tests/fixtures/attributes_as_dict/python/configMap.py b/tests/fixtures/attributes_as_dict/python/configMap.py index de10434..126dc28 100644 --- a/tests/fixtures/attributes_as_dict/python/configMap.py +++ b/tests/fixtures/attributes_as_dict/python/configMap.py @@ -12,8 +12,11 @@ class ConfigMap: kind: str = 'ConfigMap' def __init__( - self, metadata: Metadata, data: dict, - apiVersion: str = 'v1', kind: str = 'ConfigMap', + self, + metadata: Metadata, + data: dict, + apiVersion: str = 'v1', + kind: str = 'ConfigMap', ): self.metadata = metadata.__dict__ self.data = data diff --git a/tests/fixtures/attributes_as_dict/python/deployment.py b/tests/fixtures/attributes_as_dict/python/deployment.py index 2968c95..41a2921 100644 --- a/tests/fixtures/attributes_as_dict/python/deployment.py +++ b/tests/fixtures/attributes_as_dict/python/deployment.py @@ -16,8 +16,7 @@ def to_dict(self) -> dict: 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -26,24 +25,25 @@ def to_dict(self) -> dict: 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/attributes_as_dict/python/service.py b/tests/fixtures/attributes_as_dict/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/attributes_as_dict/python/service.py +++ b/tests/fixtures/attributes_as_dict/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/attrs/python/deployment.py b/tests/fixtures/attrs/python/deployment.py index 2968c95..41a2921 100644 --- a/tests/fixtures/attrs/python/deployment.py +++ b/tests/fixtures/attrs/python/deployment.py @@ -16,8 +16,7 @@ def to_dict(self) -> dict: 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -26,24 +25,25 @@ def to_dict(self) -> dict: 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/attrs/python/service.py b/tests/fixtures/attrs/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/attrs/python/service.py +++ b/tests/fixtures/attrs/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/base_and_overlays/python/base/configMap.py b/tests/fixtures/base_and_overlays/python/base/configMap.py index 4f05a3d..c1be817 100644 --- a/tests/fixtures/base_and_overlays/python/base/configMap.py +++ b/tests/fixtures/base_and_overlays/python/base/configMap.py @@ -2,5 +2,5 @@ 'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'the-map'}, - 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'} + 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, } diff --git a/tests/fixtures/base_and_overlays/python/base/deployment.py b/tests/fixtures/base_and_overlays/python/base/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/base_and_overlays/python/base/deployment.py +++ b/tests/fixtures/base_and_overlays/python/base/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/base_and_overlays/python/base/service.py b/tests/fixtures/base_and_overlays/python/base/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/base_and_overlays/python/base/service.py +++ b/tests/fixtures/base_and_overlays/python/base/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/dataclasses_/python/deployment.py b/tests/fixtures/dataclasses_/python/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/dataclasses_/python/deployment.py +++ b/tests/fixtures/dataclasses_/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/dataclasses_/python/service.py b/tests/fixtures/dataclasses_/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/dataclasses_/python/service.py +++ b/tests/fixtures/dataclasses_/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/kubernetes/python/configMap.py b/tests/fixtures/kubernetes/python/configMap.py index 0b483b9..540e674 100644 --- a/tests/fixtures/kubernetes/python/configMap.py +++ b/tests/fixtures/kubernetes/python/configMap.py @@ -39,8 +39,11 @@ class ConfigMap: } def __init__( - self, metadata: Metadata, data: dict, - api_version: str = 'v1', kind: str = 'ConfigMap', + self, + metadata: Metadata, + data: dict, + api_version: str = 'v1', + kind: str = 'ConfigMap', ): self.metadata = metadata self.data = data @@ -64,7 +67,7 @@ def to_dict(self) -> dict: 'ignore': None, 'numbers': [1, 2], 'others': (3, 4), - } + }, ), data={'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, ) diff --git a/tests/fixtures/kubernetes/python/deployment.py b/tests/fixtures/kubernetes/python/deployment.py index 2968c95..41a2921 100644 --- a/tests/fixtures/kubernetes/python/deployment.py +++ b/tests/fixtures/kubernetes/python/deployment.py @@ -16,8 +16,7 @@ def to_dict(self) -> dict: 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -26,24 +25,25 @@ def to_dict(self) -> dict: 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/kubernetes/python/service.py b/tests/fixtures/kubernetes/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/kubernetes/python/service.py +++ b/tests/fixtures/kubernetes/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/kubernetes11/python/configMap.py b/tests/fixtures/kubernetes11/python/configMap.py index 5295c3b..4429514 100644 --- a/tests/fixtures/kubernetes11/python/configMap.py +++ b/tests/fixtures/kubernetes11/python/configMap.py @@ -39,8 +39,11 @@ class ConfigMap: } def __init__( - self, metadata: Metadata, data: dict, - api_version: str = 'v1', kind: str = 'ConfigMap', + self, + metadata: Metadata, + data: dict, + api_version: str = 'v1', + kind: str = 'ConfigMap', ): self.metadata = metadata self.data = data @@ -64,7 +67,7 @@ def to_dict(self) -> dict: 'ignore': None, 'numbers': [1, 2], 'others': (3, 4), - } + }, ), data={'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, ) diff --git a/tests/fixtures/kubernetes11/python/deployment.py b/tests/fixtures/kubernetes11/python/deployment.py index 2968c95..41a2921 100644 --- a/tests/fixtures/kubernetes11/python/deployment.py +++ b/tests/fixtures/kubernetes11/python/deployment.py @@ -16,8 +16,7 @@ def to_dict(self) -> dict: 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -26,24 +25,25 @@ def to_dict(self) -> dict: 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/kubernetes11/python/service.py b/tests/fixtures/kubernetes11/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/kubernetes11/python/service.py +++ b/tests/fixtures/kubernetes11/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/patchesJson6902/python/configMap.py b/tests/fixtures/patchesJson6902/python/configMap.py index 4f05a3d..c1be817 100644 --- a/tests/fixtures/patchesJson6902/python/configMap.py +++ b/tests/fixtures/patchesJson6902/python/configMap.py @@ -2,5 +2,5 @@ 'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'the-map'}, - 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'} + 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, } diff --git a/tests/fixtures/patchesJson6902/python/deployment.py b/tests/fixtures/patchesJson6902/python/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/patchesJson6902/python/deployment.py +++ b/tests/fixtures/patchesJson6902/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/patchesJson6902/python/kustomization.py b/tests/fixtures/patchesJson6902/python/kustomization.py index 8d0c84d..53fbd32 100644 --- a/tests/fixtures/patchesJson6902/python/kustomization.py +++ b/tests/fixtures/patchesJson6902/python/kustomization.py @@ -16,5 +16,5 @@ }, 'path': 'add_init_container', }, - ] + ], } diff --git a/tests/fixtures/patchesJson6902/python/service.py b/tests/fixtures/patchesJson6902/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/patchesJson6902/python/service.py +++ b/tests/fixtures/patchesJson6902/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/simple_dict/python/deployment.py b/tests/fixtures/simple_dict/python/deployment.py index 8649a02..608a3b3 100644 --- a/tests/fixtures/simple_dict/python/deployment.py +++ b/tests/fixtures/simple_dict/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/simple_dict/python/service.py b/tests/fixtures/simple_dict/python/service.py index 4ec7fe4..7d78005 100644 --- a/tests/fixtures/simple_dict/python/service.py +++ b/tests/fixtures/simple_dict/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/simple_dict_defaults/python/configMap.py b/tests/fixtures/simple_dict_defaults/python/configMap.py index 4f05a3d..c1be817 100644 --- a/tests/fixtures/simple_dict_defaults/python/configMap.py +++ b/tests/fixtures/simple_dict_defaults/python/configMap.py @@ -2,5 +2,5 @@ 'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'the-map'}, - 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'} + 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, } diff --git a/tests/fixtures/simple_dict_defaults/python/deployment.py b/tests/fixtures/simple_dict_defaults/python/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/simple_dict_defaults/python/deployment.py +++ b/tests/fixtures/simple_dict_defaults/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/simple_dict_defaults/python/service.py b/tests/fixtures/simple_dict_defaults/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/simple_dict_defaults/python/service.py +++ b/tests/fixtures/simple_dict_defaults/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/simple_dict_subdirs/python/deployments/deployment.py b/tests/fixtures/simple_dict_subdirs/python/deployments/deployment.py index 8649a02..608a3b3 100644 --- a/tests/fixtures/simple_dict_subdirs/python/deployments/deployment.py +++ b/tests/fixtures/simple_dict_subdirs/python/deployments/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/simple_dict_subdirs/python/services/service.py b/tests/fixtures/simple_dict_subdirs/python/services/service.py index 4ec7fe4..7d78005 100644 --- a/tests/fixtures/simple_dict_subdirs/python/services/service.py +++ b/tests/fixtures/simple_dict_subdirs/python/services/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/to_dict/python/configMap.py b/tests/fixtures/to_dict/python/configMap.py index 7d11416..70eeadc 100644 --- a/tests/fixtures/to_dict/python/configMap.py +++ b/tests/fixtures/to_dict/python/configMap.py @@ -17,8 +17,11 @@ class ConfigMap: kind: str = 'ConfigMap' def __init__( - self, metadata: Metadata, data: dict, - apiVersion: str = 'v1', kind: str = 'ConfigMap', + self, + metadata: Metadata, + data: dict, + apiVersion: str = 'v1', + kind: str = 'ConfigMap', ): self.metadata = metadata self.data = data diff --git a/tests/fixtures/to_dict/python/deployment.py b/tests/fixtures/to_dict/python/deployment.py index 2968c95..41a2921 100644 --- a/tests/fixtures/to_dict/python/deployment.py +++ b/tests/fixtures/to_dict/python/deployment.py @@ -16,8 +16,7 @@ def to_dict(self) -> dict: 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -26,24 +25,25 @@ def to_dict(self) -> dict: 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/to_dict/python/service.py b/tests/fixtures/to_dict/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/to_dict/python/service.py +++ b/tests/fixtures/to_dict/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/tuple_multiple/python/configMap.py b/tests/fixtures/tuple_multiple/python/configMap.py index 4419c03..d1d2280 100644 --- a/tests/fixtures/tuple_multiple/python/configMap.py +++ b/tests/fixtures/tuple_multiple/python/configMap.py @@ -3,12 +3,12 @@ 'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'the-map'}, - 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'} + 'data': {'altGreeting': 'Good Morning!', 'enableRisky': 'false'}, }, { 'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'another-map'}, - 'data': {'altGreeting': 'Good Evening!', 'enableRisky': 'true'} + 'data': {'altGreeting': 'Good Evening!', 'enableRisky': 'true'}, }, ) diff --git a/tests/fixtures/tuple_multiple/python/deployment.py b/tests/fixtures/tuple_multiple/python/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/tuple_multiple/python/deployment.py +++ b/tests/fixtures/tuple_multiple/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/tuple_multiple/python/service.py b/tests/fixtures/tuple_multiple/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/tuple_multiple/python/service.py +++ b/tests/fixtures/tuple_multiple/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/fixtures/tuple_multiple_attr/python/deployment.py b/tests/fixtures/tuple_multiple_attr/python/deployment.py index a2740c1..964d100 100644 --- a/tests/fixtures/tuple_multiple_attr/python/deployment.py +++ b/tests/fixtures/tuple_multiple_attr/python/deployment.py @@ -14,8 +14,7 @@ 'command': [ '/hello', '--port=8080', - '--enableRiskyFeature=$(' - 'ENABLE_RISKY)', + '--enableRiskyFeature=$(' 'ENABLE_RISKY)', ], 'ports': [{'containerPort': 8080}], 'env': [ @@ -24,22 +23,23 @@ 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'altGreeting' + 'key': 'altGreeting', } - } + }, }, { 'name': 'ENABLE_RISKY', 'valueFrom': { 'configMapKeyRef': { 'name': 'the-map', - 'key': 'enableRisky' + 'key': 'enableRisky', } - } + }, }, ], - }] - } - } - } + } + ] + }, + }, + }, } diff --git a/tests/fixtures/tuple_multiple_attr/python/service.py b/tests/fixtures/tuple_multiple_attr/python/service.py index a0c566d..bb46770 100644 --- a/tests/fixtures/tuple_multiple_attr/python/service.py +++ b/tests/fixtures/tuple_multiple_attr/python/service.py @@ -5,6 +5,6 @@ 'spec': { 'selector': {'deployment': 'hello'}, 'type': 'LoadBalancer', - 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}] - } + 'ports': [{'protocol': 'TCP', 'port': 8666, 'targetPort': 8080}], + }, } diff --git a/tests/test_main.py b/tests/test_main.py index a2a0edb..5f29987 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -9,7 +9,8 @@ def test_generates_simple_dict(cd_fixtures, create_build_path): reference_path = fixtures_path / 'reference' args = [ - '--attr-name', 'my_kustomization', + '--attr-name', + 'my_kustomization', str(python_path), str(build_path), ] @@ -26,7 +27,8 @@ def test_generates_simple_dict_verbose(cd_fixtures, create_build_path): reference_path = fixtures_path / 'reference' args = [ - '--attr-name', 'my_kustomization', + '--attr-name', + 'my_kustomization', '--verbose', str(python_path), str(build_path), @@ -44,7 +46,8 @@ def test_generates_simple_dict_with_subdirs(cd_fixtures, create_build_path): reference_path = fixtures_path / 'reference' args = [ - '--attr-name', 'my_kustomization', + '--attr-name', + 'my_kustomization', str(python_path), str(build_path), ] From 103552116abcde71bf523b9bf2a26117f1187e1b Mon Sep 17 00:00:00 2001 From: bswck Date: Thu, 18 Apr 2024 01:50:41 +0200 Subject: [PATCH 198/206] Add `types-PyYAML` to `testing` extras Fixes mypy reporting failure --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index b6b6d63..9b2c8ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,6 +30,7 @@ testing = # local coverage PyYAML + types-PyYAML docs = # upstream From 4eac55e45e0dd3dbfe414d337115532654a57508 Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 21:34:05 -0300 Subject: [PATCH 199/206] Fixing tests by sorting reference and built files. --- tests/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/base.py b/tests/base.py index 8c08c1d..7d473ee 100644 --- a/tests/base.py +++ b/tests/base.py @@ -4,8 +4,8 @@ def assert_yaml_dirs_equal(a, b): - a_files = list(Path(a).rglob('*.yaml')) - b_files = list(Path(b).rglob('*.yaml')) + a_files = sorted(Path(a).rglob('*.yaml')) + b_files = sorted(Path(b).rglob('*.yaml')) assert len(a_files) == len(b_files) @@ -16,7 +16,7 @@ def assert_yaml_dirs_equal(a, b): b_data = tuple(yaml.safe_load_all(f)) for a_datum, b_datum in zip(a_data, b_data): - assert a_data == b_data, f""" + assert a_datum == b_datum, f""" Got from {a}: {a_data} Expected from {b}: {b_data} """ From 3532009b47339b7fc9ec74842126496df7718f6d Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 22:11:36 -0300 Subject: [PATCH 200/206] Using PATH_SEPARATOR replacement to make sure tests run fine on Windows. --- tests/base.py | 16 ++++++++++++---- .../reference/kustomization.yaml | 6 +++--- .../fixtures/attrs/reference/kustomization.yaml | 6 +++--- .../reference/base/kustomization.yaml | 6 +++--- .../dataclasses_/reference/kustomization.yaml | 6 +++--- .../kubernetes/reference/kustomization.yaml | 6 +++--- .../kubernetes11/reference/kustomization.yaml | 6 +++--- .../patchesJson6902/reference/kustomization.yaml | 6 +++--- .../reference/kustomization.yaml | 6 +++--- .../to_dict/reference/kustomization.yaml | 6 +++--- .../tuple_multiple/reference/kustomization.yaml | 6 +++--- .../reference/kustomization.yaml | 6 +++--- 12 files changed, 45 insertions(+), 37 deletions(-) diff --git a/tests/base.py b/tests/base.py index 7d473ee..43f915e 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,3 +1,5 @@ +import io +import os.path from pathlib import Path import yaml @@ -10,13 +12,19 @@ def assert_yaml_dirs_equal(a, b): assert len(a_files) == len(b_files) for a_file, b_file in zip(a_files, b_files): - with open(str(a_file), encoding='utf-8') as f: - a_data = tuple(yaml.safe_load_all(f)) - with open(str(b_file), encoding='utf-8') as f: - b_data = tuple(yaml.safe_load_all(f)) + a_data = _load_tuple_data(a_file) + b_data = _load_tuple_data(b_file) for a_datum, b_datum in zip(a_data, b_data): assert a_datum == b_datum, f""" Got from {a}: {a_data} Expected from {b}: {b_data} """ + + +def _load_tuple_data(file): + with open(str(file), encoding='utf-8') as f: + content = f.read() + replaced = content.replace('${PATH_SEPARATOR}', os.path.sep) + buffer = io.StringIO(replaced) + return tuple(yaml.safe_load_all(buffer)) diff --git a/tests/fixtures/attributes_as_dict/reference/kustomization.yaml b/tests/fixtures/attributes_as_dict/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/attributes_as_dict/reference/kustomization.yaml +++ b/tests/fixtures/attributes_as_dict/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/attrs/reference/kustomization.yaml b/tests/fixtures/attrs/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/attrs/reference/kustomization.yaml +++ b/tests/fixtures/attrs/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/base_and_overlays/reference/base/kustomization.yaml b/tests/fixtures/base_and_overlays/reference/base/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/base_and_overlays/reference/base/kustomization.yaml +++ b/tests/fixtures/base_and_overlays/reference/base/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/dataclasses_/reference/kustomization.yaml b/tests/fixtures/dataclasses_/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/dataclasses_/reference/kustomization.yaml +++ b/tests/fixtures/dataclasses_/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/kubernetes/reference/kustomization.yaml b/tests/fixtures/kubernetes/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/kubernetes/reference/kustomization.yaml +++ b/tests/fixtures/kubernetes/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/kubernetes11/reference/kustomization.yaml b/tests/fixtures/kubernetes11/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/kubernetes11/reference/kustomization.yaml +++ b/tests/fixtures/kubernetes11/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/patchesJson6902/reference/kustomization.yaml b/tests/fixtures/patchesJson6902/reference/kustomization.yaml index 90d9f8b..1ee09fd 100644 --- a/tests/fixtures/patchesJson6902/reference/kustomization.yaml +++ b/tests/fixtures/patchesJson6902/reference/kustomization.yaml @@ -4,9 +4,9 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml patchesJson6902: - target: diff --git a/tests/fixtures/simple_dict_defaults/reference/kustomization.yaml b/tests/fixtures/simple_dict_defaults/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/simple_dict_defaults/reference/kustomization.yaml +++ b/tests/fixtures/simple_dict_defaults/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/to_dict/reference/kustomization.yaml b/tests/fixtures/to_dict/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/to_dict/reference/kustomization.yaml +++ b/tests/fixtures/to_dict/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/tuple_multiple/reference/kustomization.yaml b/tests/fixtures/tuple_multiple/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/tuple_multiple/reference/kustomization.yaml +++ b/tests/fixtures/tuple_multiple/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml diff --git a/tests/fixtures/tuple_multiple_attr/reference/kustomization.yaml b/tests/fixtures/tuple_multiple_attr/reference/kustomization.yaml index ad232ef..11fd7c2 100644 --- a/tests/fixtures/tuple_multiple_attr/reference/kustomization.yaml +++ b/tests/fixtures/tuple_multiple_attr/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/deployment.yaml -- service/service.yaml -- configMap/configMap.yaml +- deployment${PATH_SEPARATOR}deployment.yaml +- service${PATH_SEPARATOR}service.yaml +- configMap${PATH_SEPARATOR}configMap.yaml From 78272f48203ccbfc01a9d8372056007bf7811900 Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 22:14:09 -0300 Subject: [PATCH 201/206] Using friendlier Path open method. --- tests/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/base.py b/tests/base.py index 43f915e..dc522b3 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,11 +1,12 @@ import io import os.path from pathlib import Path +from typing import Any, Tuple import yaml -def assert_yaml_dirs_equal(a, b): +def assert_yaml_dirs_equal(a: str, b: str) -> None: a_files = sorted(Path(a).rglob('*.yaml')) b_files = sorted(Path(b).rglob('*.yaml')) @@ -22,8 +23,8 @@ def assert_yaml_dirs_equal(a, b): """ -def _load_tuple_data(file): - with open(str(file), encoding='utf-8') as f: +def _load_tuple_data(file: Path) -> Tuple[Any, ...]: + with file.open(encoding='utf-8') as f: content = f.read() replaced = content.replace('${PATH_SEPARATOR}', os.path.sep) buffer = io.StringIO(replaced) From 0ac8a858f3e993cd07f8fc0a32c1f466f01f1fd7 Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 22:32:39 -0300 Subject: [PATCH 202/206] Replacing some remaining directory separators. --- tests/fixtures/patchesJson6902/reference/kustomization.yaml | 2 +- tests/fixtures/simple_dict/reference/kustomization.yaml | 6 +++--- .../simple_dict_subdirs/reference/kustomization.yaml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/fixtures/patchesJson6902/reference/kustomization.yaml b/tests/fixtures/patchesJson6902/reference/kustomization.yaml index 1ee09fd..2f64c0e 100644 --- a/tests/fixtures/patchesJson6902/reference/kustomization.yaml +++ b/tests/fixtures/patchesJson6902/reference/kustomization.yaml @@ -13,4 +13,4 @@ patchesJson6902: version: v1 kind: Deployment name: my-deployment - path: add_init_container/add_init_container.yaml + path: add_init_container${PATH_SEPARATOR}add_init_container.yaml diff --git a/tests/fixtures/simple_dict/reference/kustomization.yaml b/tests/fixtures/simple_dict/reference/kustomization.yaml index 2ea51de..a36e8ef 100644 --- a/tests/fixtures/simple_dict/reference/kustomization.yaml +++ b/tests/fixtures/simple_dict/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployment/my_deployment.yaml -- service/my_service.yaml -- configMap/my_config_map.yaml +- deployment${PATH_SEPARATOR}my_deployment.yaml +- service${PATH_SEPARATOR}my_service.yaml +- configMap${PATH_SEPARATOR}my_config_map.yaml diff --git a/tests/fixtures/simple_dict_subdirs/reference/kustomization.yaml b/tests/fixtures/simple_dict_subdirs/reference/kustomization.yaml index f505ae1..ee0a42c 100644 --- a/tests/fixtures/simple_dict_subdirs/reference/kustomization.yaml +++ b/tests/fixtures/simple_dict_subdirs/reference/kustomization.yaml @@ -4,6 +4,6 @@ commonLabels: app: hello resources: -- deployments/deployment/my_deployment.yaml -- services/service/my_service.yaml -- configmaps/configMap/my_config_map.yaml +- deployments${PATH_SEPARATOR}deployment${PATH_SEPARATOR}my_deployment.yaml +- services${PATH_SEPARATOR}service${PATH_SEPARATOR}my_service.yaml +- configmaps${PATH_SEPARATOR}configMap${PATH_SEPARATOR}my_config_map.yaml From e7e623fbbc32a20f1723c17cfec7464212d722e9 Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 22:35:29 -0300 Subject: [PATCH 203/206] Hopefully the last remaining replacement for directories to make Windows happy. --- .../reference/overlays/production/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/base_and_overlays/reference/overlays/production/kustomization.yaml b/tests/fixtures/base_and_overlays/reference/overlays/production/kustomization.yaml index 9c15169..b933bd3 100644 --- a/tests/fixtures/base_and_overlays/reference/overlays/production/kustomization.yaml +++ b/tests/fixtures/base_and_overlays/reference/overlays/production/kustomization.yaml @@ -3,4 +3,4 @@ commonLabels: bases: - ../../base patches: - - replica_count/replica_count.yaml + - replica_count${PATH_SEPARATOR}replica_count.yaml From 47a0cf67ae97ac58307ff3afc561e0d10cbf912e Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 22:41:36 -0300 Subject: [PATCH 204/206] Hopefully the last remaining replacement for directories to make Windows happy. --- .../reference/overlays/staging/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/base_and_overlays/reference/overlays/staging/kustomization.yaml b/tests/fixtures/base_and_overlays/reference/overlays/staging/kustomization.yaml index 7cc7d4a..a056a25 100644 --- a/tests/fixtures/base_and_overlays/reference/overlays/staging/kustomization.yaml +++ b/tests/fixtures/base_and_overlays/reference/overlays/staging/kustomization.yaml @@ -3,4 +3,4 @@ commonLabels: bases: - ../../base patchesStrategicMerge: - - special_labels/special_labels.yaml + - special_labels${PATH_SEPARATOR}special_labels.yaml From 358b35366fea327f1a4be1f115b6fa649185b82d Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 23:05:28 -0300 Subject: [PATCH 205/206] Apply suggestions from code review --- docs/history.rst | 2 +- docs/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/history.rst b/docs/history.rst index 5bdc232..9c91f2a 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -5,4 +5,4 @@ History ******* -.. include:: ../NEWS (links).rst +.. include:: ../NEWS.rst diff --git a/docs/index.rst b/docs/index.rst index 76baa83..048b100 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -Welcome to |project| documentation! +Welcome to the |project| documentation! =================================== .. sidebar-links:: From a923c1f2313836a0fc2538494c596c38607946d7 Mon Sep 17 00:00:00 2001 From: Diogo Baeder Date: Wed, 17 Apr 2024 23:19:14 -0300 Subject: [PATCH 206/206] Fixing underline for title. --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 048b100..238218d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ Welcome to the |project| documentation! -=================================== +======================================= .. sidebar-links:: :home: