Skip to content
Open
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
39 changes: 0 additions & 39 deletions .editorconfig

This file was deleted.

185 changes: 133 additions & 52 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,144 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
name: tests
name: Products.mcdutils

on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

env:
PYTHON_VERSION: "3.12"
PLONE_VERSION: "6.1.2"

jobs:
build:

lint:
runs-on: ubuntu-latest
name: "Lint codebase"
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true

- name: Check formatting
if: ${{ success() || failure() }}
id: ruff-format
run: uvx ruff@latest format --diff

- name: Check lint
if: ${{ success() || failure() }}
id: ruff-lint
run: uvx ruff@latest check --diff

- name: Check XML / ZCML
if: ${{ success() || failure() }}
id: zpretty
run: uvx zpretty@latest --check src

- name: Check Package Metadata
if: ${{ success() || failure() }}
id: pyroma
run: uvx pyroma@latest -d .

- name: Check Python Versions
if: ${{ success() || failure() }}
id: py-versions
run: uvx check-python-versions@latest .

- name: Report
if: ${{ success() || failure() }}
run: |
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY

test:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:latest
ports:
- 11211:11211
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.9", "release-check"]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.9", "docs"]
- ["3.9", "coverage"]

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] }}
python-version: ['3.11', '3.12', '3.13']
plone-version: ['6.1-latest', '6.0-latest']
env:
PYTHON_VERSION: ${{ matrix.python-version }}
PLONE_VERSION: ${{ matrix.plone-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
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: Test
run: tox -e ${{ matrix.config[1] }}
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: false

- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}

- name: Run tests
run: make test
env:
MEMCACHED_SERVER: localhost:11211

coverage:
runs-on: ubuntu-latest
name: "Test Coverage"
needs:
- test
services:
memcached:
image: memcached:latest
ports:
- 11211:11211
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: false

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}-${{ hashFiles('pyproject.toml') }}
uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.PLONE_VERSION }}

- name: Run tests
run: make test-coverage
env:
MEMCACHED_SERVER: localhost:11211

- name: Report Coverage
run: |
echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY
echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY
env:
MEMCACHED_SERVER: localhost:11211
69 changes: 51 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,65 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
*.dll
*.egg-info/
*.profraw
# 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
*.so
.coverage
.coverage.*
.eggs/
.installed.cfg
.mr.developer.cfg
.tox/
.vscode/
__pycache__/
bin/

# translation related
*.mo

# tools related
build/
.coverage
.*project
coverage.xml
develop-eggs/
develop/
coverage-html-report/
dist/
docs/_build
__pycache__/
.tox
.vscode/
node_modules/

# venv / buildout related
bin/
develop-eggs/
eggs/
.eggs/
etc/
.installed.cfg
include/
lib/
lib64
log/
.mr.developer.cfg
parts/
pyvenv.cfg
testing.log
var/
local.cfg

# mxdev
/instance/
/.make-sentinels/
/*-mxdev.txt
/reports/
/sources/
/venv/
.installed.txt

.idea
pyvenv.cfg
*.mo
.env
*/node_modules/*
.scannerwork
uv.lock
dependencies.svg
forest.dot
forest.json
docs/_build
.venv/
requirements.txt
constraints-mxdev.txt
requirements-mxdev.txt
constraints-zope.txt
36 changes: 0 additions & 36 deletions .meta.toml

This file was deleted.

Loading