Skip to content

Improve Python packaging: self-contained linked packages#1043

Draft
rprimet wants to merge 3 commits into
masterfrom
python-packaging-improvements
Draft

Improve Python packaging: self-contained linked packages#1043
rprimet wants to merge 3 commits into
masterfrom
python-packaging-improvements

Conversation

@rprimet

@rprimet rprimet commented May 29, 2026

Copy link
Copy Markdown
Contributor

The linked package produced by clerk build is now fully self-contained: catala_runtime.py and dates.py are bundled inside it, and all internal imports are relative. Dropping the package into another python project and importing it requires no PYTHONPATH configuration.

Changes:

  • Bundle catala_runtime.py and dates.py in the linked package
  • Switch to relative imports throughout (generated code, stdlib helpers, external module templates) so the package works without sys.path adjustments
  • Simplify run_artifact PYTHONPATH (no longer needs _build/libcatala/python/)
  • Add requires-python = ">=3.12" to pyproject.toml (PEP 695 syntax used)
  • Update mypy check to validate the catala package as a whole (mypy -p catala)

@rprimet rprimet force-pushed the python-packaging-improvements branch 2 times, most recently from adb7832 to 846f55f Compare May 29, 2026 14:40
The linked package produced by `clerk build python/Foo.exe` is now
fully self-contained: catala_runtime.py and dates.py are bundled
inside it, and all internal imports are relative. Dropping the package
into a webapp and importing it requires no PYTHONPATH configuration.

Changes:
- Bundle catala_runtime.py and dates.py in the linked package
- Switch to relative imports throughout (generated code, stdlib helpers,
  external module templates) so the package works without sys.path tricks
- Simplify run_artifact PYTHONPATH (no longer needs _build/libcatala/python/)
- Add requires-python = ">=3.12" to pyproject.toml (PEP 695 syntax used)
- Update mypy check to validate the catala package as a whole (mypy -p catala)
@rprimet rprimet force-pushed the python-packaging-improvements branch from 846f55f to d8acb11 Compare May 29, 2026 14:46
@rprimet rprimet marked this pull request as draft May 29, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants