diff --git a/.editorconfig b/.editorconfig
index c85c9bc4..5b3c112c 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,8 @@
-# EditorConfig Configurtaion file, for more details see:
+# Generated from:
+# 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
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
@@ -8,7 +12,9 @@
# Will ignore other EditorConfig files in Home directory or upper tree level.
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
@@ -24,19 +30,27 @@ max_line_length = off
# 4 space indentation
indent_size = 4
-[*.{yml}]
+[*.{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
-[*.bat]
-indent_style = tab
-end_of_line = crlf
-[LICENSE]
-insert_final_newline = false
+##
+# 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 00000000..38918f42
--- /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/black.yml b/.github/workflows/black.yml
deleted file mode 100644
index fc5371c7..00000000
--- a/.github/workflows/black.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Black
-on: [push]
-jobs:
- build:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- python-version: [3.9]
-
- steps:
- # git checkout
- - uses: actions/checkout@v4
-
- # python setup
- - name: Set up Python ${{ matrix.python-version }}
- 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
-
- # python cache
- - uses: actions/cache@v3
- with:
- path: ~/.cache/pip
- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-
- - name: Test with tox
- run: tox -e black-check
diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml
deleted file mode 100644
index 3176e03f..00000000
--- a/.github/workflows/isort.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Isort
-on: [push]
-jobs:
- build:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: true
- matrix:
- python-version: [3.9]
-
- steps:
- # git checkout
- - uses: actions/checkout@v4
-
- # python setup
- - name: Set up Python ${{ matrix.python-version }}
- 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
-
- # python cache
- - uses: actions/cache@v3
- with:
- path: ~/.cache/pip
- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-
- - name: Test with tox
- run: tox -e isort
diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml
new file mode 100644
index 00000000..064618d8
--- /dev/null
+++ b/.github/workflows/meta.yml
@@ -0,0 +1,66 @@
+# 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
+
+##
+# 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 6cb56eb9..486392f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,28 +1,56 @@
+# 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
+*.pyc
+*.pyo
+
+# translation related
*.mo
-*.py[cod]
-*~
-/.Python
-/.coverage*
-/.installed.cfg
-/bin/
-/build/
-/coverage*
-/develop-eggs/
-/dist/
-/docs/Makefile
-/docs/html/
-/eggs/
-/htmlcov
-/include/
-/lib/
-/local.cfg
-/local/
-/parts/
-/share/
-/src/plone.api.egg-info/
-/var/
-/reports/
-/pip-selfcheck.json
-/_build/
-/.tox/
+
+# 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
+parts/
pyvenv.cfg
+var/
+local.cfg
+
+# mxdev
+/instance/
+/.make-sentinels/
+/*-mxdev.txt
+/reports/
+/sources/
+/venv/
+.installed.txt
+
+
+##
+# Add extra configuration options in .meta.toml:
+# [gitignore]
+# extra_lines = """
+# _your own configuration lines_
+# """
+##
diff --git a/.meta.toml b/.meta.toml
new file mode 100644
index 00000000..d0ae1c53
--- /dev/null
+++ b/.meta.toml
@@ -0,0 +1,141 @@
+# Generated from:
+# 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 = "1c2155e4"
+
+[pre_commit]
+codespell_extra_lines = """
+ exclude: docs/locale/.*.pot
+"""
+
+[pyproject]
+check_manifest_ignores = """
+ ".editorconfig",
+ "*.cfg",
+ "constraints_plone52.txt",
+ "constraints_plone60.txt",
+ "constraints.txt",
+ "fix-converted-myst.py",
+ "Makefile",
+ "netlify.toml",
+ "requirements-docs.txt",
+ "requirements.txt",
+"""
+dependencies_ignores = "['Products.PrintingMailHost', 'plone.app.iterate',]"
+codespell_ignores = "manuel"
+
+[tox]
+envlist_lines = """
+ py{38,39,310,311}-plone{60}
+ linkcheck
+ plone6docs
+ docs
+"""
+config_lines = """
+skip_missing_interpreters = True
+
+[gh-actions]
+python =
+ 3.8: py38
+ 3.9: py39
+ 3.10: py310
+ 3.11: py311
+
+[gh-actions:env]
+PLONE =
+ 60: plone60
+"""
+extra_lines = """
+[testenv:py{38,39,310,311}-plone{60}]
+skip_install = True
+
+commands =
+ python -VV
+ pip install -r requirements.txt
+ pip list
+ {envbindir}/buildout -c /{toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} install test
+ {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} annotate
+ {envbindir}/test
+
+setenv =
+ BUILDOUT_FILE=test_plone-60.cfg
+
+deps =
+ pdbpp
+ manuel
+
+# tox < 4.0.0
+whitelist_externals =
+ mkdir
+ echo
+
+# tox >= 4.0.0
+allowlist_externals =
+ mkdir
+ echo
+
+[testenv:plone6docs]
+# New docs with sphinx-book-theme
+# See [testenv:docs] for classic documentation
+basepython = python3.9
+skip_install = False
+usedevelop = True
+allowlist_externals =
+ mkdir
+extras =
+ tests
+
+deps =
+ -r requirements-docs.txt
+
+commands =
+ python -VV
+ mkdir -p {toxinidir}/_build/plone6docs
+ sphinx-build -b html -d _build/plone6docs/doctrees docs _build/plone6docs/html
+
+[testenv:docs]
+basepython = python3.9
+skip_install = False
+usedevelop = True
+allowlist_externals =
+ mkdir
+extras =
+ tests
+
+deps =
+ -r requirements-docs.txt
+
+commands =
+ python -VV
+ mkdir -p {toxinidir}/_build/docs
+ sphinx-build -b html -D html_theme=alabaster -d _build/docs/doctrees docs _build/docs/html
+
+whitelist_externals =
+ mkdir
+
+[testenv:linkcheck]
+basepython = python
+skip_install = False
+usedevelop = True
+allowlist_externals =
+ mkdir
+extras =
+ {[testenv:plone6docs]extras}
+deps =
+ {[testenv:plone6docs]deps}
+commands =
+ python -VV
+ mkdir -p {toxinidir}/_build/plone6docs
+ sphinx-build -b linkcheck -d _build/plone6docs/doctrees docs _build/plone6docs/linkcheck
+"""
+
+[github]
+jobs = [
+ "qa",
+ "test",
+ "coverage",
+ "dependencies",
+ "release_ready",
+ ]
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 00000000..5c2addd6
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,95 @@
+# Generated from:
+# 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
+
+repos:
+- repo: https://github.com/asottile/pyupgrade
+ rev: v3.15.2
+ hooks:
+ - id: pyupgrade
+ args: [--py38-plus]
+- repo: https://github.com/pycqa/isort
+ rev: 5.13.2
+ hooks:
+ - id: isort
+- repo: https://github.com/psf/black
+ rev: 24.3.0
+ hooks:
+ - id: black
+- repo: https://github.com/collective/zpretty
+ 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
+ exclude: docs/locale/.*.pot
+
+##
+# 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:
+ - id: check-manifest
+- repo: https://github.com/regebro/pyroma
+ 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/CHANGES.rst b/CHANGES.rst
index 65640cd8..8f5c9e19 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -84,8 +84,8 @@ Bug fixes:
- Do not run GitHub Actions tests twice.
- Only run GitHub Actions tests when commiting directly against master or main or
- opening a pull request agains master or main. This avoids to run the same test
+ Only run GitHub Actions tests when committing directly against master or main or
+ opening a pull request against master or main. This avoids to run the same test
suite for the same environment twice.
[thet] (#0)
- Mockup TinyMCE settings: Remove unused AtD related views.
@@ -474,7 +474,7 @@ Bug fixes:
- Simplify the ``plone.api.content.delete`` method.
[thet]
-- content.copy with safe_id=False should raise it's own exeception. Fixes #340
+- content.copy with safe_id=False should raise it's own exception. Fixes #340
[jaroel]
diff --git a/dependabot.yml b/dependabot.yml
new file mode 100644
index 00000000..bbd3ab05
--- /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/docs/conf.py b/docs/conf.py
index 788a5059..9492f0a8 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -2,8 +2,9 @@
import sys
-project = 'plone.api'
-copyright = '2012, Plone Foundation'
+
+project = "plone.api"
+copyright = "2012, Plone Foundation"
version = release = get_distribution(project).version
@@ -15,29 +16,31 @@
}
extensions = [
- 'sphinx.ext.doctest',
- 'sphinx.ext.coverage',
- 'sphinx.ext.autodoc',
- 'sphinx.ext.viewcode',
- 'sphinx.ext.autosummary',
+ "sphinx.ext.doctest",
+ "sphinx.ext.coverage",
+ "sphinx.ext.autodoc",
+ "sphinx.ext.viewcode",
+ "sphinx.ext.autosummary",
"myst_parser",
"sphinx.ext.todo",
]
-master_doc = 'index'
+master_doc = "index"
-locale_dirs = ['translated/']
-language = 'en'
+locale_dirs = ["translated/"]
+language = "en"
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual])
# This enables PDF generation.
-latex_documents = [(
- 'index',
- 'ploneapi.tex',
- 'plone.api Documentation',
- '',
- 'manual',
-)]
+latex_documents = [
+ (
+ "index",
+ "ploneapi.tex",
+ "plone.api Documentation",
+ "",
+ "manual",
+ )
+]
class Mock:
@@ -49,8 +52,8 @@ def __call__(self, *args, **kwargs):
@classmethod
def __getattr__(cls, name):
- if name in ('__file__', '__path__'):
- return '/dev/null'
+ if name in ("__file__", "__path__"):
+ return "/dev/null"
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
@@ -59,7 +62,7 @@ def __getattr__(cls, name):
return Mock()
-MOCK_MODULES = ['lxml']
+MOCK_MODULES = ["lxml"]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
diff --git a/docs/contribute/develop.md b/docs/contribute/develop.md
index ccfe51b0..c2b0a699 100644
--- a/docs/contribute/develop.md
+++ b/docs/contribute/develop.md
@@ -70,7 +70,7 @@ Our repository on GitHub has the following layout:
- **feature branches**: all development for new features must be done in
dedicated branches, normally one branch per feature,
- **master branch**: when features get completed they are merged into the
- master branch; bugfixes are commited directly on the master branch,
+ master branch; bugfixes are committed directly on the master branch,
- **tags**: whenever we create a new release we tag the repository so we can
later re-trace our steps, re-release versions, etc.
diff --git a/fix-converted-myst.py b/fix-converted-myst.py
index e5053e69..3091a14c 100644
--- a/fix-converted-myst.py
+++ b/fix-converted-myst.py
@@ -2,6 +2,7 @@
import os
import re
+
logging.basicConfig()
logger = logging.getLogger("fix converted MyST documentation")
logger.setLevel(logging.INFO)
@@ -20,28 +21,27 @@ def replace_label_underscore(data):
->
:Example: :ref:`portal-get-tool-example`
"""
- regex_label_underscore = '(?<=:ref:`)(.*)(?=`)'
+ regex_label_underscore = "(?<=:ref:`)(.*)(?=`)"
def _replace(mobj):
- return mobj.group(0).replace('_', '-')
+ return mobj.group(0).replace("_", "-")
- data = re.sub(
- regex_label_underscore, _replace, data)
+ data = re.sub(regex_label_underscore, _replace, data)
return data
def remove_github_warning(data):
"""Remove 'GitHub-only' warning"""
- regex_github_warning = r':::{admonition} GitHub-only([\S\s]*?):::\n\n'
- data = re.sub(regex_github_warning, '', data, flags=re.DOTALL)
+ regex_github_warning = r":::{admonition} GitHub-only([\S\s]*?):::\n\n"
+ data = re.sub(regex_github_warning, "", data, flags=re.DOTALL)
return data
-for root, dirs, files in (*os.walk('./src'), *os.walk('./docs')):
+for root, dirs, files in (*os.walk("./src"), *os.walk("./docs")):
for name in files:
if name.endswith(".py") or name.endswith(".md"):
filename = os.path.join(root, name)
- with open(filename, 'r+') as f:
+ with open(filename, "r+") as f:
data = f.read()
data = replace_label_underscore(data)
data = remove_github_warning(data)
diff --git a/news/cfffba8c.internal b/news/cfffba8c.internal
new file mode 100644
index 00000000..c08f5399
--- /dev/null
+++ b/news/cfffba8c.internal
@@ -0,0 +1,2 @@
+Update configuration files.
+[plone devs]
diff --git a/pyproject.toml b/pyproject.toml
index 057abc23..2066aabf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,12 @@
+# Generated from:
+# 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]
-filename = "CHANGES.rst"
directory = "news/"
+filename = "CHANGES.rst"
title_format = "{version} ({project_date})"
underlines = ["-", ""]
@@ -27,4 +33,145 @@ showcontent = true
[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation:"
-showcontent = true
\ No newline at end of file
+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,manuel"
+skip = "*.po,"
+##
+# Add extra configuration options in .meta.toml:
+# [pyproject]
+# codespell_ignores = "foo,bar"
+# codespell_skip = "*.po,*.map,package-lock.json"
+##
+
+[tool.dependencychecker]
+Zope = [
+ # Zope own provided namespaces
+ 'App', 'OFS', 'Products.Five', 'Products.OFSP', 'Products.PageTemplates',
+ 'Products.SiteAccess', 'Shared', 'Testing', 'ZPublisher', 'ZTUtils',
+ 'Zope2', 'webdav', 'zmi',
+ # ExtensionClass own provided namespaces
+ 'ExtensionClass', 'ComputedAttribute', 'MethodObject',
+ # Zope dependencies
+ 'AccessControl', 'Acquisition', 'AuthEncoding', 'beautifulsoup4', 'BTrees',
+ 'cffi', 'Chameleon', 'DateTime', 'DocumentTemplate',
+ 'MultiMapping', 'multipart', 'PasteDeploy', 'Persistence', 'persistent',
+ 'pycparser', 'python-gettext', 'pytz', 'RestrictedPython', 'roman',
+ 'soupsieve', 'transaction', 'waitress', 'WebOb', 'WebTest', 'WSGIProxy2',
+ 'z3c.pt', 'zc.lockfile', 'ZConfig', 'zExceptions', 'ZODB', 'zodbpickle',
+ 'zope.annotation', 'zope.browser', 'zope.browsermenu', 'zope.browserpage',
+ 'zope.browserresource', 'zope.cachedescriptors', 'zope.component',
+ 'zope.configuration', 'zope.container', 'zope.contentprovider',
+ 'zope.contenttype', 'zope.datetime', 'zope.deferredimport',
+ 'zope.deprecation', 'zope.dottedname', 'zope.event', 'zope.exceptions',
+ 'zope.filerepresentation', 'zope.globalrequest', 'zope.hookable',
+ 'zope.i18n', 'zope.i18nmessageid', 'zope.interface', 'zope.lifecycleevent',
+ 'zope.location', 'zope.pagetemplate', 'zope.processlifetime', 'zope.proxy',
+ 'zope.ptresource', 'zope.publisher', 'zope.schema', 'zope.security',
+ 'zope.sequencesort', 'zope.site', 'zope.size', 'zope.structuredtext',
+ 'zope.tal', 'zope.tales', 'zope.testbrowser', 'zope.testing',
+ 'zope.traversing', 'zope.viewlet'
+]
+'Products.CMFCore' = [
+ 'docutils', 'five.localsitemanager', 'Missing', 'Products.BTreeFolder2',
+ 'Products.GenericSetup', 'Products.MailHost', 'Products.PythonScripts',
+ 'Products.StandardCacheManagers', 'Products.ZCatalog', 'Record',
+ 'zope.sendmail', 'Zope'
+]
+'plone.base' = [
+ 'plone.batching', 'plone.registry', 'plone.schema','plone.z3cform',
+ 'Products.CMFCore', 'Products.CMFDynamicViewFTI',
+]
+python-dateutil = ['dateutil']
+ignore-packages = ['Products.PrintingMailHost', 'plone.app.iterate',]
+
+##
+# 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",
+ ".editorconfig",
+ "*.cfg",
+ "constraints_plone52.txt",
+ "constraints_plone60.txt",
+ "constraints.txt",
+ "fix-converted-myst.py",
+ "Makefile",
+ "netlify.toml",
+ "requirements-docs.txt",
+ "requirements.txt",
+
+]
+
+##
+# 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 84355524..ba616ebe 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,26 +1,3 @@
-[check-manifest]
-ignore =
- .editorconfig
- *.cfg
- constraints_plone52.txt
- constraints_plone60.txt
- constraints.txt
- fix-converted-myst.py
- Makefile
- netlify.toml
- requirements-docs.txt
- requirements.txt
-
-[flake8]
-max-line-length = 88
-extend-ignore = E203, W503
-
-[isort]
-force_alphabetical_sort=True
-force_single_line=True
-lines_after_imports=2
-line_length=200
-
[coverage:run]
branch = True
source =
@@ -33,7 +10,6 @@ omit =
[coverage:report]
precision = 2
-include = src
omit =
*.rst
*/doctests/*
@@ -41,6 +17,3 @@ omit =
[coverage:html]
directory = _build/coverage
-
-[bdist_wheel]
-universal = 0
diff --git a/setup.py b/setup.py
index 5b78990b..d89b87a4 100644
--- a/setup.py
+++ b/setup.py
@@ -1,24 +1,22 @@
+from pathlib import Path
from setuptools import find_packages
from setuptools import setup
-import os
-
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+version = "2.1.1.dev0"
long_description = (
- read("README.md") + "\n\n" + read("CHANGES.rst") + "\n\n" + read("LICENSE")
+ f"{Path('README.md').read_text()}\n"
+ f"{Path('CHANGES.rst').read_text()}\n"
+ f"{Path('LICENSE').read_text()}"
)
-version = "2.1.1.dev0"
-
setup(
name="plone.api",
version=version,
description="A Plone API.",
long_description=long_description,
+ long_description_content_type="text/x-rst",
author="Plone Foundation",
author_email="plone-developers@lists.sourceforge.net",
license="GPL version 2",
@@ -32,26 +30,40 @@ def read(*rnames):
python_requires=">=3.8",
install_requires=[
"Products.statusmessages",
+ "Products.PlonePAS",
+ "Products.CMFPlone",
"decorator",
"plone.app.uuid",
+ "plone.app.dexterity",
+ "plone.app.intid",
+ "plone.app.layout",
"plone.app.linkintegrity",
+ "plone.dexterity",
+ "plone.i18n",
+ "plone.registry",
"plone.uuid",
"setuptools",
"zope.globalrequest",
+ "Products.CMFCore",
+ "z3c.relationfield",
+ "zc.relation",
+ "Zope",
+ "zope.intid",
],
extras_require={
"test": [
- "Products.CMFPlone",
+ "borg.localrole",
"manuel>=1.11.2",
- "plone.app.dexterity",
- "plone.app.intid",
+ "plone.app.contenttypes",
+ "plone.app.textfield",
"plone.app.testing",
+ "plone.testing",
"plone.indexer",
"plone.registry",
- "z3c.relationfield",
- "zope.testrunner",
],
},
+ # Get more strings from
+ # https://pypi.org/classifiers/
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
diff --git a/src/plone/api/configure.zcml b/src/plone/api/configure.zcml
index c25eee7b..fe29cba6 100644
--- a/src/plone/api/configure.zcml
+++ b/src/plone/api/configure.zcml
@@ -1,5 +1,6 @@
+ i18n_domain="plone.api"
+ >
diff --git a/src/plone/api/content.py b/src/plone/api/content.py
index 6be66dec..95515de9 100644
--- a/src/plone/api/content.py
+++ b/src/plone/api/content.py
@@ -34,7 +34,7 @@ def create(
id=None,
title=None,
safe_id=False,
- **kwargs # NOQA: C816, S101
+ **kwargs, # NOQA: C816, S101
):
"""Create a new content item.
@@ -127,7 +127,7 @@ def get(path=None, UID=None):
if path:
site = portal.get()
site_absolute_path = "/".join(site.getPhysicalPath())
- if not path.startswith("{path}".format(path=site_absolute_path)):
+ if not path.startswith(f"{site_absolute_path}"):
path = "{site_path}{relative_path}".format(
site_path=site_absolute_path,
relative_path=path,
@@ -297,7 +297,7 @@ def delete(obj=None, objects=None, check_linkintegrity=True):
breaches = linkintegrity_view.get_breaches(objects)
if breaches:
raise LinkIntegrityNotificationException(
- "Linkintegrity-breaches: {}".format(breaches),
+ f"Linkintegrity-breaches: {breaches}",
)
for obj_ in objects:
diff --git a/src/plone/api/env.py b/src/plone/api/env.py
index a57d79fc..5eb5506a 100644
--- a/src/plone/api/env.py
+++ b/src/plone/api/env.py
@@ -231,4 +231,4 @@ def zope_version():
:returns: string denoting what release of Zope2 this distribution contains
:Example: :ref:`env-zope-version-example`
"""
- return get_distribution("Zope2").version
+ return get_distribution("Zope").version
diff --git a/src/plone/api/portal.py b/src/plone/api/portal.py
index 1aec4997..6080093f 100644
--- a/src/plone/api/portal.py
+++ b/src/plone/api/portal.py
@@ -280,7 +280,7 @@ def get_registry_record(name=None, interface=None, default=MISSING):
records = registry.forInterface(interface, check=False)
_marker = object()
if getattr(records, name, _marker) != _marker:
- return registry["{}.{}".format(interface.__identifier__, name)]
+ return registry[f"{interface.__identifier__}.{name}"]
if default is not MISSING:
return default
@@ -307,7 +307,7 @@ def get_registry_record(name=None, interface=None, default=MISSING):
# Show all records that 'look like' name.
# We don't dump the whole list, because it 1500+ items.
- msg = "Cannot find a record with name '{name}'".format(name=name)
+ msg = f"Cannot find a record with name '{name}'"
records = [key for key in registry.records.keys() if name in key]
if records:
msg = (
diff --git a/src/plone/api/profiles/testfixture/metadata.xml b/src/plone/api/profiles/testfixture/metadata.xml
index 9f02b5ec..db49627f 100644
--- a/src/plone/api/profiles/testfixture/metadata.xml
+++ b/src/plone/api/profiles/testfixture/metadata.xml
@@ -1,4 +1,4 @@
-
+
1
diff --git a/src/plone/api/profiles/testfixture/types.xml b/src/plone/api/profiles/testfixture/types.xml
index 9a3e48aa..a70943b1 100644
--- a/src/plone/api/profiles/testfixture/types.xml
+++ b/src/plone/api/profiles/testfixture/types.xml
@@ -1,5 +1,11 @@
-
-