Repository navigation
Introduce CI/CD - #2
Merged
Merged
Conversation
- Testing: ruff format, ruff lint, strict mypy, pytest with an 80% coverage floor, on Ubuntu, macOS and Windows with Python 3.10-3.14. - Ubuntu 24.04 Tests: pytest against Ubuntu 24.04's packaged dependencies, plus pinned pip installs for those not packaged (or packaged too old). - Create Release: manual workflow that tags v<version> from pyproject.toml, writes categorized release notes and dispatches the publish workflow. - Publish package: on a published release, builds the sdist and wheel, runs the tests against the installed wheel and publishes to PyPI with trusted publishing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds GitHub Actions workflows adapted from vtlengine, plus the code changes mdmint needs to pass them.
Workflows
testing.yml(Testing)master, merge queue, manual runsruff format), lint (ruff check) and strict mypy, then runs pytest with an 80% coverage minimum. Runs on Ubuntu, macOS and Windows with Python 3.10–3.14.version.yml(Version Consistency Check)master, merge queuepyproject.toml) differs frommdmint.__version__.create-release.yml(Create Release)v<version>tag frompyproject.toml, writes release notes grouped by the type of issue each PR closes, then startsrelease.yml. The only change from vtlengine is that it no longer starts a docs workflow.release.yml(Publish package)py3-none-anywheel. mdmint is pure Python, so it needs no per-platform wheel builds. It runstwine check --strict, runs the tests against the installed wheel, then publishes to PyPI through trusted publishing, with attestations.Actions are pinned to the same commit SHAs as in vtlengine.
Code changes
Each step is a separate commit:
poetry.lock, and vtlengine's ruff, mypy and pytest settings. Thedevextra is gone; dev tools now come frompoetry install.ruff format: a mechanical reformat. Ruff also formats Python code blocks in Markdown, which is why one line indocs/template-specimen.mdchanged.yaml.loadwith aSafeLoadersubclass, themmdcsubprocess call, and image downloads. The SHA-1 hashes used as cache keys are markedusedforsecurity=False.mypy --strictpasses. Runtime behaviour is unchanged except for two cases:importlib.resourcesfallback for Python < 3.9 is removed. It was dead code, sincerequires-pythonis>=3.9.TypeError.poetry.tomlsetsinstaller.re-resolve = true. Some packages (numpy, matplotlib, contourpy, fonttools, soupsieve) dropped Python 3.10 in their latest releases, so the lock holds two versions of each. Poetry 2.5 writes overlapping markers for those versions on Python 3.13+, triggered by the weasyprint extra. Installing straight from those markers puts both versions into the environment, which broke the first CI run (SyntaxErrorin fontTools on Ubuntu, Python 3.13). Re-resolving against the lock installs a single version of each.Notes:
requires-pythonstill allows it.Testing
poetry install --no-root --all-extras): formatting, lint and mypy are clean; 35 tests passed and 1 was skipped on each. The skipped test needs the Meaningful Data Word template, which isn't in the repo. Coverage is 84%.poetry.tomlfix: on Python 3.13, the default install puts two versions of five packages into the environment; with re-resolve, it installs one version of each.release.ymlbuild job on Python 3.13: the build andtwine check --strictpass. The tests pass against the installed wheel, and I checked that they import mdmint from site-packages, not the source tree.pyproject.tomlis bumped.Before the first release
mdmint: ownerMeaningful-Data, repositorymdmint, workflowrelease.yml, environmentpypi.pypienvironment in the repository settings.versioninpyproject.tomland__version__inmdmint/__init__.pytogether. The version check now enforces this.