Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: small fixes in tutorials/python.md #2252

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/tutorials/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ We now have the following directory structure:
```shell
.
├── pixi_py
│   ── __init__.py
│   ── __init__.py
└── pyproject.toml
```

We've used a flat-layout here but pixi supports both [flat- and src-layouts](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/#src-layout-vs-flat-layout).

### What's in the `pyproject.toml`?

Okay, so let's have a look at what's sections have been added and how we can modify the `pyproject.toml`.
Okay, so let's have a look at what sections have been added and how we can modify the `pyproject.toml`.

These first entries were added to the `pyproject.toml` file:

Expand Down Expand Up @@ -304,7 +304,7 @@ Giving us the following project structure:
.
├── pixi.lock
├── pixi_py
│   ── __init__.py
│   ── __init__.py
├── pyproject.toml
└── tests/test_me.py
```
Expand Down Expand Up @@ -349,15 +349,15 @@ Neat! It seems to be working!

### Test vs Default environment

The interesting thing is if we compare the output of the two environments.
Let's compare the output of the test and default environments...

```shell
pixi list -e test
# v.s. default environment
# vs. default environment
pixi list
```

Is that the test environment has:
We see that the test environment has:

```shell
package version build size kind source
Expand All @@ -366,7 +366,7 @@ pytest 8.1.1 1.1 mib pypi pytest-8.1.
...
```

But the default environment is missing this package.
However, the default environment is missing this package.
This way, you can finetune your environments to only have the packages that are needed for that environment.
E.g. you could also have a `dev` environment that has `pytest` and `ruff` installed, but you could omit these from the `prod` environment.
There is a [docker](https://github.com/prefix-dev/pixi/tree/main/examples/docker) example that shows how to set up a minimal `prod` environment and copy from there.
Expand Down
Loading