diff --git a/.editorconfig b/.editorconfig index b4158b8..5b3c112 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,6 @@ # 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: # http://EditorConfig.org @@ -12,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 @@ -28,12 +30,27 @@ 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}] +# Frontend development +# 2 space indentation +indent_size = 2 +max_line_length = 80 + [{Makefile,.gitmodules}] # Tab indentation (no size specified, but view as 4 spaces) indent_style = tab indent_size = unset tab_width = unset + + +## +# Add extra configuration options in .meta.toml: +# [editorconfig] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..38918f4 --- /dev/null +++ b/.flake8 @@ -0,0 +1,22 @@ +# Generated from: +# https://github.com/plone/meta/tree/main/config/default +# See the inline comments on how to expand/tweak this configuration file +[flake8] +doctests = 1 +ignore = + # black takes care of line length + E501, + # black takes care of where to break lines + W503, + # black takes care of spaces within slicing (list[:]) + E203, + # black takes care of spaces after commas + E231, + +## +# Add extra configuration options in .meta.toml: +# [flake8] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4aed3c4..7303350 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - "6.1-dev" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }} id: setup diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml new file mode 100644 index 0000000..b8edec0 --- /dev/null +++ b/.github/workflows/meta.yml @@ -0,0 +1,68 @@ +# Generated from: +# https://github.com/plone/meta/tree/main/config/default +# See the inline comments on how to expand/tweak this configuration file +name: Meta +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - 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@main + test: + uses: plone/meta/.github/workflows/test.yml@main + coverage: + uses: plone/meta/.github/workflows/coverage.yml@main + dependencies: + 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@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" +## + + +## +# Specify additional jobs in .meta.toml: +# [github] +# extra_lines = """ +# another: +# uses: org/repo/.github/workflows/file.yml@main +# """ +## diff --git a/.gitignore b/.gitignore index 45905d1..486392f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,56 @@ -.Python +# Generated from: +# 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 -*.mo *.pyc -.idea -.installed.txt +*.pyo + +# translation related +*.mo + +# tools related +build/ .coverage +.*project +coverage.xml +dist/ +docs/_build +__pycache__/ +.tox +.vscode/ +node_modules/ + +# venv / buildout related +bin/ +develop-eggs/ +eggs/ +.eggs/ +etc/ +.installed.cfg +include/ +lib/ +lib64 .mr.developer.cfg -pip-selfcheck.json -/.tox/ +parts/ +pyvenv.cfg +var/ +local.cfg + +# mxdev /instance/ -/htmlcov/ /.make-sentinels/ -/.coverage. -/.coverage.* /*-mxdev.txt /reports/ /sources/ /venv/ -/coverage.xml -/plone/app/standardtiles/utils.py.bak -pyvenv.cfg -/.vscode/settings.json +.installed.txt + + +## +# Add extra configuration options in .meta.toml: +# [gitignore] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/.meta.toml b/.meta.toml index 3b1aaa4..da7bfa7 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,5 +1,6 @@ # 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 = "8585d8cd" +commit-id = "1c2155e4" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9a7a8c..0a5e9d0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ # 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 autoupdate_schedule: monthly @@ -22,16 +23,40 @@ repos: rev: 3.1.0 hooks: - id: zpretty + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# zpretty_extra_lines = """ +# _your own configuration lines_ +# """ +## - repo: https://github.com/PyCQA/flake8 rev: 7.0.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 hooks: - id: codespell additional_dependencies: - tomli + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# codespell_extra_lines = """ +# _your own configuration lines_ +# """ +## - repo: https://github.com/mgedmin/check-manifest rev: "0.49" hooks: @@ -40,3 +65,30 @@ repos: rev: "4.2" hooks: - id: pyroma +- repo: https://github.com/mgedmin/check-python-versions + rev: "0.22.0" + hooks: + - id: check-python-versions + args: ['--only', 'setup.py,pyproject.toml'] +- repo: https://github.com/collective/i18ndude + rev: "6.1.0" + 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] +# extra_lines = """ +# _your own configuration lines_ +# """ +## 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 639f77a..e0717ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,47 +1,48 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default -[tool.towncrier] -filename = "CHANGES.rst" -directory = "news/" -title_format = "{version} ({project_date})" -underlines = ["-", ""] +# 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.type]] -directory = "breaking" -name = "Breaking changes:" -showcontent = true - -[[tool.towncrier.type]] -directory = "feature" -name = "New features:" -showcontent = true - -[[tool.towncrier.type]] -directory = "bugfix" -name = "Bug fixes:" -showcontent = true - -[[tool.towncrier.type]] -directory = "internal" -name = "Internal:" -showcontent = true - -[[tool.towncrier.type]] -directory = "documentation" -name = "Documentation:" -showcontent = true - -[[tool.towncrier.type]] -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," +skip = "*.po," +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# codespell_ignores = "foo,bar" +# codespell_skip = "*.po,*.map,package-lock.json" +## [tool.dependencychecker] Zope = [ @@ -82,3 +83,48 @@ Zope = [ 'Products.CMFCore', 'Products.CMFDynamicViewFTI', ] python-dateutil = ['dateutil'] + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# dependencies_ignores = "['zestreleaser.towncrier']" +# dependencies_mappings = [ +# "gitpython = ['git']", +# "pygithub = ['github']", +# ] +## + +[tool.check-manifest] +ignore = [ + ".editorconfig", + ".flake8", + ".meta.toml", + ".pre-commit-config.yaml", + "dependabot.yml", + "mx.ini", + "tox.ini", + +] + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# check_manifest_ignores = """ +# "*.map.js", +# "*.pyc", +# """ +# check_manifest_extra_lines = """ +# ignore-bad-ideas = [ +# "some/test/file/PKG-INFO", +# ] +# """ +## + + +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# extra_lines = """ +# _your own configuration lines_ +# """ +## diff --git a/setup.cfg b/setup.cfg index 0da8f8f..e69de29 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,23 +0,0 @@ -# Generated from: -# https://github.com/plone/meta/tree/master/config/default -[bdist_wheel] -universal = 0 - -[flake8] -doctests = 1 -ignore = - # black takes care of line length - E501, - # black takes care of where to break lines - W503, - # black takes care of spaces within slicing (list[:]) - E203, - # black takes care of spaces after commas - E231, - -[check-manifest] -ignore = - .editorconfig - .meta.toml - .pre-commit-config.yaml - tox.ini diff --git a/src/plone/app/standardtiles/templates/attachment_listing.pt b/src/plone/app/standardtiles/templates/attachment_listing.pt index 061977d..17f5c06 100644 --- a/src/plone/app/standardtiles/templates/attachment_listing.pt +++ b/src/plone/app/standardtiles/templates/attachment_listing.pt @@ -45,7 +45,9 @@ > 100 - + KB diff --git a/src/plone/app/standardtiles/templates/existingcontent_view.pt b/src/plone/app/standardtiles/templates/existingcontent_view.pt index f82da0c..9b214c4 100644 --- a/src/plone/app/standardtiles/templates/existingcontent_view.pt +++ b/src/plone/app/standardtiles/templates/existingcontent_view.pt @@ -4,6 +4,7 @@ xmlns:tal="http://xml.zope.org/namespaces/tal" lang="en" xml:lang="en" + i18n:domain="plone" > @@ -72,7 +73,7 @@ Displays an error message for the developer. -
The template of the "" view of +
The template of the "" view of does not define a "content-core" macro.
@@ -101,7 +102,9 @@ > content
-

Selected view is not available for the content.

+

Selected view is not available for the content.

diff --git a/src/plone/app/standardtiles/templates/tabular_view.pt b/src/plone/app/standardtiles/templates/tabular_view.pt index fa80268..2252077 100644 --- a/src/plone/app/standardtiles/templates/tabular_view.pt +++ b/src/plone/app/standardtiles/templates/tabular_view.pt @@ -17,7 +17,7 @@ view_about python: registry.get('plone.allow_anon_views_about', False); ">
-

Nothing to list

+

Nothing to list

diff --git a/src/plone/app/standardtiles/tests/custom_existingcontent_layout.pt b/src/plone/app/standardtiles/tests/custom_existingcontent_layout.pt index e0ed915..68a776c 100644 --- a/src/plone/app/standardtiles/tests/custom_existingcontent_layout.pt +++ b/src/plone/app/standardtiles/tests/custom_existingcontent_layout.pt @@ -14,7 +14,7 @@ - This is a custom layout + This is a custom layout
diff --git a/tox.ini b/tox.ini index e75755a..f9680dd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,51 @@ # 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. min_version = 4.4.0 envlist = - format lint test + dependencies + + +## +# Add extra configuration options in .meta.toml: +# [tox] +# envlist_lines = """ +# my_other_environment +# """ +# config_lines = """ +# my_extra_top_level_tox_configuration_lines +# """ +## [testenv] +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 @@ -36,13 +71,16 @@ 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] -description = generate a graph out of the package's dependencies +description = generate a graph out of the dependencies of the package +skip_install = false +allowlist_externals = + sh deps = pipdeptree==2.5.1 graphviz # optional dependency of pipdeptree @@ -50,27 +88,128 @@ commands = sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg' [testenv:test] +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.app.standardtiles {posargs} + zope-testrunner --all --test-path={toxinidir}/src -s plone.app.standardtiles {posargs} extras = test +## +# Add extra configuration options in .meta.toml: +# [tox] +# test_extras = """ +# tests +# widgets +# """ +## + [testenv:coverage] +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 {envbindir}/zope-testrunner --all --test-path={toxinidir} -s plone.app.standardtiles {posargs} + coverage run --branch --source plone.app.standardtiles {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.app.standardtiles {posargs} coverage report -m --format markdown + coverage xml + coverage html extras = test + + +[testenv:release-check] +description = ensure that the distribution is ready to release +skip_install = true +deps = + twine + build + -c https://dist.plone.org/release/6.0-dev/constraints.txt + +commands = + 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' + # Generate a DOT graph with the circular dependencies, if any + pipforester -i forest.json -o forest.dot --cycles + # Report if there are any circular dependencies, i.e. error if there are any + pipforester -i forest.json --check-cycles -o /dev/null + + +## +# Add extra configuration options in .meta.toml: +# [tox] +# extra_lines = """ +# _your own configuration lines_ +# """ +##