setuptoolsbuilds distributions from source code.pip(un)installs distributions (optionally, from PyPI).twinepublishes distributions to PyPI.
pytesttests installed distributions.
Created
February 13, 2019 08:11
-
-
Save dmtucker/3c9d5e2c389409aa807f95621bfdd242 to your computer and use it in GitHub Desktop.
no global pip, instead (these both dont work)
mkdir -p ~/.local/pipx/venvs
sudo apt install python3-venv
python3 -m venv ~/.local/pipx/venvs/pipx
~/.local/pipx/venvs/pipx/bin/pip install pipx
ln -snf ~/.local/pipx/venvs/pipx/bin/pipx ~/.local/bin/pipx
~/.local/bin/pipx ensurepath
pipx upgrade pipxuse global python for pipx not pyenv versions (in case you decide to remove them)
- pipx first, then pyenv
pipx install pipenv tox
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anyone confused over all the py-things in the typical toolchain? we've been discussing this in a PM, but it's probably generally applicable, so i'll share it here. it is my opinion on what goes where:
requirements.txt: replaced by Toxdepsorextras_require(insetup.py) for libs, replaced by Pipfile (eventually) for appsPipfile: used for apps, mostly withpipenv(sincepipdoesn't support it yet)pipenv: used for apps. kennethreitz says otherwise... he's probably wrongpip/twine: used for managing dists, might get merged eventuallypyproject.toml: replacessetup_requires, allows for build systems that aren'tsetuptools(e.g.flit,poetry), will probably replacesetup.cfgvirtualenv: probably replaced bypython3 -m venvwhich is stdlibpyenv: manage multiple pythons on a system (so you're not locked into whatever the OS supports, which tends to be ancient)pipx: manage global packages (withoutsudo) in a way that uncomplicatespip install --user. this is perfect for python packages that aren't necessarily packaged for OSes (e.g. ducttape cli)simplifying... this is the toolchain i use / my view of the world:
pyenvas necessaryas a user / in production:
pipxandpipenv(they usepipunder-the hood, but i generally don't need to know that)as a dev:
pipenvfor apps (note it's presence in dev and prod -- like docker, another deployment tool)tox+pytestfor testing (toxmanages virtualenvs, including a dev env: https://tox.readthedocs.io/en/latest/example/devenv.html)pyproject.toml(always, starting now) +setuptools(for now... i want to look intoflit) for buildnote that
pipandpython3 -m venv/virtualenvis pretty much never used directly.