Skip to content

Commit 7105b20

Browse files
committed
feat: updated python docs
1 parent 440f7c9 commit 7105b20

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

docs/platforms/python/agno.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ uv tool install "agno[aws]"
2626
> They help us manage our *Agentic System* as code.
2727
2828
```shell
29-
ag ws create --template agent-app --name agent-app
30-
# or use aws app template
31-
ag ws create -t agent-app-aws -n agent-app
32-
# or use aws api template
33-
ag ws create -t agent-api-aws -n agent-api
29+
ag ws create --template agent-api --name my-agents
3430
```
3531

3632
This will create a folder named `agent-app` with the following structure:
@@ -39,7 +35,6 @@ This will create a folder named `agent-app` with the following structure:
3935
agent-app # root directory
4036
├── agents # your Agents go here
4137
├── api # your Api routes go here
42-
├── ui # your Streamlit apps go here
4338
├── db # your database tables go here
4439
├── Dockerfile # Dockerfile for the application
4540
├── pyproject.toml # python project definition

docs/platforms/python/uv.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,29 @@ To add a dependency to a specific group, use the `--group` flag:
102102
uv add --group group_name package_name
103103
```
104104

105+
#### Managing Tools: Global vs. Project-Specific
106+
107+
**uv** makes it easy to install CLI tools
108+
109+
##### Installing Global Tools
110+
111+
```shell
112+
uv tool install black
113+
```
114+
115+
This makes **black** available across all your projects but keeps it in its isolated virtual environment, avoiding system-wide conflicts.
116+
117+
##### Project-Specific Tools
118+
119+
If you need a tool for a specific project, add it directly as a dependency:
120+
121+
```shell
122+
uv add --group dev ruff
123+
```
124+
125+
This keeps the tool local to your project and listed in your `pyproject.toml`.
126+
Your other projects remain unaffected, allowing for isolated development environments.
127+
105128
### Running Python scripts with UV
106129

107130
Once you install the necessary dependencies, you can start working on your Python scripts as usual. UV provides a few different ways to run Python code:
@@ -112,6 +135,13 @@ uv run hello.py
112135

113136
The run command ensures that the script is executed inside the virtual environment UV created for the project.
114137

138+
#### Environment variables
139+
140+
`uv run` can load [environment variables](https://docs.astral.sh/uv/configuration/files/#env) from dotenv files (e.g., `.env`, `.env.local`, `.env.development`), powered by the [dotenvy](https://github.com/allan2/dotenvy) crate.
141+
To load a `.env` file from a dedicated location, set the `UV_ENV_FILE` environment variable, or pass the `--env-file` flag to `uv run`.
142+
143+
The `--env-file` flag can be provided multiple times, with subsequent files overriding values defined in previous files.
144+
115145
### Changing Python versions for the current project
116146

117147
You can switch Python versions for your current UV project at any point as long as the new version satisfies the specifications in your pyproject.toml file.
@@ -134,7 +164,7 @@ UV provides two special interfaces to manage these packages:
134164
uv tool run black hello.py
135165
```
136166

137-
2. Using the shorter and more convenient `uvx` command:
167+
2. Running Tools Ephemerally with `uvx` command:
138168

139169
```shell
140170
uvx black hello.py
@@ -369,3 +399,5 @@ uv cache prune
369399
* UV [Working on projects](https://docs.astral.sh/uv/guides/projects/)
370400
* Beyond Hypermodern: [Python is easy now](https://rdrn.me/postmodern-python/)
371401
* Python UV: [The Ultimate Guide to the Fastest Python Package Manager](https://www.datacamp.com/tutorial/python-uv)
402+
* [Writing your pyproject.toml](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/)
403+
* Mastering Python Project Management with uv: Part 2 — [Deep Dives and Advanced Use](https://bury-thomas.medium.com/mastering-python-project-management-with-uv-part-2-deep-dives-and-advanced-use-1e2540e6f4a6)

0 commit comments

Comments
 (0)