Skip to main content

PDM plugin that save your requirements as wheels, similar to pip-wheel

Project description

pdm-wheel

Tests pypi version License Python version pre-commit.ci status pdm-managed Ruff Code style: black

A PDM plugin that save your requirements as wheels, similar to pip wheel

Requirements

pdm-wheel requires Python >=3.10, and PDM >=2.4.1

Installation

You can install the plugin directly by:

$ pdm plugin add pdm-wheel

If you have installed PDM with the recommended tool pipx, add this plugin by:

$ pipx inject pdm pdm-wheel

Or if you have installed PDM with pip install --user pdm, install with pip to the user site:

$ python -m pip install --user pdm-wheel

Otherwise, install pdm-wheel to the same place where PDM is located.

Usage

$ pdm pack [common-options] [pack-options]

Common Options:

-h, --help

show this help message and exit

-v, --verbose

-v for detailed output and -vv for more detailed

-g, --global

Use the global project, supply the project root with -p option

-p PROJECT_PATH, --project PROJECT_PATH

Specify another path as the project root, which changes the base of pyproject.toml and __pypackages__

Pack Options:

-m MAIN, --main MAIN

Specify the console script entry point for the zipapp

-o OUTPUT, --output OUTPUT

Specify the output filename. By default the file name will be inferred from the project name.

-c, --compress

Compress files with the deflate method, no compress by default

--pyc, --compile

Compile source into pyc files

--no-py

Remove the .py files in favor of .pyc files

-i INTERPRETER, --interpreter INTERPRETER

The Python interpreter path, default: the project interpreter

Examples

# Save all dependencies (including dev deps) as wheels in the ./tmp folder
pdm wheel -w wheels
# Save all dev dependencies  as wheels in the ./tmp folder
pdm wheel -w wheels --dev tmp
# Save all non-dev dependencies as wheels in the ./tmp folder
pdm wheel -w wheels --prod tmp

Caveats

  1. If the result zipapp contains binaries, it can only be deployed to the platforms with the same abi, any cross-abi usage of that app might expect a failure.
  2. Any console scripts except for what is given to --main will be lost.
  3. The .exe file is different from what is produced by pyinstaller in the way that it doesn't embed a Python interpreter. This means you have to install a Python with exactly the same version on the deployment platform.
  4. If you have code to run in your project, the project itself should be installed into __pypackages__ as well. Make sure you have set a project name in pyproject.toml.

About executable zipapp

By default, zipapp is created with .pyz suffix. On Windows, if you have associted .pyz files with Python program, you can run the app by double-clicking the file in the explorer. But if you create the app with --exe turn on, you can have a .exe file on Windows and an executable file on Unix-like systems, so that the app can be executed without a python command prefixing it and no matter you assoicated the file exensition properly or not.

Changelog

See CHANGELOG.md

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

pdm-wheel-0.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

pdm_wheel-0.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pdm-wheel-0.0.0.tar.gz.

File metadata

  • Download URL: pdm-wheel-0.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pdm-wheel-0.0.0.tar.gz
Algorithm Hash digest
SHA256 9ae75e61cfc2b689c8ae03e8741959bad7ab15746fdfead70e28857d490dce43
MD5 68336b808ec0951342d3fa99702eb1ce
BLAKE2b-256 4b0f7c32985985ee6d600f9c634c30b294d54162406f5ef2516b80f00f31da3d

See more details on using hashes here.

File details

Details for the file pdm_wheel-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: pdm_wheel-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pdm_wheel-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e78c12774eacb2ae2e7a32afe1dc219952c76e7d51b93340b4d425864bbd33f3
MD5 ae77a00ceb85ae9eca9cc6b858187c27
BLAKE2b-256 d31ff272207237d3940e26be26ed0c6cb65cd4dfa6f065fe47080c8619f8c3ec

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