Skip to main content

Picks the right package manager for you

Project description

onepm

Picks the right package manager for you.

Don't make me think about which package manager to use when I clone a project from other people. OnePM will pick the right package manager by searching for the lock files and/or the project settings in pyproject.toml.

This project is created in the same spirit as @antfu/ni.

Supported package managers: pip, pipenv, poetry, pdm, uv

Install onepm

Install with pipx:

pipx install onepm

Or use pdm global install:

pdm add -g onepm

Provided Shortcuts

pi - install

pi

# (venv) pip install . or pip install -r requirements.txt
# pipenv install
# poetry install
# pdm install
pi requests

# (venv) pip install requests
# pipenv install requests
# poetry add requests
# pdm add requests

pu - update

pu

# not available for pip
# pipenv update
# poetry update
# pdm update

pr - run

pr ...args

# (venv) ...args
# pipenv run ...args
# poetry run ...args
# pdm run ...args

pun - uninstall

pun requests

# pip uninstall requests
# pipenv uninstall requests
# poetry remove requests
# pdm remove requests

pa - Alias for the package manager

pa

# pip
# pipenv
# poetry
# pdm

If the package manager agent is pip, OnePM will enforce an activated virtualenv, or a .venv under the current directory.

Shims for Package Managers

OnePM also provides shim for the package managers like corepack, so you don't need to install package managers yourself. To enable it, install OnePM with shims extra:

pipx install --include-deps onepm[shims]

OnePM reads the package-manager field under [tool.onepm] table in pyproject.toml, and install the required package manager with the correct version in an isolated environment.

[tool.onepm]
package-manager = "poetry"

Or you can restrict the version range:

[tool.onepm]
package-manager = "poetry>=1.1.0"

For Python package management, OnePM is all you need.

OnePM Management Commands

  • onepm install: Install the package manager configured in project file
  • onepm use $SPEC: Use the package manager given by the requirement spec
  • onepm update|up: Update the package manager used in the project
  • onepm cleanup [$NAME]: Clean up installations of specified package manager or all
  • onepm list|ls $NAME: List all installed versions of the given package manager

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

onepm-24.1.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

onepm-24.1.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file onepm-24.1.2.tar.gz.

File metadata

  • Download URL: onepm-24.1.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for onepm-24.1.2.tar.gz
Algorithm Hash digest
SHA256 338b19549bfdf2c658f680b8004e7405991ebf99d64b2bdf90e5733c2817781b
MD5 550602a84cc8f962aefbbf9b17102040
BLAKE2b-256 a62feaff67a97da79fd9f385da4a6c6fe2769479fc58ca549cbf118bad4db2f5

See more details on using hashes here.

File details

Details for the file onepm-24.1.2-py3-none-any.whl.

File metadata

  • Download URL: onepm-24.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for onepm-24.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b8d1c0a738e963b8a9e7d6eef3eeae22e7bd2ba8870b224fe2978dab2aaaf49
MD5 3d7fe102d2722937573951f690486af5
BLAKE2b-256 1eb9f05544f633033ab2c9b7a15ea70982b58e3cd3d1026af560dd68164f2f04

See more details on using hashes here.

Supported by

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