Skip to content

Commit f873df5

Browse files
committed
Merge branch 'release/0.3.8'
2 parents 59d2dbe + b606c01 commit f873df5

File tree

13 files changed

+199
-82
lines changed

13 files changed

+199
-82
lines changed

LICENSE

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
12

2-
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3-
Version 2, December 2004
4-
5-
Copyright (C) 2004 Sam Hocevar <[email protected]>
6-
7-
Everyone is permitted to copy and distribute verbatim or modified
8-
copies of this license document, and changing it is allowed as long
9-
as the name is changed.
10-
11-
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
12-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
13-
14-
0. You just DO WHAT THE FUCK YOU WANT TO.
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
157

8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

NEWS.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
News
33
====
44

5+
0.3.8
6+
=====
7+
8+
Changed
9+
-------
10+
11+
- Add alternative documentation parsing backend: ugrep
12+
- Small improvements to docs and error messages
13+
- Updated Alpine demo container base image
14+
- Use localtraps option everywhere we TRAP
15+
- Document zsh-autoenv and direnv zpy-friendly configuration
16+
- Increase uniformity of behavior between uv pip sync and pip-sync
17+
518
0.3.7
619
=====
720

doc/mkdocs/mkdocs.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
22

3-
site_name: 'zpy: Manage Python Environments in Zsh'
3+
site_name: "zpy: Manage Python Environments in Zsh"
44
site_url: https://andydecleyre.github.io/zpy/
55
repo_url: https://github.com/andydecleyre/zpy
66
docs_dir: ../src
@@ -40,20 +40,21 @@ theme:
4040
nav:
4141
- index.md
4242
- Guide:
43-
- start.md
44-
- new_proj.md
45-
- new_proj/activate.md
46-
- new_proj/pipacs.md
47-
- new_proj/pipac.md
48-
- new_proj/pips_envin.md
49-
- new_proj/upgrade.md
50-
- new_proj/pyproject.md
51-
- new_proj/run.md
52-
- existing_projects.md
53-
- pipz.md
54-
- python_versions.md
43+
- start.md
44+
- new_proj.md
45+
- new_proj/activate.md
46+
- new_proj/pipacs.md
47+
- new_proj/pipac.md
48+
- new_proj/pips_envin.md
49+
- new_proj/upgrade.md
50+
- new_proj/pyproject.md
51+
- new_proj/run.md
52+
- existing_projects.md
53+
- pipz.md
54+
- python_versions.md
5555
- Details:
56-
- help_all.md
57-
- deps.md
58-
- install.md
59-
- completions.md
56+
- help_all.md
57+
- deps.md
58+
- install.md
59+
- completions.md
60+
- direnv.md

doc/mkdocs/requirements.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
babel==2.15.0 # via mkdocs-material
2-
certifi==2024.2.2 # via requests
1+
babel==2.16.0 # via mkdocs-material
2+
certifi==2024.8.30 # via requests
33
charset-normalizer==3.3.2 # via requests
44
click==8.1.7 # via mkdocs
55
colorama==0.4.6 # via mkdocs-material
66
ghp-import==2.1.0 # via mkdocs
7-
idna==3.7 # via requests
7+
idna==3.10 # via requests
88
jinja2==3.1.4 # via mkdocs, mkdocs-material
9-
markdown==3.6 # via mkdocs, mkdocs-material, pymdown-extensions
9+
markdown==3.7 # via mkdocs, mkdocs-material, pymdown-extensions
1010
markupsafe==2.1.5 # via jinja2, mkdocs
1111
mergedeep==1.3.4 # via mkdocs, mkdocs-get-deps
12-
mkdocs==1.6.0 # via -r requirements.in, mkdocs-material
12+
mkdocs==1.6.1 # via -r requirements.in, mkdocs-material
1313
mkdocs-get-deps==0.2.0 # via mkdocs
14-
mkdocs-material==9.5.21 # via -r requirements.in
14+
mkdocs-material==9.5.34 # via -r requirements.in
1515
mkdocs-material-extensions==1.3.1 # via mkdocs-material
16-
packaging==24.0 # via mkdocs
17-
paginate==0.5.6 # via mkdocs-material
16+
packaging==24.1 # via mkdocs
17+
paginate==0.5.7 # via mkdocs-material
1818
pathspec==0.12.1 # via mkdocs
19-
platformdirs==4.2.1 # via mkdocs-get-deps
19+
platformdirs==4.3.3 # via mkdocs-get-deps
2020
pygments==2.18.0 # via mkdocs-material
21-
pymdown-extensions==10.8.1 # via mkdocs-material
21+
pymdown-extensions==10.9 # via mkdocs-material
2222
python-dateutil==2.9.0.post0 # via ghp-import
23-
pyyaml==6.0.1 # via mkdocs, mkdocs-get-deps, pymdown-extensions, pyyaml-env-tag
23+
pyyaml==6.0.2 # via mkdocs, mkdocs-get-deps, pymdown-extensions, pyyaml-env-tag
2424
pyyaml-env-tag==0.1 # via mkdocs
25-
regex==2024.4.28 # via mkdocs-material
26-
requests==2.31.0 # via mkdocs-material
25+
regex==2024.9.11 # via mkdocs-material
26+
requests==2.32.3 # via mkdocs-material
2727
six==1.16.0 # via python-dateutil
28-
urllib3==2.2.1 # via requests
29-
watchdog==4.0.0 # via mkdocs
28+
urllib3==2.2.3 # via requests
29+
watchdog==5.0.2 # via mkdocs

doc/src/deps.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,6 @@ with optional additions for more colorful output, alternative json parsers, and
9898
- a pcre tool -- provided by
9999
pcregrep/pcre-tools,
100100
pcre2grep/pcre2-tools,
101-
[ripgrep](https://repology.org/project/ripgrep/versions),
101+
[ripgrep (>=14.0.0)](https://repology.org/project/ripgrep/versions),
102+
[ugrep](https://repology.org/project/ugrep/versions),
102103
or Zsh with pcre enabled

doc/src/direnv.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Automatic Activation
2+
3+
If you'd like your shell to automatically activate and deactivate venvs
4+
when you switch directories, there are a few tools to make that happen.
5+
6+
Here's how to configure them to do so in a zpy-friendly way.
7+
If you notice room for improvement, or your favorite tool is missing,
8+
please open an issue or discussion on GitHub.
9+
10+
=== "zsh-autoenv"
11+
12+
[zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv)
13+
runs any Zsh code you want in your current shell,
14+
making it the simplest tool to configure for this job.
15+
16+
In any project folder, create the following two files:
17+
18+
`.autoenv.zsh`:
19+
20+
```zsh
21+
a8 ${0:h}
22+
```
23+
24+
`.autoenv_leave.zsh`:
25+
26+
```zsh
27+
if [[ $VIRTUAL_ENV ]] envout
28+
```
29+
30+
The zero in `${0:h}` is the path of the `.autoenv.zsh` file,
31+
and the `:h` expansion gets that path's parent.
32+
This ensures the proper project folder is used,
33+
even if you're activating the script by entering a deeper subdirectory.
34+
35+
=== "direnv"
36+
37+
[direnv](https://github.com/direnv/direnv/)
38+
runs Bash (not Zsh) and exports variables.
39+
We'll create a self-contained script for each of `a8` and `venvs_path`,
40+
so that we can easily call them from Bash.
41+
42+
Assuming `~/.local/bin` is in your `PATH`, run
43+
44+
```console
45+
$ zpy mkbin a8 ~/.local/bin/
46+
$ zpy mkbin venvs_path ~/.local/bin/
47+
```
48+
49+
Now define a Bash function within the file `~/.config/direnv/direnvrc`:
50+
51+
```bash
52+
layout_zpy () {
53+
a8
54+
export VIRTUAL_ENV="$(venvs_path)/venv"
55+
PATH_add "$VIRTUAL_ENV/bin"
56+
export VENV_ACTIVE=1
57+
}
58+
```
59+
60+
In any project folder, create `.envrc`:
61+
62+
```bash
63+
layout zpy
64+
```

doc/src/new_proj/pipacs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ we'll use `pipacs` to:
1717
[venv] % pipacs beautifulsoup4
1818
```
1919

20-
![Animated demo: pipacs](https://gist.githubusercontent.com/AndydeCleyre/b422097e220806b31c4d1c80ed0ed6b5/raw/ee65dd02265b3e5e7b85996bc6dfd22175a3b78c/guide_pipacs.svg?sanitize=true)
20+
![Animated demo: pipacs](https://github.com/AndydeCleyre/zpy/blob/assets/guide_pipacs.gif?raw=true)
2121

2222
Being such a popular package,
2323
we were able to tab-complete the name `beautifulsoup4`,

doc/src/new_proj/pyproject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ we can populate it with entries from our `requirements.in` files:
3434
[venv] % pypc
3535
```
3636

37-
![Animated demo: pypc](https://gist.github.com/AndydeCleyre/c8cad3380bd475706815969b07733a55/raw/5a4b327bf699819c96c8126de4ef60546c5cccea/pypc_demo.svg?sanitize=true)
37+
![Animated demo: pypc](https://github.com/AndydeCleyre/zpy/blob/assets/pypc.gif?raw=true)
3838

3939
The dependencies have been injected according to
4040
[PEP 621](https://www.python.org/dev/peps/pep-0621/),

doc/src/new_proj/run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We can ensure we've got a proper environment and run it:
1515
[venv] % ./do_thing.py
1616
```
1717

18-
![Animated demo: envin, run script](https://gist.github.com/AndydeCleyre/27bfa0e10a1b42191f777530a500263e/raw/0554370718428b26755902f5c6b12375cabc2d59/envin_do_thing.svg?sanitize=true)
18+
![Animated demo: envin, run script](https://github.com/AndydeCleyre/zpy/blob/assets/envin_do_thing.gif?raw=true)
1919

2020
But what if we don't want to manually activate its environment?
2121

doc/src/pipz.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ The paths printed on the first three lines of output may be overridden with the
3434
`ZPY_PIPZ_BINS`,
3535
respectively.
3636

37-
![Animated demo: pipz install, list](https://gist.github.com/AndydeCleyre/5ad45d78336fc2cc4625b0dc6b450849/raw/777e77607786beb65b2d6e00fb27c507c5e7abfa/pipz_install_list.svg?sanitize=true)
38-
39-
!!! note
40-
41-
The last frame is mangled in this animation, but not in real usage.
37+
![Animated demo: pipz install, list](https://github.com/AndydeCleyre/zpy/blob/assets/pipz_install_list.gif?raw=true)
4238

4339
Example installing an app package from git:
4440

0 commit comments

Comments
 (0)