The workspace for onepm
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 fileonepm use $SPEC
: Use the package manager given by the requirement speconepm update|up
: Update the package manager used in the projectonepm cleanup [$NAME]
: Clean up installations of specified package manager or allonepm list|ls $NAME
: List all installed versions of the given package manager
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file onepm_shims-24.1.1.tar.gz
.
File metadata
- Download URL: onepm_shims-24.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1d271dfd1ca06026f900bd1f334b8774362b1d5664bc0b442a7a09023dce1c4 |
|
MD5 | 2227fb4bf9faf542a45e22841738fc73 |
|
BLAKE2b-256 | fc29bf1b3946b3b8411d21aa55e139278895ec8e88edd8444990fb93ae915029 |
File details
Details for the file onepm_shims-24.1.1-py3-none-any.whl
.
File metadata
- Download URL: onepm_shims-24.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a1b3bee2cfe0ebcbdda0c51c9a3f5ab12ca908dd5ad3848a51707c9a9ffb353 |
|
MD5 | 5b08c140c8b6e7678023e2c9cbb452ae |
|
BLAKE2b-256 | 3f9cfb9fcb257ec65bd91d1b49bf69c79b6e38ca6084ec9406b3a3cfc2aa8e06 |