Skip to main content

packse

Python packaging scenarios.

Installation

Install from PyPI:

uv pip install packse

Once installed, the packse command-line interface will be available.

Usage

Scenarios

A scenario is a JSON description of a dependency tree.

See scenarios/examples/

Each scenario file can contain one or more scenarios.

Listing scenarios

A list of available scenarios can be printed with the list command:

packse list

By default, packse will search for scenarios in the current tree. You may also pass a file to read from:

packse list scenarios/examples/example.json

Each scenario will be listed with its unique identifier e.g. example-cd797223. This is the name of the package that can be installed to run the scenario once it is built and published.

Each packse command supports reading multiple scenario files. For example, with list:

packse list scenarios/examples/example.json scenarios/requires-does-not-exist.json

Viewing scenarios

The dependency tree of a scenario can be previewed using the view command:

$ packse view scenarios/examples/example.json
example-89cac9f1
├── root
│   └── requires a
│       └── satisfied by a-1.0.0
├── a
│   └── a-1.0.0
│       └── requires b>1.0.0
│           ├── satisfied by b-2.0.0
│           └── satisfied by b-3.0.0
└── b
    ├── b-1.0.0
    ├── b-2.0.0
    │   └── requires c
    │       └── unsatisfied: no versions for package
    └── b-3.0.0

Note the view command will view all scenarios in a file by default. A single scenario can be viewed by providing the --name option:

$ packse view scenarios/examples/example.json --name example
example

This is an example scenario, in which the user depends on a single package `a` which requires `b`

example-89cac9f1
├── root
│   └── requires a
│       └── satisfied by a-1.0.0
├── a
│   └── a-1.0.0
│       └── requires b>1.0.0
│           ├── satisfied by b-2.0.0
│           └── satisfied by b-3.0.0
└── b
    ├── b-1.0.0
    ├── b-2.0.0
    │   └── requires c
    │       └── unsatisfied: no versions for package
    └── b-3.0.0

Notice, when a specific scenario is specified, there is more information displayed.

Building scenarios

A scenario can be used to generate packages and build distributions:

packse build scenario/example.toml

The build/ directory will contain sources for all of the packages in the scenario. The dist/ directory will contain built distributions for all of the packages in the scenario.

When a scenario is built, it is given a unique identifier based on a hash of the scenario contents and the project templates used to generate the packages. Each package and requirement in the scenario will be prefixed with the identifier. The unique identifier can be excluded using the --no-hash argument, however, this will prevent publishing multiple times to a registry that does not allow overwrites.

The PACKSE_VERSION_SEED environment variable can be used to override the seed used to generate the unique identifier, allowing versions to differ based on information outside of packse.

Running a package index

Requires installation with the serve extra

To start a local package index:

packse serve

Packages can be installed by passing the --index-url flag to the installer e.g. with pip:

pip install --index-url http://127.0.0.1:3141/simple-html example-a-e656679f

To also include build dependencies, use the /vendor subdirectory:

pip install --index-url http://127.0.0.1:3141/simple-html --find-links http://127.0.0.1:3141/vendor example-a-e656679f

Packse will watch for changes to the scenarios directory, and publish new versions on each change.

Note when developing, it is often useful to use the --no-hash flag to avoid having to determine the latest hash for the scenario.

Building a package index

Requires installation with the index extra

Packse can build a file tree that can be served statically, for example, through GitHub Pages, that serve both the scenarios and the vendored build dependencies, using the index command:

packse index build

This creates three directories in ./index:

  • ./index/files: The distributions.
  • ./index/simple-html: The simple HTML index (PEP 503).
  • ./index/vendor: A flat index of build dependencies.

Testing scenarios

Published scenarios can then be tested with your choice of package manager.

For example, with pip:

pip install -i https://astral-sh.github.io/packse/548262f/simple-html/ example-cd797223

Exporting scenarios

Scenario information can be exported with the packse inspect. This creates a JSON representation of the scenarios with additional generated information such as the root package name and the tree displayed during packse view.

Writing new scenarios

Scenario files may contain one or more scenarios written in JSON. See the existing scenarios for examples and the Scenario type for details on the supported schema.

Metadata

Release files for packse 0.3.59

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for packse 0.3.59
File Size Uploaded Provenance
packse-0.3.59.tar.gz 5.9 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for packse 0.3.59
File Interpreter ABI Platform
packse-0.3.59-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / packse-0.3.59.tar.gz

Download URL packse-0.3.59.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
718bcca5dd1e9321f5c2918d5975ffd772f0c3b150cf29b03979677a003d73d2
BLAKE2b-256 checksum
How to use checksums
169051404d8933506bd9554f607f5054f4715e0a5e1d34e4c6542580553e8b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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}

Release files / packse-0.3.59-py3-none-any.whl

Download URL packse-0.3.59-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10a3689ce0c00805cd7f1589862ab2d8f9fd4ab38c117342c351bfb13daa5c69
BLAKE2b-256 checksum
How to use checksums
8d95b4a997b57a1f46f0f7575c1c021ee15e8fc1470b6ce74010239079d1d9aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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}

Security for packse 0.3.59

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.59 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page