From 4d1d39a5c443eaae5ba520d970af2775d7e83850 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 6 Jun 2024 16:41:29 +0200 Subject: [PATCH 1/2] Remove unused portal_properties code from tests. Refs https://github.com/plone/Products.CMFPlone/issues/125 --- news/125.tests | 2 ++ plone/app/querystring/tests/testQueryParser.py | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 news/125.tests diff --git a/news/125.tests b/news/125.tests new file mode 100644 index 0000000..7ccc4f5 --- /dev/null +++ b/news/125.tests @@ -0,0 +1,2 @@ +Remove unused ``portal_properties`` code from tests. +[maurits] diff --git a/plone/app/querystring/tests/testQueryParser.py b/plone/app/querystring/tests/testQueryParser.py index d195218..d42c08f 100644 --- a/plone/app/querystring/tests/testQueryParser.py +++ b/plone/app/querystring/tests/testQueryParser.py @@ -84,15 +84,6 @@ def getPortalObject(self): return MockObject(uid="00000000000000000", path="/%s" % MOCK_SITE_ID) -class MockNavtreeProperties: - def getProperty(self, name, default=""): - return "" - - -class MockSiteProperties: - navtree_properties = MockNavtreeProperties() - - @implementer(INavigationRoot, IPloneSiteRoot) class MockSite: def __init__(self, portal_membership=None): @@ -104,7 +95,6 @@ def __init__(self, portal_membership=None): sm.registerUtility(portal_membership, IMembershipTool) self.portal_url = MockPortalUrl() sm.registerUtility(self.portal_url, IURLTool) - self.portal_properties = MockSiteProperties() def getPhysicalPath(self): return ["", MOCK_SITE_ID] From bf177ba46d769f6966ea7cfb058b5e7e4c380266 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 6 Jun 2024 16:42:19 +0200 Subject: [PATCH 2/2] Configuring with plone/meta --- .editorconfig | 6 ++++-- .github/workflows/meta.yml | 7 +++++++ .meta.toml | 2 +- dependabot.yml | 11 +++++++++++ pyproject.toml | 13 ++++++++++--- tox.ini | 12 ++++++++---- 6 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 dependabot.yml 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..c9848bc 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -57,6 +57,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 395421b..5e65216 100644 --- a/.meta.toml +++ b/.meta.toml @@ -3,7 +3,7 @@ # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "6e36bcc4" +commit-id = "a89af8f2" [pyproject] dependencies_mappings = [ 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 891e89e..3c9d1fe 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: @@ -134,13 +134,15 @@ python-dateutil = ['dateutil'] [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 +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 68b3ac1..a89ec71 100644 --- a/tox.ini +++ b/tox.ini @@ -109,7 +109,7 @@ set_env = deps = zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt - + ## # Specify additional deps in .meta.toml: # [tox] @@ -152,11 +152,12 @@ deps = coverage zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt - + commands = coverage run --branch --source plone.app.querystring {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.querystring {posargs} coverage report -m --format markdown coverage xml + coverage html extras = test @@ -169,7 +170,7 @@ 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 @@ -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 = ## @@ -197,7 +201,7 @@ 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'