diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e591329dd..a843cf5428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,6 +171,29 @@ jobs: exit 1 fi + check-manifest-docs: + name: check manifest docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + with: + persist-credentials: false + - uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 + with: + environments: "schema" + + - name: Regenerate manifest documentation + run: pixi run -e schema generate-manifest-docs + + - name: Check if there are any changes + run: | + if ! git diff --quiet; then + echo "Error: Generated manifest documentation differs from committed version" + echo "Please run 'pixi run -e schema generate-manifest-docs' to regenerate and commit." + git diff + exit 1 + fi + # Run tests on important platforms. # diff --git a/docs/reference/_schema_tables.txt b/docs/reference/_schema_tables.txt new file mode 100644 index 0000000000..985e7df3fe --- /dev/null +++ b/docs/reference/_schema_tables.txt @@ -0,0 +1,334 @@ + + +--8<-- [start:workspace] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `name` | str | no | The name of the project; we advise use of the name of the repository
**Examples:** `my-project` | +| `version` | str | no | The version of the project; we advise use of [SemVer](https://semver.org)
**Examples:** `1.2.3` | +| `description` | str | no | A short description of the project
**Examples:** `A simple project` | +| `authors` | list of str | no | The authors of the project
**Examples:** `John Doe ` | +| `channels` | URL | yes | The `conda` channels that can be used in the project. Unless overridden by `priority`, the first channel listed will be preferred.
**Examples:** `["conda-forge", "pytorch"]` | +| `channel-priority` | `disabled` \| `strict` | no | The type of channel priority that is used in the solve. - 'strict': only take the package from the channel it exist in first. - 'disabled': group all dependencies together as if there is no channel difference.
**Examples:** `strict`, `disabled` | +| `solve-strategy` | `highest` \| `lowest` \| `lowest-direct` | no | The strategy that is used in the solve. - 'highest': solve all packages to the highest compatible version. - 'lowest': solve all packages to the lowest compatible version. - 'lowest-direct': solve direct dependencies to the lowest compatible version and transitive ones to the highest compatible version.
**Examples:** `lowest`, `lowest-direct`, `highest` | +| `exclude-newer` | str | no | Exclude any package newer than this timestamp or duration. Can be an absolute timestamp or a relative duration accepted by humantime (for example '0d', '1 week', '2w', '1 month', '1M', '72h', '72 hours', or '1h30m').
**Examples:** `2023-11-03T03:33:12Z`, `2026-04-01`, `0d`, `1 week`, `2w`, `1 month`, `1M`, `72h`, `72 hours`, `1h30m` | +| `platforms` | list of `emscripten-wasm32` \| `linux-32` \| `linux-64` \| `linux-aarch64` \| `linux-armv6l` \| `linux-armv7l` \| `linux-ppc64` \| `linux-ppc64le` \| `linux-riscv32` \| `linux-riscv64` \| `linux-s390x` \| `noarch` \| `osx-64` \| `osx-arm64` \| `unknown` \| `wasi-wasm32` \| `win-32` \| `win-64` \| `win-arm64` \| `zos-z` or str or `WorkspacePlatform` object | no | The platforms that the project supports. Each entry is either a conda subdir, the name of a workspace platform defined elsewhere, or an inline table describing a workspace platform (optional `name`, optional `platform`, plus virtual-package shortcut keys such as `cuda`, `archspec`, `glibc`, `linux`, `macos`/`osx`, `windows`).
**Examples:** `["linux-64", "osx-arm64", "win-64"]` | +| `license` | str | no | The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier.
**Examples:** `MIT` | +| `license-file` | str | no | The path to the license file of the project
**Examples:** `LICENSE.md` | +| `readme` | str | no | The path to the readme file of the project
**Examples:** `README.md` | +| `homepage` | URL | no | The URL of the homepage of the project
**Examples:** `https://pixi.sh` | +| `repository` | URL | no | The URL of the repository of the project
**Examples:** `https://github.com/prefix-dev/pixi` | +| `documentation` | URL | no | The URL of the documentation of the project
**Examples:** `https://pixi.sh/latest/` | +| `conda-pypi-map` | URL | no | The `conda` to PyPI mapping configuration; `false` disables the mapping entirely | +| `pypi-options` | ForwardRef('PyPIOptions | None', is_class=True) | no | Options related to PyPI indexes for this project | +| `s3-options` | ForwardRef('dict[str, S3Options] | None', is_class=True) | no | Options related to S3 for this project | +| `preview` | list of `pixi-build` or str or bool | no | Defines the enabling of preview features of the project | +| `build-variants-files` | list of str | no | Ordered list of variant definition files. | +| `build-variants` | map of str to list of str | no | The build variants of the project | +| `requires-pixi` | str | no | The required version spec for pixi itself to resolve and build the project.
**Examples:** `>=0.40` | +| `dependencies` | ForwardRef('Dependencies', is_class=True) | no | Inheritable `conda` dependency pool. Members opt in by writing `{ workspace = true }` in any `[package.*-dependencies]` table (or in `[package.build.backend]`). Relative `path` specs resolve against this manifest and are re-anchored per consuming member.
**Examples:** `{"numpy": "1.*", "boltons": {"version": ">=24", "channel": "conda-forge"}}` | +--8<-- [end:workspace] + +--8<-- [start:workspace_platforms] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `name` | str | no | The workspace-scoped name features reference this platform by. Defaults to a name auto-derived from `platform` plus the declared virtual packages when omitted. | +| `platform` | `emscripten-wasm32` \| `linux-32` \| `linux-64` \| `linux-aarch64` \| `linux-armv6l` \| `linux-armv7l` \| `linux-ppc64` \| `linux-ppc64le` \| `linux-riscv32` \| `linux-riscv64` \| `linux-s390x` \| `noarch` \| `osx-64` \| `osx-arm64` \| `unknown` \| `wasi-wasm32` \| `win-32` \| `win-64` \| `win-arm64` \| `zos-z` | no | The conda subdir this platform targets. Falls back to `name` parsed as a subdir when omitted. | +| `cuda` | str or `CudaTable` object | no | Declare a `__cuda` virtual package at the given version (e.g. `12.0`), or a `{ driver, arch }` table to also declare `__cuda_arch` (GPU compute capability). | +| `archspec` | str | no | Declare a `__archspec` virtual package with the given microarchitecture, e.g. `x86-64-v3`. | +| `glibc` | str | no | Declare a `__glibc` virtual package at the given version, e.g. `2.28`. | +| `linux` | str | no | Declare a `__linux` virtual package at the given kernel version, e.g. `5.10`. | +| `macos` | str | no | Declare a `__osx` virtual package at the given macOS version, e.g. `14.0`. | +| `osx` | str | no | Alias for `macos`: declare a `__osx` virtual package at the given macOS version, e.g. `14.0`. | +| `windows` | str | no | Declare a `__win` virtual package at the given Windows version, e.g. `10`. | +--8<-- [end:workspace_platforms] + +--8<-- [start:channel] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `channel` | URL | yes | The channel the packages needs to be fetched from | +| `priority` | int | no | The priority of the channel | +| `exclude-newer` | str | no | Override the workspace-level `exclude-newer` cutoff for this channel only | +--8<-- [end:channel] + +--8<-- [start:dependencies] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `version` | str | no | The version of the package in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format | +| `build` | str | no | The build string of the package | +| `build-number` | str | no | The build number of the package, can be a spec like `>=1` or `<=10` or `1` | +| `file-name` | str | no | The file name of the package | +| `channel` | str | no | The channel the packages needs to be fetched from
**Examples:** `conda-forge`, `pytorch`, `https://prefix.dev/conda-forge` | +| `subdir` | str | no | The subdir of the package, also known as platform | +| `extras` | list of str | no | Optional extra dependencies to select for the package | +| `flags` | list of str | no | Plain string flags used to select package variants | +| `license` | str | no | The license of the package | +| `license-family` | str | no | The license family of the package | +| `when` | ForwardRef('When | None', is_class=True) | no | The condition under which this match spec applies. Use a package string, `{ all = [...] }`, `{ any = [...] }`, or `{ package = ..., version = ..., build = ... }`. | +| `track-features` | list of str | no | The track features of the package | +| `path` | str | no | The path to the package | +| `url` | str | no | The URL to the package | +| `md5` | str | no | The md5 hash of the package | +| `sha256` | str | no | The sha256 hash of the package | +| `git` | str | no | The git URL to the repo | +| `rev` | str | no | A git SHA revision to use | +| `tag` | str | no | A git tag to use | +| `branch` | str | no | A git branch to use | +| `subdirectory` | str | no | A subdirectory to use in the repo | +--8<-- [end:dependencies] + +--8<-- [start:pypi_version] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `version` | str | no | The version of the package in [PEP 440](https://www.python.org/dev/peps/pep-0440/) format | +| `index` | str | no | The index to fetch the package from | +--8<-- [end:pypi_version] + +--8<-- [start:pypi_path] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `path` | str | no | A path to a local source or wheel | +| `editable` | bool | no | If `true` the package will be installed as editable | +| `subdirectory` | str | no | The subdirectory in the repo, a path from the root of the repo. | +--8<-- [end:pypi_path] + +--8<-- [start:pypi_url] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `url` | str | no | A URL to a remote source or wheel | +--8<-- [end:pypi_url] + +--8<-- [start:pypi_git_branch] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `git` | str | no | The `git` URL to the repo e.g https://github.com/prefix-dev/pixi | +| `subdirectory` | str | no | The subdirectory in the repo, a path from the root of the repo. | +| `branch` | str | no | A `git` branch to use | +--8<-- [end:pypi_git_branch] + +--8<-- [start:pypi_git_tag] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `git` | str | no | The `git` URL to the repo e.g https://github.com/prefix-dev/pixi | +| `subdirectory` | str | no | The subdirectory in the repo, a path from the root of the repo. | +| `tag` | str | no | A `git` tag to use | +--8<-- [end:pypi_git_tag] + +--8<-- [start:pypi_git_rev] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `extras` | list of str | no | The [PEP 508 extras](https://peps.python.org/pep-0508/#extras) of the package | +| `git` | str | no | The `git` URL to the repo e.g https://github.com/prefix-dev/pixi | +| `subdirectory` | str | no | The subdirectory in the repo, a path from the root of the repo. | +| `rev` | str | no | A `git` SHA revision to use | +--8<-- [end:pypi_git_rev] + +--8<-- [start:tasks] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `cmd` | list of str or str | no | A shell command to run the task in the limited, but cross-platform `bash`-like `deno_task_shell`. See the documentation for [supported syntax](https://pixi.sh/latest/environments/advanced_tasks/#syntax) | +| `cwd` | str | no | The working directory to run the task | +| `depends_on` | list of str or str | no | The tasks that this task depends on. Environment variables will **not** be expanded. Deprecated in favor of `depends-on` from v0.21.0 onward. | +| `depends-on` | list of `DependsOn` object or str or `DependsOn` object or str | no | The tasks that this task depends on. Environment variables will **not** be expanded. | +| `inputs` | list of str | no | A list of `.gitignore`-style glob patterns that should be watched for changes before this command is run. Environment variables _will_ be expanded. | +| `outputs` | list of str | no | A list of `.gitignore`-style glob patterns that are generated by this command. Environment variables _will_ be expanded. | +| `env` | map of str to str | no | A map of environment variables to values, used in the task, these will be overwritten by the shell.
**Examples:** `{"key": "value"}`, `{"ARGUMENT": "value"}` | +| `default-environment` | string | no | A default environment to run the task | +| `description` | str | no | A short description of the task | +| `clean-env` | bool | no | Whether to run in a clean environment, removing all environment variables except those defined in `env` and by pixi itself. | +| `args` | list of `TaskArgs` object or str | no | The arguments to a task
**Examples:** `["arg1", "arg2"]`, `["arg", {"arg": "arg2", "default": "2"}]`, `["arg", {"arg": "arg2", "default": "2", "choices": ["1", "2", "4"]}]` | +--8<-- [end:tasks] + +--8<-- [start:task_args] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `arg` | str | yes | The name of the argument | +| `default` | str | no | The default value of the argument | +| `choices` | list of str | no | Allowed values for the argument | +--8<-- [end:task_args] + +--8<-- [start:task_depends_on] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `task` | str | yes | the name of the task to depend on | +| `args` | list of str or map of str to str | no | The (positional or named) arguments to pass to the task | +| `environment` | string | no | The environment to use for the task | +--8<-- [end:task_depends_on] + +--8<-- [start:system_requirements] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `linux` | float or str | no | The minimum version of the Linux kernel | +| `unix` | bool or str | no | Whether the project supports UNIX
**Examples:** `true` | +| `libc` | `LibcFamily` object or float or str | no | The minimum version of `libc` | +| `cuda` | float or str | no | The minimum version of CUDA | +| `archspec` | str | no | The architecture the project supports | +| `macos` | float or str | no | The minimum version of MacOS | +--8<-- [end:system_requirements] + +--8<-- [start:feature] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `channels` | URL | no | The `conda` channels that can be considered when solving environments containing this feature | +| `channel-priority` | `disabled` \| `strict` | no | The type of channel priority that is used in the solve. - 'strict': only take the package from the channel it exist in first. - 'disabled': group all dependencies together as if there is no channel difference.
**Examples:** `strict`, `disabled` | +| `solve-strategy` | `highest` \| `lowest` \| `lowest-direct` | no | The strategy that is used in the solve. - 'highest': solve all packages to the highest compatible version. - 'lowest': solve all packages to the lowest compatible version. - 'lowest-direct': solve direct dependencies to the lowest compatible version and transitive ones to the highest compatible version.
**Examples:** `lowest`, `lowest-direct`, `highest` | +| `platforms` | list of `emscripten-wasm32` \| `linux-32` \| `linux-64` \| `linux-aarch64` \| `linux-armv6l` \| `linux-armv7l` \| `linux-ppc64` \| `linux-ppc64le` \| `linux-riscv32` \| `linux-riscv64` \| `linux-s390x` \| `noarch` \| `osx-64` \| `osx-arm64` \| `unknown` \| `wasi-wasm32` \| `win-32` \| `win-64` \| `win-arm64` \| `zos-z` or str | no | The platforms that the feature supports: a union of all features combined in one environment is used for the environment. Each entry is either a conda subdir or the name of a workspace platform. | +| `dependencies` | map of str to str or `MatchspecTable` object | no | The `conda` dependencies, consisting of a package name and a requirement in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format | +| `host-dependencies` | map of str to str or `MatchspecTable` object | no | The host `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information.
**Examples:** `{"python": ">=3.8"}` | +| `build-dependencies` | map of str to str or `MatchspecTable` object | no | The build `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information. | +| `constraints` | map of str to str or `MatchspecTable` object | no | The `conda` version constraints. These constrain the versions of packages that may be installed without explicitly requiring them. If the package is installed as a dependency of another package, it must satisfy these constraints. | +| `pypi-dependencies` | map of str to str or `PyPIVersion` object or `PyPIGitBranchRequirement` object or `PyPIGitTagRequirement` object or `PyPIGitRevRequirement` object or `PyPIPathRequirement` object or `PyPIUrlRequirement` object | no | The PyPI dependencies of this feature | +| `dev` | map of str to `SourceSpecTable` object | no | Source packages whose dependencies should be installed without building the package itself. Useful for development environments. | +| `tasks` | map of str to `TaskInlineTable` object or list of `DependsOn` object or str | no | The tasks provided by this feature | +| `activation` | `Activation` object | no | The scripts used on the activation of environments using this feature | +| `system-requirements` | `SystemRequirements` object | no | The system requirements of this feature | +| `target` | map of str to `Target` object | no | Machine-specific aspects of this feature
**Examples:** `{"linux": {"dependencies": {"python": "3.8"}}}` | +| `pypi-options` | ForwardRef('PyPIOptions | None', is_class=True) | no | Options related to PyPI indexes for this feature | +--8<-- [end:feature] + +--8<-- [start:environments] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `features` | list of str | no | The features that define the environment | +| `solve-group` | str | no | The group name for environments that should be solved together | +| `no-default-feature` | bool | no | Whether to add the default feature to this environment | +--8<-- [end:environments] + +--8<-- [start:activation] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `scripts` | list of str | no | The scripts to run when the environment is activated
**Examples:** `activate.sh`, `activate.bat` | +| `env` | map of str to str | no | A map of environment variables to values, used in the activation of the environment. These will be set in the shell. Thus these variables are shell specific. Using '$' might not expand to a value in different shells.
**Examples:** `{"key": "value"}`, `{"ARGUMENT": "value"}` | +--8<-- [end:activation] + +--8<-- [start:target] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `dependencies` | map of str to str or `MatchspecTable` object | no | The `conda` dependencies, consisting of a package name and a requirement in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format | +| `host-dependencies` | map of str to str or `MatchspecTable` object | no | The host `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information.
**Examples:** `{"python": ">=3.8"}` | +| `build-dependencies` | map of str to str or `MatchspecTable` object | no | The build `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information. | +| `constraints` | map of str to str or `MatchspecTable` object | no | The `conda` version constraints. These constrain the versions of packages that may be installed without explicitly requiring them. If the package is installed as a dependency of another package, it must satisfy these constraints. | +| `pypi-dependencies` | map of str to str or `PyPIVersion` object or `PyPIGitBranchRequirement` object or `PyPIGitTagRequirement` object or `PyPIGitRevRequirement` object or `PyPIPathRequirement` object or `PyPIUrlRequirement` object | no | The PyPI dependencies for this target | +| `dev` | map of str to `SourceSpecTable` object | no | Source packages whose dependencies should be installed without building the package itself. Useful for development environments. | +| `tasks` | map of str to `TaskInlineTable` object or list of `DependsOn` object or str | no | The tasks of the target | +| `activation` | `Activation` object | no | The scripts used on the activation of the project for this target | +--8<-- [end:target] + +--8<-- [start:pypi_options] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `index-url` | str | no | PyPI registry that should be used as the primary index
**Examples:** `https://pypi.org/simple` | +| `extra-index-urls` | list of str | no | Additional PyPI registries that should be used as extra indexes
**Examples:** `["https://pypi.org/simple"]` | +| `find-links` | list of `FindLinksPath` object or `FindLinksURL` object | no | Paths to directory containing
**Examples:** `[{"path": "./links"}, {"url": "https://example.com/links"}]` | +| `no-build-isolation` | bool or list of str | no | Packages that should NOT be isolated during the build process
**Examples:** `["numpy"]`, `true` | +| `index-strategy` | `first-index` or `unsafe-first-match` or `unsafe-best-match` | no | The strategy to use when resolving packages from multiple indexes
**Examples:** `first-index`, `unsafe-first-match`, `unsafe-best-match` | +| `no-build` | bool or list of str | no | Packages that should NOT be built
**Examples:** `true`, `false` | +| `dependency-overrides` | map of str to str or `PyPIVersion` object or `PyPIGitBranchRequirement` object or `PyPIGitTagRequirement` object or `PyPIGitRevRequirement` object or `PyPIPathRequirement` object or `PyPIUrlRequirement` object | no | A list of PyPI dependencies that override the resolved dependencies
**Examples:** `{"numpy": ">=1.21.0"}` | +| `no-binary` | bool or list of str | no | Don't use pre-built wheels for these packages
**Examples:** `true`, `false` | +| `prerelease-mode` | `disallow` or `allow` or `if-necessary` or `explicit` or `if-necessary-or-explicit` | no | The strategy to use when considering pre-release versions
**Examples:** `disallow`, `allow`, `if-necessary`, `explicit`, `if-necessary-or-explicit` | +| `skip-wheel-filename-check` | bool | no | Skip wheel filename validation, allowing installation of wheels with version mismatches between filename and metadata
**Examples:** `true`, `false` | +--8<-- [end:pypi_options] + +--8<-- [start:package] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `name` | str or `WorkspaceInheritance` object | no | The name of the package. Can be a string or { workspace = true } to inherit from workspace | +| `version` | str or `WorkspaceInheritance` object | no | The version of the project; we advise use of [SemVer](https://semver.org). Can be a string or { workspace = true } to inherit from workspace
**Examples:** `1.2.3`, `{"workspace": true}` | +| `description` | str or `WorkspaceInheritance` object | no | A short description of the project. Can be a string or { workspace = true } to inherit from workspace
**Examples:** `A short description`, `{"workspace": true}` | +| `authors` | list of str or `WorkspaceInheritance` object | no | The authors of the project. Can be a list of strings or { workspace = true } to inherit from workspace
**Examples:** `["John Doe "]`, `{"workspace": true}` | +| `license` | str or `WorkspaceInheritance` object | no | The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier. Can be a string or { workspace = true } to inherit from workspace
**Examples:** `MIT`, `{"workspace": true}` | +| `license-file` | str or `WorkspaceInheritance` object | no | The path to the license file of the project. Can be a path or { workspace = true } to inherit from workspace
**Examples:** `LICENSE.md`, `{"workspace": true}` | +| `readme` | str or `WorkspaceInheritance` object | no | The path to the readme file of the project. Can be a path or { workspace = true } to inherit from workspace
**Examples:** `README.md`, `{"workspace": true}` | +| `homepage` | URL | no | The URL of the homepage of the project. Can be a URL or { workspace = true } to inherit from workspace
**Examples:** `https://pixi.sh`, `{"workspace": true}` | +| `repository` | URL | no | The URL of the repository of the project. Can be a URL or { workspace = true } to inherit from workspace
**Examples:** `https://github.com/prefix-dev/pixi`, `{"workspace": true}` | +| `documentation` | URL | no | The URL of the documentation of the project. Can be a URL or { workspace = true } to inherit from workspace
**Examples:** `https://pixi.sh/latest/`, `{"workspace": true}` | +| `build` | ForwardRef('Build', is_class=True) | yes | The build configuration of the package | +| `host-dependencies` | map of str to str or `InheritableMatchspecTable` object or map of str to str or `InheritableMatchspecTable` object | no | The host `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information.
**Examples:** `{"python": ">=3.8"}` | +| `build-dependencies` | map of str to str or `InheritableMatchspecTable` object or map of str to str or `InheritableMatchspecTable` object | no | The build `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information. | +| `run-dependencies` | map of str to str or `InheritableMatchspecTable` object or map of str to str or `InheritableMatchspecTable` object | no | The `conda` dependencies required at runtime. See https://pixi.sh/latest/build/dependency_types/ for more information. | +| `extra-dependencies` | map of str to map of str to str or `MatchspecTable` object or map of str to str or `MatchspecTable` object | no | Extra groups that can be requested through MatchSpec extras. Each group uses the same conda package specification syntax as run-dependencies.
**Examples:** `{"test": {"pytest": ">=8", "hypothesis": "*"}}` | +| `run-constraints` | map of str to str or `InheritableMatchspecTable` object or map of str to str or `InheritableMatchspecTable` object | no | The `conda` run-time version constraints. These constrain the versions of packages that may be installed in the run environment without explicitly requiring them. If the package is installed as a dependency of another package, it must satisfy these constraints. See https://pixi.sh/latest/build/dependency_types/ for more information. | +--8<-- [end:package] + +--8<-- [start:package_build] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `backend` | ForwardRef('BuildBackend', is_class=True) | yes | The build backend to instantiate | +| `channels` | URL | no | The `conda` channels that are used to fetch the build backend from | +| `flags` | list of str | no | Plain string flags recorded on built packages for v3 package variant selection
**Examples:** `["cuda", "blas_openblas"]` | +| `additional-dependencies` | map of str to str or `MatchspecTable` object | no | Additional dependencies to install alongside the build backend | +| `config` | map of str to Any | no | The configuration of the build backend | +| `target` | map of str to `BuildTarget` object | no | Target-specific build configuration for different platforms
**Examples:** `{"linux-64": {"config": {"key": "value"}}}` | +| `source` | `SourceLocation` object | no | The source from which to build the package
**Examples:** `{"path": "project"}`, `{"git": "https://github.com/user/repo.git", "rev": "bd62770509b8afd792e98d20f8b458e2a7f19ec2", "subdirectory": "subproject/src"}` | +| `build-string-prefix` | str | no | An optional prefix to prepend to the auto-generated build string | +| `build-number` | int | no | The build number to record in the produced package | +| `secrets` | list of str | no | Names of environment variables to expose as secrets to the build script. Values are read from the host environment at build time; only the names live in the manifest. Forwarded to rattler-build's `build.script.secrets`. | +--8<-- [end:package_build] + +--8<-- [start:package_build_backend] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `version` | str | no | The version of the package in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format | +| `build` | str | no | The build string of the package | +| `build-number` | str | no | The build number of the package, can be a spec like `>=1` or `<=10` or `1` | +| `file-name` | str | no | The file name of the package | +| `channel` | str | no | The channel the packages needs to be fetched from
**Examples:** `conda-forge`, `pytorch`, `https://prefix.dev/conda-forge` | +| `subdir` | str | no | The subdir of the package, also known as platform | +| `extras` | list of str | no | Optional extra dependencies to select for the package | +| `flags` | list of str | no | Plain string flags used to select package variants | +| `license` | str | no | The license of the package | +| `license-family` | str | no | The license family of the package | +| `when` | str or `WhenAll` object or `WhenAny` object or `WhenPackage` object | no | The condition under which this match spec applies. Use a package string, `{ all = [...] }`, `{ any = [...] }`, or `{ package = ..., version = ..., build = ... }`. | +| `track-features` | list of str | no | The track features of the package | +| `name` | str | no | The name of the build backend package | +| `channels` | URL | no | The `conda` channels that are used to fetch the build backend from | +| `additional-dependencies` | map of str to str or `MatchspecTable` object | no | Additional dependencies to install alongside the build backend | +| `workspace` | `True` | no | Inherit the backend version from `[workspace.dependencies]` using `name` as the lookup key. `version` is mutually exclusive with `workspace`. | +--8<-- [end:package_build_backend] + +--8<-- [start:package_build_source] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `path` | str | no | The path to the source | +| `git` | str | no | The git URL to the source repo | +| `rev` | str | no | A git SHA revision to use | +| `tag` | str | no | A git tag to use | +| `branch` | str | no | A git branch to use | +| `subdirectory` | str | no | A subdirectory to use in the repo | +--8<-- [end:package_build_source] + +--8<-- [start:s3_options] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `endpoint-url` | str | yes | The endpoint URL to use for the S3 client
**Examples:** `https://s3.eu-central-1.amazonaws.com` | +| `region` | str | yes | The region to use for the S3 client
**Examples:** `eu-central-1` | +| `force-path-style` | bool | yes | Whether to force path style for the S3 client | +--8<-- [end:s3_options] + +--8<-- [start:base_manifest] +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `workspace` | `Workspace` object | no | The workspace's metadata information | +| `project` | `Workspace` object | no | The project's metadata information | +| `package` | `Package` object | no | The package's metadata information | +| `dependencies` | map of str to str or `MatchspecTable` object | no | The `conda` dependencies, consisting of a package name and a requirement in [MatchSpec](https://github.com/conda/conda/blob/078e7ee79381060217e1ec7f9b0e9cf80ecc8f3f/conda/models/match_spec.py) format | +| `host-dependencies` | map of str to str or `MatchspecTable` object | no | The host `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information.
**Examples:** `{"python": ">=3.8"}` | +| `build-dependencies` | map of str to str or `MatchspecTable` object | no | The build `conda` dependencies, used in the build process. See https://pixi.sh/latest/build/dependency_types/ for more information. | +| `constraints` | map of str to str or `MatchspecTable` object | no | The `conda` version constraints. These constrain the versions of packages that may be installed without explicitly requiring them. If the package is installed as a dependency of another package, it must satisfy these constraints. | +| `exclude-newer` | map of str to str | no | Workspace-wide per-package `exclude-newer` overrides for conda packages | +| `pypi-dependencies` | map of str to str or `PyPIVersion` object or `PyPIGitBranchRequirement` object or `PyPIGitTagRequirement` object or `PyPIGitRevRequirement` object or `PyPIPathRequirement` object or `PyPIUrlRequirement` object | no | The PyPI dependencies | +| `pypi-exclude-newer` | map of str to str | no | Workspace-wide per-package `exclude-newer` overrides for PyPI packages | +| `dev` | map of str to `SourceSpecTable` object | no | Source packages whose dependencies should be installed without building the package itself. Useful for development environments. | +| `tasks` | map of str to `TaskInlineTable` object or list of `DependsOn` object or str | no | The tasks of the project | +| `system-requirements` | `SystemRequirements` object | no | The system requirements of the project | +| `environments` | map of str to `Environment` object or list of str | no | The environments of the project, defined as a full object or a list of feature names. | +| `feature` | map of str to `Feature` object | no | The features of the project | +| `activation` | `Activation` object | no | The scripts used on the activation of the project | +| `target` | map of str to `Target` object | no | The targets of the project
**Examples:** `{"linux": {"dependencies": {"python": "3.8"}}}` | +| `pypi-options` | `PyPIOptions` object | no | Options related to PyPI indexes, on the default feature | +--8<-- [end:base_manifest] + diff --git a/docs/reference/pixi_manifest.md b/docs/reference/pixi_manifest.md index aa8352ba5e..0d044dea62 100644 --- a/docs/reference/pixi_manifest.md +++ b/docs/reference/pixi_manifest.md @@ -31,6 +31,8 @@ The manifest can be found at the following locations. ## The `workspace` table +--8<-- "docs/reference/_schema_tables.txt:workspace" + The minimally required information in the `workspace` table is: ```toml @@ -527,6 +529,8 @@ shared-lib = { path = "packages/shared-lib" } ## The `tasks` table +--8<-- "docs/reference/_schema_tables.txt:tasks" + Tasks are a way to automate certain custom commands in your workspace. For example, a `lint` or `format` step. Tasks in a Pixi workspace are essentially cross-platform shell commands, with a unified syntax across platforms. @@ -558,6 +562,8 @@ You can modify this table using [`pixi task`](cli/pixi/task.md). ## The `system-requirements` table (deprecated) +--8<-- "docs/reference/_schema_tables.txt:system_requirements" + !!! warning "Deprecated" The `[system-requirements]` table (and its per-feature variant `[feature..system-requirements]`) is parsed for backwards compatibility but should not be used in new manifests. Declare the virtual packages directly on [`workspace.platforms`](#inline-table-entries-per-platform-virtual-packages) using inline-table entries. @@ -565,6 +571,8 @@ You can modify this table using [`pixi task`](cli/pixi/task.md). ## The `pypi-options` table +--8<-- "docs/reference/_schema_tables.txt:pypi_options" + The `pypi-options` table is used to define options that are specific to PyPI registries. It can appear in three scopes: @@ -781,6 +789,8 @@ skip-wheel-filename-check = true ``` ## The `dependencies` table(s) + +--8<-- "docs/reference/_schema_tables.txt:dependencies" ??? info "Details regarding the dependencies" For more detail regarding the dependency types, make sure to check the [Run, Host, Build](../build/dependency_types.md) dependency documentation. @@ -1087,6 +1097,8 @@ To help built these dependencies we activate the conda environment that includes This way when a source distribution depends on `gcc` for example, it's used from the conda environment instead of the system. ## The `activation` table +--8<-- "docs/reference/_schema_tables.txt:activation" + The activation table is used for specialized activation operations that need to be run when the environment is activated. As with other top level tables, `[activation]` belongs to the `default` feature. Therefore, every environment that doesn't set `no-default-feature = true` includes that activation script. @@ -1137,6 +1149,8 @@ ENV_VAR = "%OTHER_ENV_VAR%\\windows-value" ## The `target` table +--8<-- "docs/reference/_schema_tables.txt:target" + The target table is a table that allows for platform specific configuration. Allowing you to make different sets of tasks or dependencies per platform. @@ -1208,6 +1222,8 @@ This will create an environment called `test` that has `pytest` installed. ### The `feature` table +--8<-- "docs/reference/_schema_tables.txt:feature" + The `feature` table allows you to define the following fields per feature. - `dependencies`: Same as the [dependencies](#dependencies). @@ -1272,6 +1288,8 @@ platforms = ["linux-64-cuda", "osx-arm64"] ### The `environments` table +--8<-- "docs/reference/_schema_tables.txt:environments" + The `[environments]` table allows you to define environments that are created using the features defined in the `[feature]` tables. The environments table is defined using the following fields: @@ -1353,6 +1371,8 @@ More information can be found in the [Dev packages](../build/dev.md) documentati ## The `package` section +--8<-- "docs/reference/_schema_tables.txt:package" + !!! warning "Important note" `pixi-build` is a [preview feature](#preview-features), and will change until it is stabilized. Please keep that in mind when you use it for your workspaces. @@ -1413,6 +1433,8 @@ And to extend the basics, it can also contain the following fields: ### `build` table +--8<-- "docs/reference/_schema_tables.txt:package_build" + The build system specifies how the package can be built. The build system is a table that can contain the following fields: diff --git a/pixi.toml b/pixi.toml index 016d8c0eb3..bd60a769b1 100644 --- a/pixi.toml +++ b/pixi.toml @@ -352,6 +352,7 @@ python-fastjsonschema = ">=2.21.2,<3" pyyaml = ">=6.0.3,<7" [feature.schema.tasks] +generate-manifest-docs = { cmd = "python generate_manifest_docs.py", cwd = "schema", description = "Generate manifest reference docs from schema model" } generate-schema = { cmd = "python model.py", cwd = "schema", description = "Generate JSON schema from model" } test-schema = { cmd = "pytest -s", depends-on = "generate-schema", cwd = "schema", description = "Test the manifest JSON schema" } diff --git a/schema/generate_manifest_docs.py b/schema/generate_manifest_docs.py new file mode 100644 index 0000000000..ff1f95017b --- /dev/null +++ b/schema/generate_manifest_docs.py @@ -0,0 +1,222 @@ +"""Generate Markdown reference documentation for the ``pixi.toml`` manifest.""" + +from __future__ import annotations + +import json +import sys +from enum import Enum +from pathlib import Path +from typing import Any, Union, get_args, get_origin + +from pydantic import fields as pydantic_fields + +from model import ( + Activation, + BaseManifest, + Build, + BuildBackend, + ChannelInlineTable, + Environment, + Feature, + MatchspecTable, + Package, + PyPIOptions, + PyPIVersion, + PyPIGitBranchRequirement, + PyPIGitTagRequirement, + PyPIGitRevRequirement, + PyPIPathRequirement, + PyPIUrlRequirement, + S3Options, + SourceLocation, + SystemRequirements, + Target, + TaskInlineTable, + TaskArgs, + DependsOn, + Workspace, + WorkspacePlatform, + hyphenize, +) + +HERE = Path(__file__).parent +OUTPUT_PATH = HERE.parent / "docs" / "reference" / "_schema_tables.txt" + +AUTOGEN_HEADER = "" + +_FRIENDLY: dict[str, str] = { + "NonEmptyStr": "string", + "PositiveFloat": "number", + "AnyHttpUrl": "URL", + "AnyUrl": "URL", + "PathNoBackslash": "path", + "Md5Sum": "md5 string", + "Sha256Sum": "sha256 string", + "ExcludeNewer": "timestamp or duration", + "ChannelName": "string or URL", + "CondaPackageName": "string", + "PyPIPackageName": "string", + "EnvironmentName": "string", + "FeatureName": "string", + "SolveGroupName": "string", + "TargetName": "string", + "TaskName": "string", + "TaskArgName": "string", + "ExtraName": "string", + "FlagName": "string", + "PlatformName": "string", + "Glob": "glob pattern", + "UnsignedInt": "non-negative integer", + "GitUrl": "git URL", +} + + +def friendly_type(annotation: Any) -> str: + """Return a human-readable type string for a field annotation.""" + if annotation is None: + return "any" + + for key, name in _FRIENDLY.items(): + if key in str(annotation): + return name + + if annotation is type(None): + return "null" + + origin = get_origin(annotation) + + if isinstance(annotation, type) and issubclass(annotation, Enum): + return " \\| ".join(f"`{e.value}`" for e in annotation) + + try: + from typing import Literal + + if origin is Literal: + return " \\| ".join(f"`{a}`" for a in get_args(annotation)) + except ImportError: + pass + + if origin is Union: + args = [a for a in get_args(annotation) if a is not type(None)] + if len(args) == 1: + return friendly_type(args[0]) + return " or ".join(friendly_type(a) for a in args) + + if origin is list: + args = get_args(annotation) + if args: + return f"list of {friendly_type(args[0])}" + return "list" + + if origin is dict: + args = get_args(annotation) + if len(args) == 2: + return f"map of {friendly_type(args[0])} to {friendly_type(args[1])}" + return "map" + + if isinstance(annotation, type): + if hasattr(annotation, "model_fields"): + return f"`{annotation.__name__}` object" + return annotation.__name__ + + if hasattr(annotation, "__metadata__"): + inner = get_args(annotation) + if inner: + return friendly_type(inner[0]) + + return str(annotation) + + +def is_required(field_info: pydantic_fields.FieldInfo) -> bool: + if field_info.default is not pydantic_fields.PydanticUndefined: + return False + if field_info.default_factory is not None: + return False + return True + + +def model_to_table(model_class: Any, skip: set[str] | None = None) -> str: + """Generate a Markdown table documenting all fields of a Pydantic model.""" + skip = skip or set() + lines = [ + "| Field | Type | Required | Description |", + "|-------|------|----------|-------------|", + ] + + for name, info in model_class.model_fields.items(): + if name in skip: + continue + display = info.alias or hyphenize(name) + ftype = friendly_type(info.annotation) + req = "yes" if is_required(info) else "no" + desc = (info.description or "").replace("\n", " ").strip() + + examples = getattr(info, "examples", None) + if examples: + ex_strs = [] + for ex in examples: + if isinstance(ex, (dict, list, bool)): + ex_strs.append(f"`{json.dumps(ex)}`") + else: + ex_strs.append(f"`{ex}`") + if ex_strs: + desc += f"
**Examples:** {', '.join(ex_strs)}" + + lines.append(f"| `{display}` | {ftype} | {req} | {desc} |") + + return "\n".join(lines) + + +def section(snippet_name: str, model_class: Any, skip: set[str] | None = None) -> str: + """Generate a snippet with a field table.""" + parts = [f"--8<-- [start:{snippet_name}]"] + parts.append(model_to_table(model_class, skip=skip)) + parts.append(f"--8<-- [end:{snippet_name}]\n") + return "\n".join(parts) + + +def generate() -> str: + """Generate the complete manifest reference snippets.""" + out: list[str] = [AUTOGEN_HEADER, ""] + + out.append(section("workspace", Workspace, skip={"target"})) + out.append(section("workspace_platforms", WorkspacePlatform)) + out.append(section("channel", ChannelInlineTable)) + out.append(section("dependencies", MatchspecTable)) + + for label, cls in [ + ("pypi_version", PyPIVersion), + ("pypi_path", PyPIPathRequirement), + ("pypi_url", PyPIUrlRequirement), + ("pypi_git_branch", PyPIGitBranchRequirement), + ("pypi_git_tag", PyPIGitTagRequirement), + ("pypi_git_rev", PyPIGitRevRequirement), + ]: + out.append(section(label, cls)) + + out.append(section("tasks", TaskInlineTable)) + out.append(section("task_args", TaskArgs)) + out.append(section("task_depends_on", DependsOn)) + + out.append(section("system_requirements", SystemRequirements)) + out.append(section("feature", Feature)) + out.append(section("environments", Environment)) + out.append(section("activation", Activation)) + out.append(section("target", Target)) + out.append(section("pypi_options", PyPIOptions)) + out.append(section("package", Package)) + out.append(section("package_build", Build)) + out.append(section("package_build_backend", BuildBackend)) + out.append(section("package_build_source", SourceLocation)) + out.append(section("s3_options", S3Options)) + out.append(section("base_manifest", BaseManifest, skip={"tool"})) + + return "\n".join(out) + "\n" + + +if __name__ == "__main__": + content = generate() + OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + OUTPUT_PATH.write_text(content, encoding="utf-8", newline="\n") + kb = round(len(content) / 1024, 2) + print(f"... wrote {kb}kb to {OUTPUT_PATH}", file=sys.stderr) diff --git a/schema/model.py b/schema/model.py index 50a0508de6..6d5821fa6d 100644 --- a/schema/model.py +++ b/schema/model.py @@ -272,19 +272,24 @@ class Workspace(StrictBaseModel): """The project's metadata information.""" name: NonEmptyStr | None = Field( - None, description="The name of the project; we advise use of the name of the repository" + None, + description="The name of the project; we advise use of the name of the repository", + examples=["my-project"], ) version: NonEmptyStr | None = Field( None, description="The version of the project; we advise use of [SemVer](https://semver.org)", examples=["1.2.3"], ) - description: NonEmptyStr | None = Field(None, description="A short description of the project") + description: NonEmptyStr | None = Field( + None, description="A short description of the project", examples=["A simple project"] + ) authors: list[NonEmptyStr] | None = Field( None, description="The authors of the project", examples=["John Doe "] ) channels: list[Channel] = Field( description="The `conda` channels that can be used in the project. Unless overridden by `priority`, the first channel listed will be preferred.", + examples=[["conda-forge", "pytorch"]], ) channel_priority: ChannelPriority | None = Field( None, @@ -320,23 +325,31 @@ class Workspace(StrictBaseModel): platforms: list[Platform | PlatformName | WorkspacePlatform] | None = Field( None, description="The platforms that the project supports. Each entry is either a conda subdir, the name of a workspace platform defined elsewhere, or an inline table describing a workspace platform (optional `name`, optional `platform`, plus virtual-package shortcut keys such as `cuda`, `archspec`, `glibc`, `linux`, `macos`/`osx`, `windows`).", + examples=[["linux-64", "osx-arm64", "win-64"]], ) license: NonEmptyStr | None = Field( None, description="The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier.", + examples=["MIT"], ) license_file: PathNoBackslash | None = Field( - None, description="The path to the license file of the project" + None, description="The path to the license file of the project", examples=["LICENSE.md"] ) readme: PathNoBackslash | None = Field( - None, description="The path to the readme file of the project" + None, description="The path to the readme file of the project", examples=["README.md"] + ) + homepage: AnyHttpUrl | None = Field( + None, description="The URL of the homepage of the project", examples=["https://pixi.sh"] ) - homepage: AnyHttpUrl | None = Field(None, description="The URL of the homepage of the project") repository: AnyHttpUrl | None = Field( - None, description="The URL of the repository of the project" + None, + description="The URL of the repository of the project", + examples=["https://github.com/prefix-dev/pixi"], ) documentation: AnyHttpUrl | None = Field( - None, description="The URL of the documentation of the project" + None, + description="The URL of the documentation of the project", + examples=["https://pixi.sh/latest/"], ) conda_pypi_map: CondaPypiMap | None = Field( None, @@ -981,7 +994,7 @@ class PyPIOptions(StrictBaseModel): find_links: list[FindLinksPath | FindLinksURL] | None = Field( None, description="Paths to directory containing", - examples=[["https://pypi.org/simple"]], + examples=[[{"path": "./links"}, {"url": "https://example.com/links"}]], ) no_build_isolation: bool | list[PyPIPackageName] | None = Field( None, @@ -1051,6 +1064,7 @@ class Package(StrictBaseModel): description: NonEmptyStr | WorkspaceInheritance | None = Field( None, description="A short description of the project. Can be a string or { workspace = true } to inherit from workspace", + examples=["A short description", {"workspace": True}], ) authors: list[NonEmptyStr] | WorkspaceInheritance | None = Field( None, @@ -1060,26 +1074,32 @@ class Package(StrictBaseModel): license: NonEmptyStr | WorkspaceInheritance | None = Field( None, description="The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier. Can be a string or { workspace = true } to inherit from workspace", + examples=["MIT", {"workspace": True}], ) license_file: PathNoBackslash | WorkspaceInheritance | None = Field( None, description="The path to the license file of the project. Can be a path or { workspace = true } to inherit from workspace", + examples=["LICENSE.md", {"workspace": True}], ) readme: PathNoBackslash | WorkspaceInheritance | None = Field( None, description="The path to the readme file of the project. Can be a path or { workspace = true } to inherit from workspace", + examples=["README.md", {"workspace": True}], ) homepage: AnyHttpUrl | WorkspaceInheritance | None = Field( None, description="The URL of the homepage of the project. Can be a URL or { workspace = true } to inherit from workspace", + examples=["https://pixi.sh", {"workspace": True}], ) repository: AnyHttpUrl | WorkspaceInheritance | None = Field( None, description="The URL of the repository of the project. Can be a URL or { workspace = true } to inherit from workspace", + examples=["https://github.com/prefix-dev/pixi", {"workspace": True}], ) documentation: AnyHttpUrl | WorkspaceInheritance | None = Field( None, description="The URL of the documentation of the project. Can be a URL or { workspace = true } to inherit from workspace", + examples=["https://pixi.sh/latest/", {"workspace": True}], ) build: Build = Field(..., description="The build configuration of the package") diff --git a/schema/pyproject/partial-pixi.json b/schema/pyproject/partial-pixi.json index b844e5bc5e..07ce90ad92 100644 --- a/schema/pyproject/partial-pixi.json +++ b/schema/pyproject/partial-pixi.json @@ -1553,6 +1553,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "A short description", + { + "workspace": true + } ] }, "documentation": { @@ -1567,6 +1573,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh/latest/", + { + "workspace": true + } ] }, "extra-dependencies": { @@ -1630,6 +1642,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh", + { + "workspace": true + } ] }, "host-dependencies": { @@ -1684,6 +1702,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "MIT", + { + "workspace": true + } ] }, "license-file": { @@ -1697,6 +1721,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "LICENSE.md", + { + "workspace": true + } ] }, "name": { @@ -1723,6 +1753,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "README.md", + { + "workspace": true + } ] }, "repository": { @@ -1737,6 +1773,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://github.com/prefix-dev/pixi", + { + "workspace": true + } ] }, "run-constraints": { @@ -2036,7 +2078,12 @@ }, "examples": [ [ - "https://pypi.org/simple" + { + "path": "./links" + }, + { + "url": "https://example.com/links" + } ] ] }, @@ -3112,7 +3159,13 @@ "$ref": "#/$defs/ChannelInlineTable" } ] - } + }, + "examples": [ + [ + "conda-forge", + "pytorch" + ] + ] }, "conda-pypi-map": { "title": "Conda-Pypi-Map", @@ -3179,14 +3232,20 @@ "title": "Description", "description": "A short description of the project", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "A simple project" + ] }, "documentation": { "title": "Documentation", "description": "The URL of the documentation of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh/latest/" + ] }, "exclude-newer": { "title": "Exclude-Newer", @@ -3211,25 +3270,37 @@ "description": "The URL of the homepage of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh" + ] }, "license": { "title": "License", "description": "The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier.", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "MIT" + ] }, "license-file": { "title": "License-File", "description": "The path to the license file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "LICENSE.md" + ] }, "name": { "title": "Name", "description": "The name of the project; we advise use of the name of the repository", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "my-project" + ] }, "platforms": { "title": "Platforms", @@ -3249,7 +3320,14 @@ "$ref": "#/$defs/WorkspacePlatform" } ] - } + }, + "examples": [ + [ + "linux-64", + "osx-arm64", + "win-64" + ] + ] }, "preview": { "title": "Preview", @@ -3283,14 +3361,20 @@ "title": "Readme", "description": "The path to the readme file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "README.md" + ] }, "repository": { "title": "Repository", "description": "The URL of the repository of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://github.com/prefix-dev/pixi" + ] }, "requires-pixi": { "title": "Requires-Pixi", diff --git a/schema/pyproject/schema.json b/schema/pyproject/schema.json index f6e6ec30d5..3b978b1b50 100644 --- a/schema/pyproject/schema.json +++ b/schema/pyproject/schema.json @@ -1296,6 +1296,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "A short description", + { + "workspace": true + } ] }, "documentation": { @@ -1310,6 +1316,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh/latest/", + { + "workspace": true + } ] }, "extra-dependencies": { @@ -1373,6 +1385,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh", + { + "workspace": true + } ] }, "host-dependencies": { @@ -1427,6 +1445,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "MIT", + { + "workspace": true + } ] }, "license-file": { @@ -1440,6 +1464,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "LICENSE.md", + { + "workspace": true + } ] }, "name": { @@ -1466,6 +1496,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "README.md", + { + "workspace": true + } ] }, "repository": { @@ -1480,6 +1516,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://github.com/prefix-dev/pixi", + { + "workspace": true + } ] }, "run-constraints": { @@ -1779,7 +1821,12 @@ }, "examples": [ [ - "https://pypi.org/simple" + { + "path": "./links" + }, + { + "url": "https://example.com/links" + } ] ] }, @@ -3150,7 +3197,13 @@ "$ref": "#/$defs/ChannelInlineTable" } ] - } + }, + "examples": [ + [ + "conda-forge", + "pytorch" + ] + ] }, "conda-pypi-map": { "title": "Conda-Pypi-Map", @@ -3217,14 +3270,20 @@ "title": "Description", "description": "A short description of the project", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "A simple project" + ] }, "documentation": { "title": "Documentation", "description": "The URL of the documentation of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh/latest/" + ] }, "exclude-newer": { "title": "Exclude-Newer", @@ -3249,25 +3308,37 @@ "description": "The URL of the homepage of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh" + ] }, "license": { "title": "License", "description": "The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier.", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "MIT" + ] }, "license-file": { "title": "License-File", "description": "The path to the license file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "LICENSE.md" + ] }, "name": { "title": "Name", "description": "The name of the project; we advise use of the name of the repository", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "my-project" + ] }, "platforms": { "title": "Platforms", @@ -3287,7 +3358,14 @@ "$ref": "#/$defs/WorkspacePlatform" } ] - } + }, + "examples": [ + [ + "linux-64", + "osx-arm64", + "win-64" + ] + ] }, "preview": { "title": "Preview", @@ -3321,14 +3399,20 @@ "title": "Readme", "description": "The path to the readme file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "README.md" + ] }, "repository": { "title": "Repository", "description": "The URL of the repository of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://github.com/prefix-dev/pixi" + ] }, "requires-pixi": { "title": "Requires-Pixi", diff --git a/schema/schema.json b/schema/schema.json index f16ad7474d..99fb611620 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1577,6 +1577,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "A short description", + { + "workspace": true + } ] }, "documentation": { @@ -1591,6 +1597,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh/latest/", + { + "workspace": true + } ] }, "extra-dependencies": { @@ -1654,6 +1666,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://pixi.sh", + { + "workspace": true + } ] }, "host-dependencies": { @@ -1708,6 +1726,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "MIT", + { + "workspace": true + } ] }, "license-file": { @@ -1721,6 +1745,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "LICENSE.md", + { + "workspace": true + } ] }, "name": { @@ -1747,6 +1777,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "README.md", + { + "workspace": true + } ] }, "repository": { @@ -1761,6 +1797,12 @@ { "$ref": "#/$defs/WorkspaceInheritance" } + ], + "examples": [ + "https://github.com/prefix-dev/pixi", + { + "workspace": true + } ] }, "run-constraints": { @@ -2060,7 +2102,12 @@ }, "examples": [ [ - "https://pypi.org/simple" + { + "path": "./links" + }, + { + "url": "https://example.com/links" + } ] ] }, @@ -3136,7 +3183,13 @@ "$ref": "#/$defs/ChannelInlineTable" } ] - } + }, + "examples": [ + [ + "conda-forge", + "pytorch" + ] + ] }, "conda-pypi-map": { "title": "Conda-Pypi-Map", @@ -3203,14 +3256,20 @@ "title": "Description", "description": "A short description of the project", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "A simple project" + ] }, "documentation": { "title": "Documentation", "description": "The URL of the documentation of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh/latest/" + ] }, "exclude-newer": { "title": "Exclude-Newer", @@ -3235,25 +3294,37 @@ "description": "The URL of the homepage of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://pixi.sh" + ] }, "license": { "title": "License", "description": "The license of the project; we advise using an [SPDX](https://spdx.org/licenses/) identifier.", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "MIT" + ] }, "license-file": { "title": "License-File", "description": "The path to the license file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "LICENSE.md" + ] }, "name": { "title": "Name", "description": "The name of the project; we advise use of the name of the repository", "type": "string", - "minLength": 1 + "minLength": 1, + "examples": [ + "my-project" + ] }, "platforms": { "title": "Platforms", @@ -3273,7 +3344,14 @@ "$ref": "#/$defs/WorkspacePlatform" } ] - } + }, + "examples": [ + [ + "linux-64", + "osx-arm64", + "win-64" + ] + ] }, "preview": { "title": "Preview", @@ -3307,14 +3385,20 @@ "title": "Readme", "description": "The path to the readme file of the project", "type": "string", - "pattern": "^[^\\\\]+$" + "pattern": "^[^\\\\]+$", + "examples": [ + "README.md" + ] }, "repository": { "title": "Repository", "description": "The URL of the repository of the project", "type": "string", "format": "uri", - "minLength": 1 + "minLength": 1, + "examples": [ + "https://github.com/prefix-dev/pixi" + ] }, "requires-pixi": { "title": "Requires-Pixi",