From 4f2fc07bdfd77445f4a1f81bcf6b42c6b70d3c8b Mon Sep 17 00:00:00 2001 From: ale-rt Date: Mon, 13 Jan 2025 16:37:15 +0100 Subject: [PATCH 1/3] Clean up GHA --- .github/workflows/plone-package.yml | 5 +---- setup.py | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/plone-package.yml b/.github/workflows/plone-package.yml index ab5ce8b..1dc255f 100644 --- a/.github/workflows/plone-package.yml +++ b/.github/workflows/plone-package.yml @@ -18,7 +18,7 @@ jobs: plone-version: - 'Plone60' - 'Plone61' - python-version: [3.9, 3.10, 3.11, 3.12, 3.13] + python-version: [3.9, 3.13] steps: - uses: actions/setup-python@v4 @@ -49,9 +49,6 @@ jobs: run: | python -m pip install --upgrade pip pip install tox tox-gh-actions - - name: Black-Check - run: | - tox -r -e black-check - name: Test with tox run: | tox -r diff --git a/setup.py b/setup.py index 9085154..66d9ecc 100644 --- a/setup.py +++ b/setup.py @@ -52,9 +52,34 @@ include_package_data=True, zip_safe=False, python_requires=">=3.9", - install_requires=["setuptools", "Products.CMFPlone"], + install_requires=[ + "AccessControl", + "plone.api", + "plone.app.registry", + "plone.dexterity", + "plone.formwidget.namedfile", + "plone.memoize", + "plone.namedfile", + "plone.registry", + "plone.rfc822", + "plone.z3cform", + "Products.CMFPlone", + "Products.GenericSetup", + "setuptools", + "z3c.form", + "zExceptions", + "zope.component", + "zope.globalrequest", + "zope.i18nmessageid", + "zope.interface", + "zope.lifecycleevent", + "zope.publisher", + "zope.schema", + ], extras_require={ "test": [ + "plone.base", + "plone.browserlayer", "plone.app.testing", "plone.app.contenttypes[test]", ], From bb852f10ea5eb1b1138f74ffbb493380b45edf07 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Tue, 14 Jan 2025 08:37:11 +0100 Subject: [PATCH 2/3] Disable the check for circular dependencies because of an issue with plone.app.discussion See https://github.com/plone/plone.app.discussion/pull/253 --- .github/workflows/meta.yml | 3 ++ tox.ini | 62 ++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index c9848bc..cc75ee4 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -36,6 +36,9 @@ jobs: uses: plone/meta/.github/workflows/release_ready.yml@main circular: uses: plone/meta/.github/workflows/circular.yml@main + # XXX Disabled until plone.app.discussion is free from plone.api + # see: https://github.com/plone/plone.app.discussion/pull/253 + if: false ## # To modify the list of default jobs being created add in .meta.toml: diff --git a/tox.ini b/tox.ini index aa21bf4..0b99940 100644 --- a/tox.ini +++ b/tox.ini @@ -174,36 +174,38 @@ 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 +# XXX: this is commented because plone.app.discussion wrongly depends on plone.api +# See https://github.com/plone/plone.app.discussion/pull/253 +# [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 ## From cd02243b9a6018a56218e2dcdb22838325def230 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Tue, 14 Jan 2025 08:47:33 +0100 Subject: [PATCH 3/3] Tests are already running with the meta.yml --- .github/workflows/plone-package.yml | 62 ----------------------------- 1 file changed, 62 deletions(-) delete mode 100644 .github/workflows/plone-package.yml diff --git a/.github/workflows/plone-package.yml b/.github/workflows/plone-package.yml deleted file mode 100644 index 1dc255f..0000000 --- a/.github/workflows/plone-package.yml +++ /dev/null @@ -1,62 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Plone package - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - plone-version: - - 'Plone60' - - 'Plone61' - python-version: [3.9, 3.13] - - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.13' - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cache/pip - ~/buildout-cache - ~/extends - key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/*.cfg') }}-${{ hashFiles('**/constraints.txt') }}-${{ hashFiles('**/tox.ini') }} - #restore-keys: | - # ${{ runner.os }}-tox- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: setup buildout cache - run: | - mkdir -p ~/buildout-cache/{eggs,downloads} - mkdir ~/.buildout - echo "[buildout]" > $HOME/.buildout/default.cfg - echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg - echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: | - tox -r - env: - PLONE-VERSION: ${{ matrix.plone-version }} - PYTHON-VERSION: ${{ matrix.python-version }} - - name: "Upload coverage to Codecov" - uses: "codecov/codecov-action@v3" - with: - fail_ci_if_error: true - if: matrix.python-version == '3.13'