Skip to content

Commit

Permalink
Merge branch 'release/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre committed Apr 12, 2024
2 parents 735e3a8 + 0cff245 commit e859c2b
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 100 deletions.
18 changes: 10 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2022 Andy Kluger

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
22 changes: 22 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
News
====

0.3.3
=====

Changed
-------

- Use uv, if present, rather than pip or pip-tools (tip: `pipz install uv`)
- Some documentation updates, mostly reflecting the new optional uv backend
- Require some actions to have an activated venv first
- When using rich as syntax highlighter,
never truncate lines, but wrap them
- The minimum version of pip-tools is bumped to 7.1.0
- Since Linux Mint shadows the ``highlight`` command,
demote it in the search order in ``.zpy_hlt``, for now.
- Stop abbreviating diffs during pipz upgrade,
as it was breaking some highlighters (riff at least)

Fixed
-----

- Don't complain if the installed version of highlight is too old to know TOML

0.3.2
=====

Expand Down
10 changes: 7 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Manage Python Environments in Zsh, with pip-tools
``zpy`` is a set of Zsh functions
wrapping
pip-tools__
and Python's venv module,
and Python's venv module (or uv__),
for the *simple* and *interactive* management of
Python **virtual environments**,
**dependency specifications**,
Expand All @@ -25,6 +25,8 @@ All have **thorough tab completion**.

__ https://github.com/jazzband/pip-tools

__ https://github.com/astral-sh/uv

They can generally replace pipenv, poetry, pipx, pipsi, virtualenvwrapper, etc.

.. contents::
Expand Down Expand Up @@ -54,7 +56,7 @@ Examples

.. code:: console
% pipz install tldr jello rich-cli yt-dlp 'visidata @ git+https://github.com/saulpw/visidata@develop'
% pipz install uv tldr jello rich-cli yt-dlp 'visidata @ git+https://github.com/saulpw/visidata@develop'
- Create a venv for the current folder (if necessary), activate it, and **sync** installed pkgs to match *all* ``requirements.txt`` lockfiles:

Expand Down Expand Up @@ -130,10 +132,12 @@ Guiding Ideas

- need to be used exclusively
- need to be used by everyone on the same project
- do what pyenv__/asdf-vm__ or flit__ do best (but do work with them if you choose)
- do what mise__/pyenv__/asdf-vm__ or flit__ do best (but do work with them if you choose)
- *conflict* with anything else your team cares to do with your code;
If they can be a friendlier neighbor to your workflows, file an issue__

__ https://github.com/jdx/mise

__ https://github.com/pyenv/pyenv

__ https://asdf-vm.com
Expand Down
45 changes: 24 additions & 21 deletions doc/mkdocs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
certifi==2022.9.24 # via requests
charset-normalizer==2.1.1 # via requests
click==8.1.3 # via mkdocs
babel==2.14.0 # via mkdocs-material
certifi==2024.2.2 # via requests
charset-normalizer==3.3.2 # via requests
click==8.1.7 # via mkdocs
colorama==0.4.6 # via mkdocs-material
ghp-import==2.1.0 # via mkdocs
idna==3.4 # via requests
importlib-metadata==5.0.0 # via markdown, mkdocs
jinja2==3.1.2 # via mkdocs, mkdocs-material
markdown==3.3.7 # via mkdocs, mkdocs-material, pymdown-extensions
markupsafe==2.1.1 # via jinja2
idna==3.7 # via requests
jinja2==3.1.3 # via mkdocs, mkdocs-material
markdown==3.6 # via mkdocs, mkdocs-material, pymdown-extensions
markupsafe==2.1.5 # via jinja2, mkdocs
mergedeep==1.3.4 # via mkdocs
mkdocs==1.4.2 # via -r requirements.in, mkdocs-material
mkdocs-material==8.5.10 # via -r requirements.in
mkdocs-material-extensions==1.1.1 # via mkdocs-material
packaging==21.3 # via mkdocs
pygments==2.13.0 # via mkdocs-material
pymdown-extensions==9.8 # via mkdocs-material
pyparsing==3.0.9 # via packaging
python-dateutil==2.8.2 # via ghp-import
pyyaml==6.0 # via mkdocs, pyyaml-env-tag
mkdocs==1.5.3 # via -r requirements.in, mkdocs-material
mkdocs-material==9.5.17 # via -r requirements.in
mkdocs-material-extensions==1.3.1 # via mkdocs-material
packaging==24.0 # via mkdocs
paginate==0.5.6 # via mkdocs-material
pathspec==0.12.1 # via mkdocs
platformdirs==4.2.0 # via mkdocs
pygments==2.17.2 # via mkdocs-material
pymdown-extensions==10.7.1 # via mkdocs-material
python-dateutil==2.9.0.post0 # via ghp-import
pyyaml==6.0.1 # via mkdocs, pymdown-extensions, pyyaml-env-tag
pyyaml-env-tag==0.1 # via mkdocs
requests==2.28.1 # via mkdocs-material
regex==2023.12.25 # via mkdocs-material
requests==2.31.0 # via mkdocs-material
six==1.16.0 # via python-dateutil
urllib3==1.26.12 # via requests
watchdog==2.1.9 # via mkdocs
zipp==3.10.0 # via importlib-metadata
urllib3==2.2.1 # via requests
watchdog==4.0.0 # via mkdocs
28 changes: 17 additions & 11 deletions doc/src/deps.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
# Dependencies

The primary requirements are Zsh, Python, and [`fzf`](https://github.com/junegunn/fzf),
with optional additions for more colorful output and alternative json parsers.
with optional additions for more colorful output, alternative json parsers, and faster performance.

## Suggested Dependencies by Platform

=== "Alpine"

```console
$ sudo apk add fzf highlight pcre2-tools python3 zsh
$ sudo apk add fzf pcre2-tools python3 zsh
```

=== "Arch"

```console
$ sudo pacman -S --needed fzf highlight python zsh
$ sudo pacman -S --needed fzf python zsh
```

=== "Debian/Ubuntu"

```console
$ sudo apt --no-install-recommends install bat fzf python3{,-venv} wget zsh
$ sudo apt --no-install-recommends install fzf python3{,-venv} wget zsh
```

=== "Fedora"

```console
$ sudo dnf --setopt=install_weak_deps=False install diffutils fzf highlight python3 zsh
$ sudo dnf --setopt=install_weak_deps=False install diffutils fzf python3 zsh
```

=== "MacOS"

```console
$ brew install fzf highlight pcre2 python zsh
$ brew install fzf pcre2 python zsh
```

=== "OpenSUSE"

```console
$ sudo zypper in curl diffutils fzf highlight python3 zsh
$ sudo zypper in curl diffutils fzf python3 zsh
```

!!! note

Either `highlight` or `bat` are included in each of these commands, but are strictly optional.

## All Dependencies

=== "The big ones"
Expand All @@ -55,6 +51,8 @@ with optional additions for more colorful output and alternative json parsers.

=== "The optional ones"

- [uv](https://github.com/astral-sh/uv/)
-- for faster performance, leaner venvs, and more operational feedback
- [highlight](https://repology.org/project/highlight/versions)
*or* [bat](https://repology.org/project/bat/versions)
*or* [rich-cli](https://github.com/Textualize/rich-cli)
Expand All @@ -70,6 +68,14 @@ with optional additions for more colorful output and alternative json parsers.
- [zsh-defer](https://github.com/romkatv/zsh-defer)
-- for caching help content to eliminate a small delay in the first help message

!!! tip

Some of these can be installed after installing zpy, with zpy's `pipz` command:

```console
% pipz install uv rich-cli jello
```

=== "The ones you already have anyway, probably"

- `du`, `mktemp`, `md5sum` *or* `md5`, and `nproc` *or* `sysctl` -- provided by
Expand Down
12 changes: 10 additions & 2 deletions doc/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

`zpy` is a set of Zsh functions,
mostly wrapping
[pip-tools](https://github.com/jazzband/pip-tools/),
[pip-tools](https://github.com/jazzband/pip-tools/) *or*
[uv](https://github.com/astral-sh/uv/),
for the simple and practical management of
Python virtual environments,
dependency specifications,
Expand All @@ -15,7 +16,8 @@ You may find it a suitable alternative to
[pipenv](https://pipenv.pypa.io/en/latest/),
[pipx](https://pypa.github.io/pipx/),
or unaided
[pip-tools](https://github.com/jazzband/pip-tools/).
[pip-tools](https://github.com/jazzband/pip-tools/) or
[uv](https://github.com/astral-sh/uv/).

There's a focus on use of good old `requirements.txt` files,
and extensive tab completion assistance.
Expand Down Expand Up @@ -68,6 +70,12 @@ I appreciate its ability to support a variety of practices, without a fight.
There's always more work to do be done there,
so please don't be shy to squash some bugs!

### uv is also good!

While in some ways less flexible than pip-tools,
uv is *fast*, sensible, features clear and concise output,
and is a practical replacement for both pip-tools and Python's `venv` module.

### Zsh is fantastic!

Zsh provides a powerful toolset
Expand Down
5 changes: 5 additions & 0 deletions doc/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,8 @@ or install it with a plugin manager:
% print zpm load andydecleyre/zpy >>~/.zshrc
% zpm clean
```

!!! tip

Don't use a plugin manager but want to try one now?
I suggest [zcomet](https://github.com/agkozak/zcomet).
2 changes: 1 addition & 1 deletion doc/src/new_proj/pipacs.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pipacs [-c <category>] [-h] <pkgspec>... [-- <pip-compile-arg>...]

!!! tip

When a zpy function internally calls `pip-compile`,
When a zpy function internally calls `pip-compile` or `uv pip compile`,
it provides these flags by default:
```shell
--no-header --annotation-style=line --strip-extras --allow-unsafe --resolver=backtracking
Expand Down
29 changes: 28 additions & 1 deletion doc/src/python_versions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Manage Python versions

This project doesn't maintain multiple Python installations for you;
you can use [pyenv](https://github.com/pyenv/pyenv) or [asdf](https://asdf-vm.com/) to do so.
you can use [mise](https://github.com/jdx/mise), [pyenv](https://github.com/pyenv/pyenv), or [asdf](https://asdf-vm.com/) to do so.

=== "mise"

```console
% mise install [email protected]
```

=== "pyenv"

Expand All @@ -17,6 +23,13 @@ you can use [pyenv](https://github.com/pyenv/pyenv) or [asdf](https://asdf-vm.co

## Install a tool with a specific Python version

=== "mise"

```console
% mise shell [email protected]
% pipz install httpie
```

=== "pyenv"

```console
Expand All @@ -33,6 +46,13 @@ you can use [pyenv](https://github.com/pyenv/pyenv) or [asdf](https://asdf-vm.co

## Create a venv with a specific Python version

=== "mise"

```console
% mise shell [email protected]
% envin # or: activate
```

=== "pyenv"

```console
Expand All @@ -53,6 +73,13 @@ regardless of the current shell's `path`.

## Keep multiple Python version venvs available for a single project

=== "mise"

```console
% mise shell [email protected]
% envin --py current # or: activate --py current
```

=== "pyenv"

```console
Expand Down
11 changes: 10 additions & 1 deletion doc/src/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Aside from Zsh and Python, the only dependency you're likely to *need* is
For more details and recommended package manager commands, see [Dependencies](deps.md).

To install `zpy` itself, you only need to source the file `zpy.plugin.zsh`
in your Zsh startup (`~/.zshrc`).
in your Zsh startup (`~/.zshrc`, or sometimes `~/.config/zsh/.zshrc`).
When using a plugin manager, you'll likely need to feed it the
"`GitHub User`/`Repo Name`" format, which is "`andydecleyre/zpy`".
For more details and recommended plugin manager commands, see [Installation](install.md).
Expand All @@ -20,6 +20,15 @@ For now, let's just source it in the current session:
The user-facing functions are all available as subcommands to `zpy`.
Try typing `zpy`, then a space, then tab.

!!! tip

Everything zpy does will generally be much faster if uv is installed.
You can now install it with zpy's `pipz` command:

```console
% pipz install uv
```

!!! info

By default, each function is *also* available directly, as a "top-level" command[^1].
Expand Down
4 changes: 2 additions & 2 deletions doc/templates/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
plumbum==1.8.0 # via -r requirements.in
wheezy-template==3.1.0 # via -r requirements.in
plumbum==1.8.2 # via -r requirements.in
wheezy-template==3.2.2 # via -r requirements.in
Loading

0 comments on commit e859c2b

Please sign in to comment.