PoC for pep-723 script to wheel and back
Project description
pep723-to-wheel
A small utility for converting PEP 723 inline dependency scripts into wheels and reconstructing scripts from wheels. Especially useful for taking reproducible Marimo notebooks to production environments.
CLI
Build a wheel from a script that has a PEP 723 inline block:
pep723-to-wheel build path/to/script.py --output-dir dist
Set an explicit wheel version (defaults to calendar versioning using the script mtime as the patch segment):
pep723-to-wheel build path/to/script.py --version 2024.12.25
Reconstruct a script from a wheel or package name:
pep723-to-wheel import path/to/package.whl --output reconstructed.py
pep723-to-wheel import requests --output reconstructed.py
Library
from pathlib import Path
from pep723_to_wheel import build_script_to_wheel, import_wheel_to_script
result = build_script_to_wheel(Path("script.py"))
print(result.wheel_path)
import_result = import_wheel_to_script("requests", Path("reconstructed.py"))
print(import_result.script_path)
Development
make test
make typecheck
make ruff
Release process
Releases are automated on pushes to main by the CD workflow in .github/workflows/cd.yml.
- The workflow determines the latest
v*Git tag and runs.github/workflows/cd_version.pyto resolve the next version. If the latest tag matches the current major/minor, it bumps the patch to one higher than the max of the current patch and the tag patch. - If
pyproject.tomlchanges, the workflow commits the version bump back tomain. - It tags the release as
v<version>, builds the wheel withuv build --wheel, publishes to PyPI, and creates a GitHub release with the wheel attached.
To trigger a release, merge or push changes to main and ensure PYPI_API_TOKEN is configured in
the repository secrets.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pep723_to_wheel-0.1.2.tar.gz.
File metadata
- Download URL: pep723_to_wheel-0.1.2.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
777d9e29fc21738142c5940f1d4fbd7cb63bdb10ed6ec1a30fe1001fd7a59c73
|
|
| MD5 |
26375e1a3db6df5e36935eeb9e486ee2
|
|
| BLAKE2b-256 |
439cc75bebe890c938d319428603de105f54c50ca7e7aef291f71b4271dac6f0
|
File details
Details for the file pep723_to_wheel-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pep723_to_wheel-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09cd88fc7c357d2245d270219a229a6ba0093aacdc6457ba748ba90f14ae0e32
|
|
| MD5 |
65f6704001e07395e0fa1313f9308e07
|
|
| BLAKE2b-256 |
cf9a716fe785a867fdb64750f3fd793cc40141b0906ca57eec60a9428e4c5a65
|