diff --git a/.editorconfig b/.editorconfig index fa698fb..5b3c112 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 @@ -33,7 +34,8 @@ indent_size = 4 # 2 space indentation indent_size = 2 -[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] # Frontend development +[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] +# Frontend development # 2 space indentation indent_size = 2 max_line_length = 80 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index b8edec0..6058d80 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -28,6 +28,9 @@ jobs: uses: plone/meta/.github/workflows/qa.yml@main test: uses: plone/meta/.github/workflows/test.yml@main + with: + + py-versions: '["3.10", "3.12"]' coverage: uses: plone/meta/.github/workflows/coverage.yml@main dependencies: @@ -57,6 +60,13 @@ jobs: # 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: diff --git a/.meta.toml b/.meta.toml index 87f8b35..5fbb773 100644 --- a/.meta.toml +++ b/.meta.toml @@ -3,7 +3,13 @@ # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "6e36bcc4" +commit-id = "5d22fbf8" [pyproject] dependencies_ignores = "['plone.formwidget.contenttree']" + +[tox] +constraints_file = "https://dist.plone.org/release/6.1-dev/constraints.txt" + +[github] +py_versions = "[\"3.10\", \"3.12\"]" 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/news/51.breaking b/news/51.breaking new file mode 100644 index 0000000..ab4c246 --- /dev/null +++ b/news/51.breaking @@ -0,0 +1,2 @@ +Implement new `ContentBrowserWidget` with `pat-contentbrowser` support. +[petschki] diff --git a/plone/app/relationfield/behavior.py b/plone/app/relationfield/behavior.py index d872a91..a8fc2d7 100644 --- a/plone/app/relationfield/behavior.py +++ b/plone/app/relationfield/behavior.py @@ -1,4 +1,4 @@ -from plone.app.z3cform.widget import RelatedItemsFieldWidget +from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget from plone.autoform import directives as form from plone.autoform.interfaces import IFormFieldProvider from plone.base import PloneMessageFactory as _ @@ -23,7 +23,7 @@ class IRelatedItems(model.Schema): ) form.widget( "relatedItems", - RelatedItemsFieldWidget, + ContentBrowserFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "recentlyUsed": True # Just turn on. Config in plone.app.widgets. diff --git a/pyproject.toml b/pyproject.toml index 74b71b3..f01853b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ target-version = ["py38"] ## [tool.codespell] -ignore-words-list = "discreet," +ignore-words-list = "discreet,assertin," skip = "*.po," ## # Add extra configuration options in .meta.toml: @@ -119,6 +119,7 @@ Zope = [ 'Products.CMFCore', 'Products.CMFDynamicViewFTI', ] python-dateutil = ['dateutil'] +pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing'] ignore-packages = ['plone.formwidget.contenttree'] ## @@ -134,13 +135,15 @@ ignore-packages = ['plone.formwidget.contenttree'] [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] @@ -148,6 +151,11 @@ ignore = [ # "*.map.js", # "*.pyc", # """ +# check_manifest_extra_lines = """ +# ignore-bad-ideas = [ +# "some/test/file/PKG-INFO", +# ] +# """ ## diff --git a/setup.py b/setup.py index aadd45f..3759ddb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup -version = "3.0.6.dev0" +version = "4.0.0.dev0" long_description = ( f"{Path('README.rst').read_text()}\n{Path('CHANGES.rst').read_text()}" @@ -20,7 +20,7 @@ classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Plone", - "Framework :: Plone :: 6.0", + "Framework :: Plone :: 6.1", "Framework :: Plone :: Core", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", @@ -28,6 +28,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries :: Python Modules", ], keywords="dexterity relations plone zc.relation", diff --git a/tox.ini b/tox.ini index 6c2493c..7a50f19 100644 --- a/tox.ini +++ b/tox.ini @@ -108,8 +108,8 @@ set_env = ## deps = zope.testrunner - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.1-dev/constraints.txt + ## # Specify additional deps in .meta.toml: # [tox] @@ -151,12 +151,13 @@ set_env = deps = coverage zope.testrunner - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.1-dev/constraints.txt + commands = coverage run --branch --source plone.app.relationfield {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.relationfield {posargs} coverage report -m --format markdown coverage xml + coverage html extras = test @@ -168,8 +169,8 @@ deps = twine build towncrier - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.1-dev/constraints.txt + commands = # fake version to not have to install the package # we build the change log as news entries might break @@ -182,6 +183,9 @@ commands = 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 = ## @@ -196,8 +200,8 @@ allowlist_externals = deps = pipdeptree pipforester - -c https://dist.plone.org/release/6.0-dev/constraints.txt - + -c https://dist.plone.org/release/6.1-dev/constraints.txt + commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json'