diff --git a/.editorconfig b/.editorconfig index 919b411..5b3c112 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file # # EditorConfig Configuration file, for more details see: @@ -13,7 +13,8 @@ root = true -[*] # For All Files +[*] +# Default settings for all files. # Unix-style newlines with a newline ending every file end_of_line = lf insert_final_newline = true @@ -29,13 +30,15 @@ max_line_length = off # 4 space indentation indent_size = 4 -[*.{yml,zpt,pt,dtml,zcml}] +[*.{yml,zpt,pt,dtml,zcml,html,xml}] # 2 space indentation indent_size = 2 -[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development +[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] +# Frontend development # 2 space indentation indent_size = 2 +max_line_length = 80 [{Makefile,.gitmodules}] # Tab indentation (no size specified, but view as 4 spaces) diff --git a/.flake8 b/.flake8 index 7ef4f64..38918f4 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [flake8] doctests = 1 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 4748f0f..ebb4cd0 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file name: Meta on: @@ -13,16 +13,66 @@ on: - main workflow_dispatch: +## +# To set environment variables for all jobs, add in .meta.toml: +# [github] +# env = """ +# debug: 1 +# image-name: 'org/image' +# image-tag: 'latest' +# """ +## + jobs: qa: - uses: plone/meta/.github/workflows/qa.yml@master + uses: plone/meta/.github/workflows/qa.yml@main test: - uses: plone/meta/.github/workflows/test.yml@master + uses: plone/meta/.github/workflows/test.yml@main + with: + + py-versions: '["3.12", "3.11", "3.10", "3.9", "3.8"]' coverage: - uses: plone/meta/.github/workflows/coverage.yml@master + uses: plone/meta/.github/workflows/coverage.yml@main dependencies: - uses: plone/meta/.github/workflows/dependencies.yml@master - release-ready: - uses: plone/meta/.github/workflows/release_ready.yml@master + uses: plone/meta/.github/workflows/dependencies.yml@main + release_ready: + uses: plone/meta/.github/workflows/release_ready.yml@main circular: - uses: plone/meta/.github/workflows/circular.yml@master + uses: plone/meta/.github/workflows/circular.yml@main + +## +# To modify the list of default jobs being created add in .meta.toml: +# [github] +# jobs = [ +# "qa", +# "test", +# "coverage", +# "dependencies", +# "release_ready", +# "circular", +# ] +## + +## +# To request that some OS level dependencies get installed +# when running tests/coverage jobs, add in .meta.toml: +# [github] +# os_dependencies = "git libxml2 libxslt" +## + +## +# To test against a specific matrix of python versions +# when running tests jobs, add in .meta.toml: +# [github] +# py_versions = "['3.12', '3.11']" +## + + +## +# Specify additional jobs in .meta.toml: +# [github] +# extra_lines = """ +# another: +# uses: org/repo/.github/workflows/file.yml@main +# """ +## diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 8c1d5bf..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: tests - -on: - push: - branches: [ master ] - pull_request: - # Allow to run this workflow manually from the Actions tab - workflow_dispatch: -jobs: - build: - strategy: - fail-fast: false - matrix: - python_version: ["3.8", "3.9", "3.10", "3.11", "pypy3.9"] - runs-on: ubuntu-latest - name: ${{ matrix.python_version }} - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test - run: python -m tox diff --git a/.gitignore b/.gitignore index 0690a90..486392f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,18 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file # python related *.egg-info *.pyc *.pyo +# translation related +*.mo + # tools related build/ .coverage +.*project coverage.xml dist/ docs/_build @@ -24,12 +28,14 @@ eggs/ .eggs/ etc/ .installed.cfg +include/ lib/ lib64 .mr.developer.cfg parts/ pyvenv.cfg var/ +local.cfg # mxdev /instance/ diff --git a/.meta.toml b/.meta.toml index 5bbcede..11e08bb 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,28 +1,13 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "237ff4c8" +commit-id = "4b86f8f1" [pyproject] dependencies_ignores = "['zope.testing']" +codespell_ignores = "whit" -[tox] -envlist_lines = """ - py38, - py39, - py310, - py311, - pypy, - pypy3, -""" -config_lines = """ -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - pypy3.9: pypy3 -""" +[github] +py_versions = "[\"3.12\", \"3.11\", \"3.10\", \"3.9\", \"3.8\"]" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d94dcda..3479cc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file ci: autofix_prs: false @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -32,11 +32,19 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# flake8_extra_lines = """ +# _your own configuration lines_ +# """ +## - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: @@ -67,6 +75,16 @@ repos: hooks: - id: i18ndude + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# i18ndude_extra_lines = """ +# _your own configuration lines_ +# """ +## + + ## # Add extra configuration options in .meta.toml: # [pre_commit] diff --git a/dependabot.yml b/dependabot.yml new file mode 100644 index 0000000..bbd3ab0 --- /dev/null +++ b/dependabot.yml @@ -0,0 +1,11 @@ +# Generated from: +# https://github.com/plone/meta/tree/main/config/default +# See the inline comments on how to expand/tweak this configuration file +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/pyproject.toml b/pyproject.toml index 2d36ca2..aa51acb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file +[build-system] +requires = ["setuptools>=68.2"] + [tool.towncrier] directory = "news/" filename = "CHANGES.rst" @@ -37,14 +40,38 @@ directory = "tests" name = "Tests" showcontent = true +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# towncrier_extra_lines = """ +# extra_configuration +# """ +## + [tool.isort] profile = "plone" +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# isort_extra_lines = """ +# extra_configuration +# """ +## + [tool.black] target-version = ["py38"] +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# black_extra_lines = """ +# extra_configuration +# """ +## + [tool.codespell] -ignore-words-list = "discreet," +ignore-words-list = "discreet,assertin,whit" skip = "*.po," ## # Add extra configuration options in .meta.toml: @@ -102,19 +129,20 @@ ignore-packages = ['zope.testing'] # "gitpython = ['git']", # "pygithub = ['github']", # ] -# """ ## [tool.check-manifest] ignore = [ ".editorconfig", + ".flake8", ".meta.toml", ".pre-commit-config.yaml", - "tox.ini", - ".flake8", + "dependabot.yml", "mx.ini", + "tox.ini", ] + ## # Add extra configuration options in .meta.toml: # [pyproject] @@ -122,6 +150,11 @@ ignore = [ # "*.map.js", # "*.pyc", # """ +# check_manifest_extra_lines = """ +# ignore-bad-ideas = [ +# "some/test/file/PKG-INFO", +# ] +# """ ## diff --git a/tox.ini b/tox.ini index b93b84d..7a0bbf3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [tox] # We need 4.4.0 for constrain_package_deps. @@ -8,20 +8,7 @@ envlist = lint test dependencies - py38, - py39, - py310, - py311, - pypy, - pypy3, - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - pypy3.9: pypy3 + ## # Add extra configuration options in .meta.toml: @@ -35,13 +22,30 @@ python = ## [testenv] -deps = - zope.testrunner - -c https://dist.plone.org/release/6.0-dev/constraints.txt -commands = zope-testrunner --test-path=. {posargs:-vc} -extras = test +skip_install = true allowlist_externals = - sh + echo + false +# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing. +# See https://github.com/tox-dev/tox/issues/2858. +commands = + echo "Unrecognized environment name {envname}" + false + +## +# Add extra configuration options in .meta.toml: +# [tox] +# testenv_options = """ +# basepython = /usr/bin/python3.8 +# """ +## + +[testenv:init] +description = Prepare environment +skip_install = true +commands = + echo "Initial setup complete" + [testenv:format] description = automatically reformat code @@ -67,9 +71,9 @@ description = check if the package defines all its dependencies skip_install = true deps = build - z3c.dependencychecker==2.11 + z3c.dependencychecker==2.14.3 commands = - python -m build --sdist --no-isolation + python -m build --sdist dependencychecker [testenv:dependencies-graph] @@ -88,10 +92,33 @@ description = run the distribution tests use_develop = true skip_install = false constrain_package_deps = true -set_env = ROBOT_BROWSER=headlesschrome +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +# +# Set constrain_package_deps .meta.toml: +# [tox] +# constrain_package_deps = "false" +## deps = zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt + +## +# Specify additional deps in .meta.toml: +# [tox] +# test_deps_additional = "-esources/plonegovbr.portal_base[test]" +# +# Specify a custom constraints file in .meta.toml: +# [tox] +# constraints_file = "https://my-server.com/constraints.txt" +## commands = zope-testrunner --all --test-path={toxinidir} -s plone.memoize {posargs} extras = @@ -111,14 +138,26 @@ description = get a test coverage report use_develop = true skip_install = false constrain_package_deps = true -set_env = ROBOT_BROWSER=headlesschrome +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## deps = coverage zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = - coverage run --source plone.memoize {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.memoize {posargs} + coverage run --branch --source plone.memoize {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.memoize {posargs} coverage report -m --format markdown + coverage xml + coverage html extras = test @@ -131,24 +170,38 @@ deps = build towncrier -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = # fake version to not have to install the package # we build the change log as news entries might break # the README that is displayed on PyPI towncrier build --version=100.0.0 --yes - python -m build --sdist --no-isolation + python -m build --sdist twine check dist/* [testenv:circular] description = ensure there are no cyclic dependencies use_develop = true skip_install = false +# Here we must always constrain the package deps to what is already installed, +# otherwise we simply get the latest from PyPI, which may not work. +constrain_package_deps = true +set_env = + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## allowlist_externals = sh deps = pipdeptree pipforester -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json' @@ -162,6 +215,6 @@ commands = # Add extra configuration options in .meta.toml: # [tox] # extra_lines = """ -# my_other_environment +# _your own configuration lines_ # """ ##