Migrate repository structure, tooling, CI/CD and docs to the uv zensical stack#129
Migrate repository structure, tooling, CI/CD and docs to the uv zensical stack#129raederan wants to merge 16 commits into
Conversation
Move project metadata and dependencies from setup.cfg into a PEP 621 [project] table, swap the setuptools/setuptools-scm backend for hatchling + hatch-vcs (version_scheme preserved as no-guess-dev), and add a committed uv.lock. setup.py and tox.ini are retained until their replacements are proven.
Add a composite setup-python-env action (setup-uv + uv sync --frozen) and a main.yml workflow with a quality job (make check) and an 8-leg test matrix (ubuntu 3.10-3.13, macos/windows on 3.10+3.13) running pytest and ty. Coverage goes to codecov via the org-level CODECOV_TOKEN with informational statuses. ci.yml is replaced by on-release-main.yml (interim token publish) so the workflow filename and pypi environment already match the upcoming OIDC trusted publisher configuration
Replace the dual sphinx (readthedocs) + mkdocs (gh-pages) stack with zensical: new zensical.toml (material theme, mkdocstrings on src), rewritten landing page, real docs/docs-test Makefile targets, a check-docs CI job, and a Pages-artifact deploy workflow. Remove conf.py, mkdocs.yml, .readthedocs.yml, docs/requirements.txt and the sphinx-only include shim pages
Enable the mike version provider in zensical.toml and deploy docs to the gh-pages branch: main pushes publish the dev version (docs.yml), release tags publish X.Y.Z with the latest alias and root redirect (on-release-main.yml). The zensical-compatible mike fork is pinned in the dev dependency group and commit-hash locked in uv.lock
Delete setup.py, setup.cfg, tox.ini and the stray root __init__.py. Remove eight unused runtime dependencies (ruamel.yaml, pandas, chardet, matplotlib, scipy, sphinx, and the stdlib-shadowing pathlib/asyncio), drop the testing extra in favor of the dev dependency group, and trim the deptry ignores accordingly (lock: 220 to 187 packages). Update README, CONTRIBUTING, docs/dev.md and test docstrings to the uv/make workflow; mark CHANGELOG as release-notes-based until python-semantic-release lands
Rebuild the site after the oold-python layout: hero landing page with logo and call-to-action buttons, about and get-started pages (tabbed uv/pip install, extras table, quickstart from real examples), API reference grouped under docs/api (fixing a sphinx-era gitignore rule that hid it), and dev.md as a tabbed make/manual mirror of the simplified CONTRIBUTING. Slim README down to pitch, install, quickstart and links
Give the live upload tests unique per-run file names and content so leftover pages on the shared test wiki can no longer trigger fileexists-no-change errors, and move the wiki-side cleanup of the target-fpt test into a finally block so failed runs do not leak state.
CredentialManager resolves credentials from memory, an existing file (read-only), the OSW_USERNAME/OSW_PASSWORD environment variables (e.g. via .env), or an interactive prompt, and no longer persists them: OswExpress drops the save-path prompt and auto-save, the prompt result stays in memory, save_credentials_to_file becomes an explicit deprecated opt-in and stops editing .gitignore. Update tests to the new contract and document the resolution order. Also keep the entity model pristine after tests and clean up warnings: snapshot and restore src/osw/model/entity.py around integration test sessions (fetch_schema regenerates it into the source tree by design), remove a self-referential deprecation on StoreOntologiesParam, make FileResult.close() a silent no-op on closed files like io streams, mark deliberately triggered warnings as expected per test, and filter non-actionable third-party warnings narrowly (122 -> 1 on the integration suite). BREAKING CHANGE: credentials are no longer written to disk automatically; rely on OSW_USERNAME/OSW_PASSWORD (or a .env file), an in-memory CredentialManager, or a self-managed credentials file.
Analyze conventional commits on every push to main: when a release is due, semantic-release updates the changelog (insertion flag, history preserved), commits, tags vX.Y.Z and creates the GitHub release; the same workflow run then builds, publishes to PyPI via trusted publishing and deploys the versioned docs. hatch-vcs derives the package version from the tag, so no version file is bumped. Replaces the manual tag-push release flow.
| """Working-directory isolation for the integration tests. | ||
|
|
||
| The tests and the library defaults create files relative to the current | ||
| working directory - among them credential files in CLEAR TEXT |
There was a problem hiding this comment.
still the case with the use of env vars?
There was a problem hiding this comment.
Not critical but there no obvious reason why the depr. marker was removed
| _deploy(param=deploy_param) | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Not deployable in test environment") |
There was a problem hiding this comment.
General comment: consider running local prefect server and run integration tests against it
|
@raederan @LukasGold : Since merging this to main would auto generate a new release we should first collect more potential breaking changes on a |
Collecting breaking changes has downsides
Going
|
Before any merges, please create a baseline release beyond v1.1.2 including all latest PR merges before refactoring structure hard like this!
Target #127
Modernize osw-python to the layout already validated on
OO-LD/oold-python (based on the
cookiecutter-uv template): uv + hatchling/hatch-vcs packaging, ruff + ty +
deptry tooling, a single uv-based CI pipeline, PyPI trusted publishing and
zensical documentation with mike-based versioning (as on
OO-LD/oold-schema).
Changes
[project]table inpyproject.toml;setuptools/setuptools-scm replaced by hatchling + hatch-vcs (tag-derived
versioning preserved via
no-guess-dev); committeduv.lock;setup.py,setup.cfgandtox.iniremoved.(check + format); ty type checking and deptry dependency audit added;
Makefile with
install/check/test/build/docstargets;pre-commit rewritten on ruff-pre-commit.
requestsandhttpxdeclared (were transitive-only); missingbackports.strenumadded for Python 3.10 (latent ImportError); eightunused runtime dependencies removed (ruamel.yaml, pandas, chardet,
matplotlib, scipy, sphinx, stdlib-shadowing pathlib/asyncio); the
testing/devextras replaced by a PEP 735 dev dependency group(lock: 220 -> 187 packages).
main.yml(quality gate viamake check+ 8-leg testmatrix: ubuntu 3.10-3.13, macos/windows on 3.10+3.13) on a composite
setup-python-envaction (setup-uv+uv sync --frozen); coveragemoved from Coveralls to Codecov (org-level token, informational
statuses); integration tests deselected by default (no secrets needed).
on-release-main.ymlpublishes to PyPI viaOIDC trusted publishing (
uv publish --trusted-publishing always,environment
pypi, no stored token).zensical; hero landing page, About/Get-Started guides and grouped API
reference (oold-python layout); versioned deployment with the
zensical-compatible mike fork to the
gh-pagesbranch(main ->
dev, tag ->X.Y.Z+latest).CONTRIBUTING simplified with a tabbed development guide in the docs;
CHANGELOG frozen with a pointer to GitHub Releases; stray root
__init__.pyand a sphinx-eradocs/apigitignore rule removed.Out of Scope
generation is planned but deliberately not part of this migration.
ruleset (
[tool.ty.rules]downgrades) and ruff carries a documentedlegacy-debt ignore block (typing modernization such as PEP 585/604
annotations); both are meant to be tightened incrementally.
docs/tutorials/basics.ipynbships as a staticfile (as before); rendered notebook docs are a possible follow-up.
on push with secrets); a manual/scheduled workflow can be added later.
Further Steps
After merge, in order:
CODECOV_TOKENsecret is visible to this repo.osw(owner
OpenSemanticLab, repoosw-python, workflowon-release-main.yml, environmentpypi); revokePYPI_TOKENafterthe first successful OIDC release.
docs.ymlrun once so mike populatesgh-pages(dev+versions.json), remove the legacy mkdocs files from thegh-pagesroot, then switch Pages source to "Deploy from a branch: gh-pages".
v1.1.3rc1)and verify PyPI upload + versioned docs deploy end to end.