Drop Python 3.9 support and add 3.14 support¶
Remove Python 3.9 support, add 3.14 support to all packages, and make 3.12 the default Python version.
I have installed Python 3.14.10 on the local system at @c:\dev\python3.14.10
I suggest we do it in dependency order:
umbrella -> core -> workflow -> data -> knowledge -> analysis -> discovery -> whatif -> research -> zenodo-sync
I would also suggest we first do the bare minimum to support 3.14 on each repo, and then have a second refactoring round optimising the code to take account of no longer having to support 3.9. This include being more deliberate about the tooling (e.g. mypy) and dependency (e.g. pandas) versions, and not including 3.9 "workarounds". All documentation should correctly refer to support for 3.10 to 3.14.
After completing this, I would then manually release each package on production PyPI with a 0.x.0 (no dev) version number
Status (November 2026)¶
- Stage 1 (drop 3.9, add 3.14, default 3.12) is committed and green in every repository.
- Stage 2 (typing, tooling, dependency and documentation refactor) is committed and green in every repository, in dependency order: umbrella -> core -> workflow -> data -> knowledge -> analysis -> discovery -> whatif -> research -> zenodo-sync.
- Umbrella round-2 items landed: UTF-8 gate invocation,
extra_index_url,-ExistingOnly, PEP 639 licence metadata, isort capped below 9, the legacysetup_venv.ps1removed, and an ecosystem co-install gate that is dispatched manually. - The ecosystem co-install gate is parked until
causaliq-discoveryandcausaliq-whatifare published: it has no schedule, andcausaliq-researchis excluded because it is never published. - Package round-2 items landed in every repository: PEP 604/585 typing with
mypy at 3.12, SPEC 0 dependency floors and badge, refreshed
pre-commitpins, and documentation that refers to 3.10-3.14 only. - Umbrella
setup_dev_envlanded and--checkpasses: the sharedvenv/py312andvenv/py314import every package, includingzenodo-sync. - Next: the manual stable
0.x.0releases on production PyPI in the same dependency order. Releasingcausaliq-analysisclears the matplotlib 3.14 blocker forcausaliq-discovery.
Round-2 backlog (resolved)¶
Ecosystem co-install gate ran on a schedule (resolved)¶
The gate added in a7fc1db carried schedule: - cron: '0 6 * * 1', so it
started itself every Monday at 06:00 UTC. The first tick after that commit
(2026-11-30) began at 06:04 and failed with no commit involved: the job
installs nine distributions and causaliq-discovery, causaliq-whatif and
causaliq-research are published on neither Test PyPI nor PyPI, so pip had
nothing to resolve. No workflow should start unless a maintainer actions it,
and the local gate plus CI on push are the record.
The schedule is removed, so the gate is dispatched by hand only, and
causaliq-research is dropped from both the install and the import lists: it
is a repository-only research project that is never published, so a set
containing it can never resolve. A "Report which distributions are published"
step now names the missing distributions and stops with one line, which keeps
a manual dispatch informative while the gate is parked.
Re-enable the full check by dispatching the workflow once causaliq-discovery
and causaliq-whatif are published, and drop the readiness step when the
whole published set resolves, imports and passes pip check. Not decided
here, as a separate task: whether the gate should pass --pre while the
ecosystem is pre-release, or resolve CausalIQ names from a single index.
isort 9 skipped non-ASCII files on Windows (resolved)¶
isort 9 reads and writes files using the process locale encoding, which is
cp1252 on a default Windows install, so a source file containing non-ASCII
text (→, α, 🎉) could not be encoded and was skipped with a warning:
UserWarning: Unable to parse file tests\unit\graph\test_graph.py due to
'charmap' codec can't encode character '\u2192' in position 111
The check still exited 0, so the gate passed while Windows left those files
unchecked and check_ci.ps1 -Fix left them unsorted. causaliq-data and
causaliq-knowledge were unaffected because they already capped isort below
9.
Resolved as one change, in the umbrella first and then per package:
- the gate runs its tools as
python -X utf8 -m <tool>(devtools/steps.py::_module_command); - the shared CI job sets
PYTHONUTF8: "1"besidePYTHONIOENCODING; - every package caps isort below 9 (
isort>=5.10.0,<9.0.0) andpre-commitpins isort 8.0.1.
Other round-2 items (resolved)¶
causaliq-workflow: thesys.version_info >= (3, 10)entry-point branch inregistry.pyand its Python 3.9 mock test are removed.scripts/setup_venv.ps1: removed everywhere;scripts/setup-env.ps1is the only environment script.-InstallOnlyis now-ExistingOnly, so an abbreviated-Installcan no longer match it and skip a missing environment.- Package indexes:
extra_index_urlin[tool.causaliq]is passed to pip by the generated setup script. It ishttps://test.pypi.org/simple/in workflow, data, knowledge, analysis, discovery and research, and empty in the umbrella, core, whatif and zenodo-sync, so a clean clone and a clean CI job resolve identically. - Packaging metadata:
license = "MIT"(SPDX) withlicense-files, the MIT classifier dropped, SPEC 0 dependency floors and the SPEC 0 badge in every package README. - Provenance: the commit-hash reference is kept (status quo), which costs a second umbrella commit per tooling change.
Stage 2 - refactor for a 3.10-3.14 floor¶
Stage 1 is committed in every repository: requires-python is >=3.10, the
environments and CI matrices cover 3.10-3.14, 3.12 is the default, the docs
refer to 3.10-3.14, and the generated scripts are pinned to the umbrella
commit that carries the change. Every package gate passes on Python 3.14.
Order remains: umbrella -> core -> workflow -> data -> knowledge -> analysis -> discovery -> whatif -> research -> zenodo-sync.
Stage 2 sequence (completed)¶
- Stage 1 commits were pushed and CI is green on 3.10-3.14 for every
repository (3.10 runs on
ubuntu-24.04vialegacy-python-versions). - The hybrid local environment strategy (below) was adopted and the shared environments were created before touching code.
- The
causaliq-discovery3.14 item was cleared so the baseline is fully green (see below). - The umbrella change landed first: the tooling items regenerate every package's scripts, so they preceded the per-package work.
- Each repository then followed in dependency order, one commit each.
causaliq-discovery on 3.14 (resolved)¶
causaliq-discovery on 3.14 (local venv\py314 and its CI job) failed while
pip tried to build matplotlib. The published causaliq-analysis 0.5.0.dev6
still pinned matplotlib<3.10,>=3.9, and matplotlib 3.9 has no cp314 wheel,
so pip fell back to a source build. CI showed the failure on macOS and Windows
while generating matplotlib's metadata; only ubuntu passed, because its image
carries the FreeType and libpng build dependencies.
Resolved by publishing causaliq-analysis 0.5.0.dev7 with the corrected
matplotlib>=3.10.7,<3.11 pin: discovery needed no change, and the next CI
run resolved the newer build because >=0.5.0.dev5 prefers it. The stable
causaliq-analysis 0.5.0 release makes the fix permanent and follows the
release order. causaliq-research depended on analysis as well and is clear
for the same reason.
The manual recipe for a package-local 3.14 environment is no longer needed:
the shared venv/py314 carries every sibling package installed editable, and
scripts/setup_dev_env.py --check confirms it.
Scope (delivered)¶
- Remove the 3.9 workarounds: workflow's
sys.version_info >= (3, 10)entry-point branch and its mocked 3.9 test; thescipy-stubspython_version>='3.10'marker in data. Record, rather than assume, the decisions that depend on the floor: theStrEnumbackport and the custom[tool.causaliq]parser both need a 3.11 floor, so they stay while 3.10 remains supported. - Typing: adopt PEP 604/585 (
X | None,list[str],dict[str, int]) and removeOptional,ListandDict; dropfrom __future__ import annotationswhere it no longer earns its keep; raise mypy'spython_versionto 3.12 and reviewwarn_unused_ignoresper repository. - Tooling versions, decided once: one isort major for the whole ecosystem
plus the UTF-8 gate fix recorded above; refresh the stale
pre-commitrevpins (black 23.3.0, flake8 6.0.0, mypy 1.3.0); confirm the black and mypy bounds; addPYTHONUTF8: "1"to the shared CI job environment. - Dependency floors (SPEC 0): raise the numpy, pandas, scipy, scikit-learn,
matplotlib and seaborn minimums to the SPEC 0 window, add the SPEC 0
badge, and revisit the
pandas<3.1andmatplotlib<3.11caps now that the newer behaviour is understood. - Packaging metadata: replace
license = {text = "MIT"}with an SPDX string incausaliqandzenodo-sync, drop the MIT licence classifier, and alignlicense-filesacross packages (setuptools removes support for the table form on 2027-02-18). - Scripts and provenance: remove
scripts/setup_venv.ps1; settle the-Installversus-InstallOnlyspelling so the legacy form cannot silently skip environments; add theextra_index_urlkey so local setup and CI resolve identically; keep the commit-hash provenance (two commits per tooling change). - CI gap: nothing checks that the packages are co-installable at their
released versions, which is what users of several packages do. Add one job
that installs the whole ecosystem from the index into a single
environment. Landed as
.github/workflows/ecosystem.ymland parked on 2026-11-30 (see the resolved entry in the round-2 backlog): dispatched by hand, andcausaliq-researchexcluded because it is never published. - Documentation: close the "Adopt SPEC 0 minimum dependency versions and badge" roadmap item when 4 lands and refresh the badges then, and remove any remaining pre-3.10 statements in READMEs and user guides, leaving historical CHANGELOG entries alone.
Local environment strategy (adopted: hybrid)¶
Every repository currently keeps venv\py310 ... venv\py314 - fifty
environments - each installing the package editable with the dev, test and
docs extras and resolving siblings from Test PyPI. That repeats the
scientific stack in every environment, and dependent repositories test the
published sibling builds rather than the working tree; the matplotlib
source build and the pandas-stubs mypy surprise both came from this.
- Per repository (status quo). Matches the gate's ownership check and CI exactly, and exposes undeclared dependencies and pin conflicts; costs fifty environments and hides local sibling edits.
- One shared set in the umbrella. Two or three environments (3.12 and
3.14) with every package installed editable. Fast, and local edits are
visible across repositories; but it masks missing dependency declarations
and the gate rejects a foreign interpreter unless
--ciis given. - Hybrid (recommended). Two shared environments in the umbrella (3.12 and
3.14) with every package installed editable; each package's gate runs
against them with
--ci. Repo-local environments are optional conveniences (gate without--ci,activate.ps1, OS/version-specific debugging), not part of the release process. Release evidence comes from CI (index-resolved install per repo) plus one throwaway environment that installs the uploaded artifact from Test PyPI and smoke-imports it.
Two caveats still apply to the shared set, and they are why it is not release
evidence: it hides undeclared dependencies (discovery's mypy only failed
because the shared env had pandas-stubs, which discovery does not declare),
and it can resolve different tool versions - the same work had isort 8.0.1 in
the shared env and isort 9.0.2 in core's own env, which is why one reported
"Unable to parse file" warnings and the other did not.
Creating the shared set (manual, until scripts/setup_dev_env.py exists):
# from the folder that contains every repository
py -3.12 -m venv causaliq\venv\py312
& .\causaliq\venv\py312\Scripts\python.exe -m pip install `
-e 'causaliq[dev]' -e 'causaliq-core[dev,test]' `
-e 'causaliq-workflow[dev,test]' -e 'causaliq-data[dev,test]' `
-e 'causaliq-knowledge[dev,test]' -e 'causaliq-analysis[dev,test]' `
-e 'causaliq-discovery[dev,test]' -e 'causaliq-whatif[dev,test]' `
-e 'causaliq-research[dev,test]' -e 'zenodo-sync[dev,test]'
Repeat with py -3.14 and venv\py314. No Test PyPI index is needed: every
CausalIQ package is installed editable in a single resolution, which is the
local-side benefit of the hybrid. With the shared set in place the fifty
per-repository environments can be deleted.
scripts/setup_dev_env.py is planned to automate this (sibling discovery via
[tool.causaliq], environment creation, one pip resolve, smoke imports). It
is a new capability (Hat 1), so it is a separate task and must not be mixed
into stage 2.
Release check - one throwaway environment, recreated per release, run from the folder that contains every repository:
py -3.12 -m venv causaliq\venv\release-check
& .\causaliq\venv\release-check\Scripts\python.exe -m pip install `
--index-url https://test.pypi.org/simple/ `
--extra-index-url https://pypi.org/simple/ `
causaliq-analysis==0.5.0
& .\causaliq\venv\release-check\Scripts\python.exe `
-c "import causaliq_analysis"
If the hybrid is adopted, consider teaching the gate to accept a shared
environment: instead of requiring sys.prefix to sit inside the repository,
verify that the installed config.package distribution resolves into this
repository's src tree. That keeps the guard - the gate must test this
repository's code - without forcing one environment per repository.
Process¶
- LLMs never stage, commit or push; edits stay in the working tree and the user commits, one repository per commit.
- A repository is committed only when its gate passes; run the gate on 3.12 and 3.14 locally and treat CI as authoritative for 3.10, 3.11 and 3.13.
- Regenerate the generated scripts after the umbrella change:
python scripts/sync.py --update --source . --bootstrap --ref causaliq@<sha>in the umbrella, thenpython scripts/sync.py --update --source ..\causaliq --ref causaliq@<sha>in each package, and commit the regenerated files. - Keep
docs/development_policy/authoritative: stage 2 is Hat 2 work and must not be bundled with feature or fix changes.
Task: setup_dev_env (Hat 1 - completed)¶
A new capability, separate from stage 2 and to be completed first: it makes the shared development environments reproducible. Implement it as its own commits; do not mix it with the stage 2 refactor.
Goal¶
One command creates and maintains the shared environments described under "Local environment strategy" - every CausalIQ package installed editable in a single resolution - and can verify them.
Decisions taken¶
- Default versions: 3.12 and 3.14 (
shared_python_versions), overridable. - Extras:
dev,testby default (shared_extras);docsis opt-in through--extras. devtools/devenv.pyis excluded from vendoring, because no package ever runs it (see Design).
Interface¶
python scripts/setup_dev_env.py [--python 3.12 ...] [--extras dev,test]
[--repo NAME=PATH] [--install-only] [--recreate] [--check] [--dry-run]
[--strict] [--interpreter PATH]
--check is the "confirm the strategy" step used by the stage 2 first steps:
it reports each environment, its interpreter and the importability of every
discovered package, and exits non-zero when incomplete. --dry-run prints
the commands without executing them.
Design¶
src/causaliq/devtools/devenv.py, stdlib only:discover(root)scans sibling directories for apyproject.tomlwith a[tool.causaliq]section and reusesconfig.read_sectionandbuild_configfordistribution,packageanddev_extras; no new manifest.--repo NAME=PATHadds or overrides an entry.resolve_interpreter(version)usespy -<ver>on Windows andpython<ver>thenpython3on POSIX;--interpreteroverrides. A missing interpreter fails loudly, namingpy -0p, instead of skipping.venv_command()andinstall_command()build argument lists so they can be asserted without executing anything.- One
pip install -einvocation for the whole ecosystem, then an import smoke check over every discovered package. - Nothing is deleted: removing old environments stays manual.
- Generated entry point
scripts/setup_dev_env.py, rendered only whensync.py --bootstrapruns, so packages never receive a script that would try to install their siblings. sync.py::_vendor_filesskipsdevenv.py, with a comment explaining that it is umbrella-only tooling which packages never import, so vendoring it would place an unused copy in ten repositories. A test asserts the exclusion.
Note: this exclusion avoids an unused file, it does not avoid the
regeneration pass. sync.py itself (bootstrap rendering plus the
exclusion) and config.py (the new keys) are vendored, so every package's
scripts/_vendor/causaliq_devtools/ changes and must be regenerated - the
usual two umbrella commits, then one commit per package.
- Config: shared_python_versions = ["3.12", "3.14"] and
shared_extras = ["dev", "test"] in the umbrella [tool.causaliq], with
code defaults when the keys are absent.
Tests and validation¶
- Unit: discovery over a temporary sibling tree, config parsing, interpreter
resolution with
os.namemonkeypatched, and command construction. - Functional:
--dry-runand--checkover fake repositories, asserting the planned commands and the exit codes. - 100 % coverage of
devenv.py, as the umbrella gate requires. - Manual acceptance on this machine: build both environments from scratch,
run one package gate from the shared set with
--ci, then delete every per-repositoryvenv/.
Acceptance criteria¶
python scripts/setup_dev_env.pybuildsvenv/py312andvenv/py314with every package editable and smoke-imports each one.--checkexits zero only when both environments are complete.--dry-runshows the exact commands, and--install-onlynever skips a missing environment silently.- The umbrella gate is green on 3.12 and 3.14, and
check_ci.py --ciruns a package gate against the shared set. sync.py --checkis green in every repository after regeneration.
Files expected to change¶
src/causaliq/devtools/devenv.py(new)src/causaliq/devtools/sync.py(bootstrap-only entry point, vendoring exclusion)src/causaliq/devtools/config.py(two optional keys)tests/unit/test_devenv.py,tests/functional/test_devenv.py(new), plus a case intests/functional/test_sync.pypyproject.toml(the two keys)docs/development_policy/05-scripts.md,CONTRIBUTING.md- regenerated
scripts/in the umbrella and all ten packages
Out of scope¶
Changing scripts/setup-env.ps1, the gate's environment check or CI;
deleting environments; installing the docs extras by default.