Skip to content

Commit 3021df8

Browse files
committed
deploy: 2a16a61
1 parent 5ce2ae7 commit 3021df8

File tree

64 files changed

+158
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+158
-214
lines changed

.doctrees/TRANSLATING.doctree

0 Bytes
Binary file not shown.

.doctrees/environment.pickle

-4.23 KB
Binary file not shown.
-3.34 KB
Binary file not shown.

TRANSLATING.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

_sources/package-structure-code/declare-dependencies.md.txt

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ There are three different types of dependencies that you will learn about on thi
5858
2. **Feature Dependencies:** These are dependencies that are required if a user wants to access additional functionality (that is not core) to your package. Store these in the `[project.optional.dependencies]` table or your pyproject.toml file.
5959
3. **Development Dependencies:** These dependencies are required if someone wants to develop or work on your package. These include instance linters, testing tools like pytest and mypy are examples of development dependencies. Store these in the `[project.dependency.groups]` table or your pyproject.toml file.
6060

61-
:::{admonition}
61+
:::{tip}
6262
A dependency is not part of your project's codebase. It is a package or software called
6363
within the code of your project or used during the development of your package.
6464
:::
@@ -85,7 +85,7 @@ dependencies = [
8585
]
8686
```
8787

88-
:::{admonition
88+
:::{tip}
8989
Try your best to minimize dependencies whenever possible. Remember that
9090
fewer dependencies reduce the possibility of version conflicts in user
9191
environments.
@@ -406,10 +406,8 @@ dependencies = [
406406

407407

408408
:::{todo}
409-
### Using conda and pixi
409+
### Using conda and Pixi
410410

411-
::::{todo}
412-
Ask Matthew to review this section...
413411
:::
414412

415413
The `pyproject.toml` file works great for pure-Python packages. However,
@@ -423,64 +421,41 @@ You can maintain an `environment.yml` file to help users and contributors
423421
set up conda environments. This is especially useful for packages with
424422
system-level dependencies like GDAL.
425423

426-
**Consider pixi for conda workflows:**
424+
**Consider Pixi for conda package focused workflows:**
425+
426+
[Pixi](https://pixi.sh) is a modern package manager built on top of both
427+
the conda and Python package ecosystems.
428+
Pixi is able to treat conda and Python package requirements with parity when
429+
resolving environments, but uses a "conda-first" approach of using already
430+
resolved conda packages if possible when resolving Python dependencies.
431+
Pixi [can also use `pyproject.toml` for configuration](https://pixi.sh/latest/python/pyproject_toml/).
432+
If your project relies heavily on conda packages, Pixi offers a streamlined
433+
workflow with faster dependency resolution and automatic lock file support for
434+
full environment reproducibility.
435+
If you already have an existing conda environment definition file, like
436+
an `environment.yml`, you can
437+
[import the environment](https://pixi.sh/latest/tutorials/import/) into a new
438+
Pixi workspace with
427439

428-
[Pixi](https://pixi.sh) is a modern package manager built on conda that
429-
uses `pyproject.toml` for configuration. If your project relies heavily
430-
on conda packages, pixi offers a streamlined workflow with lockfiles and
431-
faster dependency resolution.
440+
```
441+
pixi init --import environment.yml
442+
```
432443

433444
:::{admonition} A note for conda users
434445
:class: tip
435446

436447
If you use a conda environment for development and install your package
437-
with `python -m pip install -e .`, dependencies will be installed from
438-
PyPI rather than conda. This can cause conflicts, especially for packages
439-
with system dependencies.
448+
with `python -m pip install -e .` dependencies will be installed from PyPI,
449+
potentially overwriting conda packages that had already been installed.
450+
This can cause conflicts, especially for packages with system dependencies.
440451

441452
To avoid this, install your package without dependencies:
442-
`python -m pip install -e . --no-deps`
443-
444-
Then install dependencies through your conda environment.yml file.
445-
:::
446-
::::
447-
448-
### Using conda and pixi
449-
450-
:::{todo}
451-
Ask matthew to review this section...
452-
:::
453-
454-
The `pyproject.toml` file works great for pure-Python packages. However,
455-
some packages (particularly in the scientific Python ecosystem) require
456-
dependencies written in other languages like C or Fortran. Conda was
457-
created to support the distribution of tools with non-Python dependencies.
458453

459-
**For conda users:**
460-
461-
You can maintain an `environment.yml` file to help users and contributors
462-
set up conda environments. This is especially useful for packages with
463-
system-level dependencies like GDAL.
464-
465-
**Consider pixi for conda workflows:**
466-
467-
[Pixi](https://pixi.sh) is a modern package manager built on conda that
468-
uses `pyproject.toml` for configuration. If your project relies heavily
469-
on conda packages, pixi offers a streamlined workflow with lockfiles and
470-
faster dependency resolution.
471-
472-
:::{admonition} A note for conda users
473-
:class: tip
474-
475-
If you use a conda environment for development and install your package
476-
with `python -m pip install -e .`, dependencies will be installed from
477-
PyPI rather than conda. This can cause conflicts, especially for packages
478-
with system dependencies.
479-
480-
To avoid this, install your package without dependencies:
481-
`python -m pip install -e . --no-deps`
454+
```
455+
python -m pip install -e . --no-deps
456+
```
482457

483-
Then install dependencies through your conda environment.yml file.
458+
Then install dependencies through your conda `environment.yml` file.
484459
:::
485460

486461
## Dependencies in Read the Docs

ja/.doctrees/CONTRIBUTING.doctree

0 Bytes
Binary file not shown.

ja/.doctrees/TRANSLATING.doctree

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)