-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
199 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
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. | ||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
babel==2.15.0 # via mkdocs-material | ||
certifi==2024.2.2 # via requests | ||
babel==2.16.0 # via mkdocs-material | ||
certifi==2024.8.30 # 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.7 # via requests | ||
idna==3.10 # via requests | ||
jinja2==3.1.4 # via mkdocs, mkdocs-material | ||
markdown==3.6 # via mkdocs, mkdocs-material, pymdown-extensions | ||
markdown==3.7 # via mkdocs, mkdocs-material, pymdown-extensions | ||
markupsafe==2.1.5 # via jinja2, mkdocs | ||
mergedeep==1.3.4 # via mkdocs, mkdocs-get-deps | ||
mkdocs==1.6.0 # via -r requirements.in, mkdocs-material | ||
mkdocs==1.6.1 # via -r requirements.in, mkdocs-material | ||
mkdocs-get-deps==0.2.0 # via mkdocs | ||
mkdocs-material==9.5.21 # via -r requirements.in | ||
mkdocs-material==9.5.34 # 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 | ||
packaging==24.1 # via mkdocs | ||
paginate==0.5.7 # via mkdocs-material | ||
pathspec==0.12.1 # via mkdocs | ||
platformdirs==4.2.1 # via mkdocs-get-deps | ||
platformdirs==4.3.3 # via mkdocs-get-deps | ||
pygments==2.18.0 # via mkdocs-material | ||
pymdown-extensions==10.8.1 # via mkdocs-material | ||
pymdown-extensions==10.9 # via mkdocs-material | ||
python-dateutil==2.9.0.post0 # via ghp-import | ||
pyyaml==6.0.1 # via mkdocs, mkdocs-get-deps, pymdown-extensions, pyyaml-env-tag | ||
pyyaml==6.0.2 # via mkdocs, mkdocs-get-deps, pymdown-extensions, pyyaml-env-tag | ||
pyyaml-env-tag==0.1 # via mkdocs | ||
regex==2024.4.28 # via mkdocs-material | ||
requests==2.31.0 # via mkdocs-material | ||
regex==2024.9.11 # via mkdocs-material | ||
requests==2.32.3 # via mkdocs-material | ||
six==1.16.0 # via python-dateutil | ||
urllib3==2.2.1 # via requests | ||
watchdog==4.0.0 # via mkdocs | ||
urllib3==2.2.3 # via requests | ||
watchdog==5.0.2 # via mkdocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Automatic Activation | ||
|
||
If you'd like your shell to automatically activate and deactivate venvs | ||
when you switch directories, there are a few tools to make that happen. | ||
|
||
Here's how to configure them to do so in a zpy-friendly way. | ||
If you notice room for improvement, or your favorite tool is missing, | ||
please open an issue or discussion on GitHub. | ||
|
||
=== "zsh-autoenv" | ||
|
||
[zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv) | ||
runs any Zsh code you want in your current shell, | ||
making it the simplest tool to configure for this job. | ||
|
||
In any project folder, create the following two files: | ||
|
||
`.autoenv.zsh`: | ||
|
||
```zsh | ||
a8 ${0:h} | ||
``` | ||
|
||
`.autoenv_leave.zsh`: | ||
|
||
```zsh | ||
if [[ $VIRTUAL_ENV ]] envout | ||
``` | ||
|
||
The zero in `${0:h}` is the path of the `.autoenv.zsh` file, | ||
and the `:h` expansion gets that path's parent. | ||
This ensures the proper project folder is used, | ||
even if you're activating the script by entering a deeper subdirectory. | ||
|
||
=== "direnv" | ||
|
||
[direnv](https://github.com/direnv/direnv/) | ||
runs Bash (not Zsh) and exports variables. | ||
We'll create a self-contained script for each of `a8` and `venvs_path`, | ||
so that we can easily call them from Bash. | ||
|
||
Assuming `~/.local/bin` is in your `PATH`, run | ||
|
||
```console | ||
$ zpy mkbin a8 ~/.local/bin/ | ||
$ zpy mkbin venvs_path ~/.local/bin/ | ||
``` | ||
|
||
Now define a Bash function within the file `~/.config/direnv/direnvrc`: | ||
|
||
```bash | ||
layout_zpy () { | ||
a8 | ||
export VIRTUAL_ENV="$(venvs_path)/venv" | ||
PATH_add "$VIRTUAL_ENV/bin" | ||
export VENV_ACTIVE=1 | ||
} | ||
``` | ||
|
||
In any project folder, create `.envrc`: | ||
|
||
```bash | ||
layout zpy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.