Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
20 changes: 5 additions & 15 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,21 @@ on:

jobs:
qa:
uses: plone/meta/.github/workflows/qa.yml@main
test:
uses: plone/meta/.github/workflows/test.yml@main
uses: plone/meta/.github/workflows/qa.yml@2.x
coverage:
uses: plone/meta/.github/workflows/coverage.yml@main
uses: plone/meta/.github/workflows/coverage.yml@2.x
dependencies:
uses: plone/meta/.github/workflows/dependencies.yml@main
uses: plone/meta/.github/workflows/dependencies.yml@2.x
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main
uses: plone/meta/.github/workflows/release_ready.yml@2.x
circular:
uses: plone/meta/.github/workflows/circular.yml@main
uses: plone/meta/.github/workflows/circular.yml@2.x

##
# To modify the list of default jobs being created add in .meta.toml:
# [github]
# jobs = [
# "qa",
# "test",
# "coverage",
# "dependencies",
# "release_ready",
Expand All @@ -57,13 +54,6 @@ 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:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Generated from:
# https://github.com/plone/meta/tree/main/src/plone/meta/default
# See the inline comments on how to expand/tweak this configuration file
name: Tests

on:
push:

jobs:
build:
permissions:
contents: read
pull-requests: write
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-latest"]
config:
# [Python version, visual name, tox env]
- ["3.13", "6.2 on py3.13", "py313-plone62"]
- ["3.10", "6.2 on py3.10", "py310-plone62"]
- ["3.13", "6.1 on py3.13", "py313-plone61"]
- ["3.10", "6.1 on py3.10", "py310-plone61"]
- ["3.9", "6.0 on py3.9", "py39-plone60"]
- ["3.13", "6.0 on py3.13", "py313-plone60"]

runs-on: ${{ matrix.os[1] }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.config[0] }}
allow-prereleases: true
- name: Pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Initialize tox
# the bash one-liner below does not work on Windows
if: contains(matrix.os, 'ubuntu')
run: |
if [ `tox list --no-desc -f init|wc -l` = 1 ]; then tox -e init;else true; fi
- name: Test
run: tox -e ${{ matrix.config[2] }}
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "d00886ad"
commit-id = "2.0.1.dev0"
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include *.rst

graft docs
graft plone
graft src

global-exclude *.pyc
global-exclude *.pyo
Expand Down
1 change: 1 addition & 0 deletions news/4217.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move distribution to src layout [gforcada]
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/plone/meta/tree/main/src/plone/meta/default
# See the inline comments on how to expand/tweak this configuration file
[build-system]
requires = ["setuptools>=68.2"]
requires = ["setuptools>=68.2,<80", "wheel"]

[tool.towncrier]
directory = "news/"
Expand Down Expand Up @@ -37,7 +37,7 @@ showcontent = true

[[tool.towncrier.type]]
directory = "tests"
name = "Tests"
name = "Tests:"
showcontent = true

##
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
author_email="plone-developers@lists.sourceforge.net",
url="https://github.com/plone/plone.alterego",
license="LGPL",
packages=find_packages(),
packages=find_packages("src"),
namespace_packages=["plone"],
package_dir={"": "src"},
include_package_data=True,
zip_safe=False,
python_requires=">=3.8",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
134 changes: 82 additions & 52 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@ min_version = 4.4.0
envlist =
lint
test
py313-plone62
py312-plone62
py311-plone62
py310-plone62
py313-plone61
py312-plone61
py311-plone61
py310-plone61
py313-plone60
py312-plone60
py311-plone60
py310-plone60
py39-plone60
dependencies


##
# Add extra configuration options in .meta.toml:
# - to specify a custom testing combination of Plone and python versions, use `test_matrix`
# - to specify extra custom environments, use `envlist_lines`
# - to specify extra `tox` top-level options, use `config_lines`
# [tox]
# test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["3.10", "3.9"]}
# envlist_lines = """
# my_other_environment
# """
Expand All @@ -21,32 +38,14 @@ envlist =
# """
##

[testenv]
skip_install = true
allowlist_externals =
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
allowlist_externals =
echo
commands =
echo "Initial setup complete"


[testenv:format]
description = automatically reformat code
skip_install = true
Expand Down Expand Up @@ -87,8 +86,19 @@ deps =
commands =
sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'

[testenv:test]
description = run the distribution tests

[test_runner]
deps = zope.testrunner
test =
zope-testrunner --all --test-path={toxinidir}/src -s plone.alterego {posargs}
coverage =
coverage run --branch --source plone.alterego {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.alterego {posargs}
coverage report -m --format markdown
coverage xml
coverage html

[base]
description = shared configuration for tests and coverage
use_develop = true
skip_install = false
constrain_package_deps = true
Expand All @@ -104,62 +114,82 @@ set_env =
#
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = "false"
# constrain_package_deps = false
##
deps =
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
{[test_runner]deps}
plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt
plone61: -c https://dist.plone.org/release/6.1-dev/constraints.txt
plone60: -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]"
# 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.alterego {posargs}
extras =
test


##
# Add extra configuration options in .meta.toml:
# [tox]
# test_extras = """
# tests
# widgets
# """
#
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##

[testenv:test]
description = run the distribution tests
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
-c https://dist.plone.org/release/6.2-dev/constraints.txt

commands = {[test_runner]test}
extras = {[base]extras}


[testenv]
description = run the distribution tests (generative environments)
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps = {[base]deps}
commands = {[test_runner]test}
extras = {[base]extras}


[testenv:coverage]
description = get a test coverage report
use_develop = true
skip_install = false
constrain_package_deps = true
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/
# """
##
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
coverage
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.2-dev/constraints.txt

commands =
coverage run --branch --source plone.alterego {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.alterego {posargs}
coverage report -m --format markdown
coverage xml
coverage html
extras =
test
commands = {[test_runner]coverage}
extras = {[base]extras}


[testenv:release-check]
Expand All @@ -169,7 +199,7 @@ deps =
twine
build
towncrier
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.2-dev/constraints.txt

commands =
# fake version to not have to install the package
Expand Down Expand Up @@ -200,7 +230,7 @@ allowlist_externals =
deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.2-dev/constraints.txt

commands =
# Generate the full dependency tree
Expand Down