Packaging#
注釈
We follow Scientific Python Ecosystem Coordination (SPEC)
recommendation for Minimum Supported Dependencies (SPEC 0), and
typically support the latest 2-3 distributions of python.
Reference:
pyproject.toml
Package management is orchestrated and performed by pixi.
Our pixi environments, features,
and tasks are defined within the pyproject.toml manifest.
pixi offers fast, reproducible, cross-platform environment management that
enables us to resolve and provision robust, consistent environments
blended with packages from both conda and PyPI ecosystems.
We offer several similar collections of pixi environments for each
supported distribution of python. Each environment within a collection belongs
to the same solve-group i.e., environments within the same solve-group
have their dependencies resolved at the same time, which means that all
those environments share the exact same dependencies but may also include
additional dependencies compatible within the solve-group.
Tip
We've adopted the following format convention to help clarify each type of
pixi component:
environment-name
{feature-name}task-namesolve-group-name
Pixi Solve-Groups#
Reference:
pyproject.toml
Our pixi environments are organized into collections by solve-group.
See the [tool.pixi.environments] table defined in the pyproject.toml
manifest.
The primary solve-group is called default and will always
contain the latest supported distribution of python. This is denoted by
the {py} feature which represents the latest distribution of python
as recommended by SPEC 0.
Environment |
Features |
説明 |
|---|---|---|
default |
|
This environment contains the core
dependencies of |
devs |
|
As per the default environment plus additional development dependencies. |
docs |
|
As per the devs environment plus additional documentation dependencies. |
geovista |
|
This environment is the union of all environments in the default solve-group. |
test |
|
As per the devs environment plus additional test dependencies. |
参考
The pixi info command provides key information about the system, environments,
solve-groups, dependencies and tasks in the workspace.
Given the above default solve-group we have the following inheritance relationship between its environments:
---
config:
theme: base
themeVariables:
lineColor: "#F8B229"
nodeBorder: "#2569E9"
primaryColor: "#DCE7FC"
secondaryColor: "#F4DDFF"
---
graph LR
default(["`**default**`"])
devs(["`**devs**`"])
docs(["`**docs**`"])
test(["`**test**`"])
geovista(["`**geovista**`"])
default -. "`*core*`" .-> devs
devs ---> docs
devs ---> test
docs ---> geovista
test ---> geovista
Fig. 7: Environment Hierarchy for default Solve-Group#
注釈
As its name suggests, the default environment is used
by default when no explicit environment name is specified to pixi.
e.g., the pixi shell command starts a shell with the default
environment activated, whereas the pixi shell -e devs command will
activate the devs environment instead.
Several secondary solve-groups are available, each of which are named
after the distribution of python that they support e.g., py313.
The number of different python distribution solve-groups on offer at any
given time is dictated by SPEC 0.
The generic py3xx solve-group is used here as a convenience to
represent each of the different python distribution solve-groups available,
all of which are identical in structure and content apart from the specific
distribution of python that they support.
Also note that each py3xx solve-group will always contain the
similarly named {py3xx} feature e.g., the py313 solve-group
will contain the {py313} feature which in turn defines the python=3.13
dependency to be included in all py313 environments.
Environment |
Feature |
説明 |
|---|---|---|
devs-py3xx |
|
As per the py3xx environment plus additional development dependencies. |
docs-py3xx |
|
As per the devs-py3xx environment plus additional documentation dependencies. |
geovista-py3xx |
|
This environment is the union of all environments in the same py3xx solve-group. |
py3xx |
|
This environment contains the core
dependencies of |
test-py3xx |
|
As per the devs-py3xx environment plus additional test dependencies. |
注意
The generic py3xx solve-group does not exist, neither does
the generic {py3xx} feature.
Given the above py3xx solve-group we have the following inheritance relationship between its environments:
---
config:
theme: base
themeVariables:
lineColor: "#F8B229"
nodeBorder: "#2569E9"
primaryColor: "#DCE7FC"
secondaryColor: "#F4DDFF"
---
graph LR
py3xx(["`**py3xx**`"])
devs(["`**devs-py3xx**`"])
docs(["`**docs-py3xx**`"])
test(["`**test-py3xx**`"])
geovista(["`**geovista-py3xx**`"])
py3xx --> |"`*core*`"| devs
devs --> docs
devs --> test
docs --> geovista
test --> geovista
Fig. 8: Environment Hierarchy for py3xx Solve-Group#
Pixi Features#
Reference:
pyproject.toml
A pixi environment is defined by combining one or
more features. For further details see this pixi tutorial
on how to create and use features in a multi-environment scenario.
Our features are defined under the [tool.pixi.feature] tables in the
pyproject.toml manifest.
Each named feature table e.g., [tool.pixi.feature.devs], may contain
various fields, such as dependencies, pypi-dependencies,
pypi-options, system-requirements, activation, platforms,
channels, channel-priority, target and tasks.
Feature |
TOML Table |
説明 |
|---|---|---|
|
|
This feature is used to define the core
|
|
|
This feature is used to define the development
|
|
|
This feature is used to define the
documentation |
|
|
This feature is only used to define |
|
|
This feature is used to explicitly define the
distribution of |
|
|
This feature is used to define the test
|
Pixi Tasks#
Reference:
pyproject.toml
A pixi task is a custom cross-platform workflow command
that is defined as part of a feature within an
environment.
All our tasks are defined within the pyproject.toml manifest.
Tasks expose a convenient and easy to use entry-point to commands that allow streamlined and automated custom workflows.
The following tasks are defined for each of our features:
Feature |
Task |
説明 |
|---|---|---|
|
|
Download and cache offline assets. This task calls the geovista download command. Provide optional
argument $ pixi run download operational
|
|
|
Purge all sphinx-autoapi, sphinx-gallery sphinx-tags, carousel, and other sphinx-build artifacts e.g., $ pixi run clean
This task is an alias for the |
|
Perform both the $ pixi run clean-all
This task is an alias for the |
|
|
Purge the myst-nb Jupyter cache. See myst-nb configuration for further details e.g., $ pixi run clean-cache
This task is an alias for the |
|
|
Execute sphinx.ext.doctest to test code snippets within the documentation i.e., $ pixi run doctest
Note that the This task is an alias for the |
|
|
Build the documentation. Provide optional argument $ pixi run make html-gallery
Note that the This task is an alias for the |
|
|
Build the documentation and start a local Note that the Defaults to passing $ pixi run serve-html html
This task is an alias for the |
|
|
|
Perform documentation image tests of $ pixi run tests-doc
This task calls Note that the This task is only available in the geovista and geovista-py3xx environments. 注釈 Failed image tests are captured via the |
|
|
Purge both the documentation and unit test image caches, along with any images generated from previous test sessions e.g., $ pixi run tests-clean
|
|
Perform the unit tests. This task calls the Accepts a valid $ pixi run tests-unit "not image"
Note that the 注釈 Failed Image Tests are captured via the
|
参考
The pixi task list command describes each task available within the workspace.
Whereas the pixi task list --summary command enumerates the tasks available per environment.
Continuous Integration#
Reference:
.github/workflows
The following packaging workflows are available:
Workflow |
説明 |
|---|---|
The ci-locks.yml Only the latest Additionally, the geovista-py3xx environment will be exported
to the |
|
The ci-wheels.yml GHA workflow builds, tests and publishes the
source distribution ( We have adopted PyPI Trusted Publishing with OpenID Connect (OIDC) for secure deployments of assets. Note that the |
Python Package Index#
Reference:
pyproject.tomlrequirements
PyPI package dependencies are configured in the pyproject.toml manifest
under the [tool.setuptools.dynamic] and
[tool.setuptools.dynamic.optional-dependencies] table entries.
Version management of our PyPI dependencies is orchestrated by
Dependabot. Refer to the package-ecosystem: "pip" key entry in the
.github/dependabot.yml file for further details.
The Dependabot service is regularly scheduled to check the
versions of our dependencies and automatically increment them using maximum
capping pins via a pull-request in response to the
latest available package updates within the PyPI ecosystem.
注意
Updates to the PyPI maximum capping pins may require to be manually
reflected in the pyproject.toml manifest for similar pixi managed
conda dependencies.
Track native Dependabot support for pixi in
dependabot/dependabot-core issue#2227 🤞