Skip to main content

Small collection of command line utilities to assist with building your python wheels

Project description

python-build-utils

GitHub Release PyPI Version Build Status codecov Commit Activity License

Small collection of command line utilities to assist with building your Python wheels.


Installation

Install via PyPI:

pip install python-build-utils[all]

The optional [all] extra installs additional dependencies like pipdeptree, used by tools like collect-dependencies.


Description

A collection of CLI tools for managing Python build artifacts, dependencies, and wheel files.


CLI Tools Overview

Check available commands:

Usage: python-build-utils [OPTIONS] COMMAND [ARGS]...

  A collection of CLI tools for Python build utilities.

Options:
  --version      Show the version and exit.
  -v, --verbose  Increase verbosity level. Use -v for info, -vv for debug.
  --help         Show this message and exit.

Commands:
  clean-pyd-modules     Clean all .pyd/.c build modules in src path.
  collect-dependencies  Collect and display dependencies for one or more...
  collect-pyd-modules   Collect and display .pyd submodules from a...
  pyd2wheel             Create a Python wheel file from a compiled .pyd...
  remove-tarballs       Remove tarball files from dist.
  rename-wheel-files    Rename wheel files in a distribution directory by...

clean-pyd-modules

Usage: python-build-utils clean-pyd-modules [OPTIONS]

  Clean all .pyd/.c build modules in src path.

Options:
  --src-path TEXT   Path to the src folder to scan for .pyd modules. Defaults
                    to 'src' in the current folder.
  -r, --regex TEXT  Optional regular expression to filter .pyd modules by
                    name.
  --help            Show this message and exit.

Example:

python-build-utils clean-pyd-modules --regex dave

Removes .pyd and .c files from the src/ folder filtered by name.


collect-dependencies

Usage: python-build-utils collect-dependencies [OPTIONS]

  Collect and display dependencies for one or more Python packages.

Options:
  -p, --package TEXT  Name of the Python package to collect dependencies for.
                      Can be given multiple times. If omitted, dependencies
                      for the entire environment are collected.
  -r, --regex TEXT    Optional regular expression to filter modules by name.
  -o, --output PATH   Optional file path to write the list of dependencies to.
  --help              Show this message and exit.

collect-pyd-modules

Usage: python-build-utils collect-pyd-modules [OPTIONS]

  Collect and display .pyd submodules from a virtual environment.

Options:
  --venv-path TEXT   Path to the virtual environment to scan for .pyd modules.
                     Defaults to the current environment.
  -r, --regex TEXT   Optional regular expression to filter .pyd modules by
                     name.
  --collect-py       If set, collect .py files instead of .pyd files.
  -o, --output PATH  Optional file path to write the list of found .pyd
                     modules.
  --help             Show this message and exit.

rename-wheel-files

Usage: python-build-utils rename-wheel-files [OPTIONS]

  Rename wheel files in a distribution directory by replacing the default
  'py3-none-any' tag with a custom one.

Options:
  --dist-dir TEXT            Directory containing wheel files. Defaults to
                             'dist'.
  --python-version-tag TEXT  Python version tag to include in the new file
                             name (e.g., cp310). Defaults to
                             'cp{major}{minor}' of the current Python.
  --platform-tag TEXT        Platform tag to include in the new file name.
                             Defaults to the current platform value from
                             sysconfig.
  --wheel-tag TEXT           Full custom wheel tag to replace 'py3-none-any'.
                             If provided, this is used directly, ignoring the
                             other tag options. Default format is: {python_ver
                             sion_tag}-{python_version_tag}-{platform_tag}
  --help                     Show this message and exit.

remove-tarballs

Usage: python-build-utils remove-tarballs [OPTIONS]

  Remove tarball files from dist.

  This function removes tarball files from the given distribution directory.

  Args:     dist_dir (str): The directory containing the tarball files to be removed.

  Returns:     None

  Example:     remove_tarballs("dist")

Options:
  --dist_dir TEXT  Directory containing wheel the files. Default is 'dist'
  --help           Show this message and exit.

pyd2wheel

Usage: python-build-utils pyd2wheel [OPTIONS] PYD_FILE

  Create a Python wheel file from a compiled .pyd file.

Options:
  --package-version TEXT  Version of the package. If not provided, the version
                          is extracted from the file name.
  --abi-tag TEXT          ABI tag for the wheel. Defaults to 'none'.
  --help                  Show this message and exit.

Developers

We use prettier in the pre-commit. To install pretier, this was done one time:

npm init -y
npm install --save-dev prettier

This places the package.json file describing the prettier module included in this project.

A develop wanting to run the code can then replicate this prettier by:

npm install --no-audit --no-fund

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

python_build_utils-0.3.3rc1.tar.gz (96.4 kB view details)

Uploaded Source

Built Distribution

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

python_build_utils-0.3.3rc1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file python_build_utils-0.3.3rc1.tar.gz.

File metadata

  • Download URL: python_build_utils-0.3.3rc1.tar.gz
  • Upload date:
  • Size: 96.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for python_build_utils-0.3.3rc1.tar.gz
Algorithm Hash digest
SHA256 524c94a5fb1715f9176ce9af73e786061b8ac5f2c21db2d68f4f05d306c0a2e6
MD5 c57d282493bb3f3ff5d1a05fd3d29b31
BLAKE2b-256 926b28f63988594b4764e0ede9d8484793b42fb76659346396253818812a110a

See more details on using hashes here.

File details

Details for the file python_build_utils-0.3.3rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_build_utils-0.3.3rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf18cbb1681ed4a3eb66407d0923b0b76f186ee35248cdad9156c503db7779b4
MD5 03f5a7a63952132792ca23bbf8c27536
BLAKE2b-256 4e4ff302e9eacdc667813b38c32804c067eccfa8c220a146ad681c2165ff7df5

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