Skip to main content

PoC for pep-723 script to wheel and back

Project description

pep723-to-wheel

CI codecov

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.

  1. The workflow determines the latest v* Git tag and runs .github/workflows/cd_version.py to 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.
  2. If pyproject.toml changes, the workflow commits the version bump back to main.
  3. It tags the release as v<version>, builds the wheel with uv 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

pep723_to_wheel-0.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pep723_to_wheel-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pep723_to_wheel-0.1.0.tar.gz.

File metadata

  • Download URL: pep723_to_wheel-0.1.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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

Hashes for pep723_to_wheel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4aa7e4b1c3c05f64a5981bc20c39a41b38e56335bf4b1e416bc4e9905da2e40a
MD5 d92e806d847460f6e172abb8fa1321b5
BLAKE2b-256 aec73b539b48c12fa99289609ca4b752a5f50ebb7703bd16df3a344f16069f96

See more details on using hashes here.

File details

Details for the file pep723_to_wheel-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pep723_to_wheel-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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

Hashes for pep723_to_wheel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deec1071fc8570b9b02809ecf908136cfcdd52f9bf4048cb644842ac72f7f2c4
MD5 d64bd9efc7eeca404e67c535c2b28f33
BLAKE2b-256 7d0bf9cd288b5e1c34f75067844ad3eedbb7f0441c7042377f03ad8255408727

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page