-
Notifications
You must be signed in to change notification settings - Fork 13
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: naming conventions in README #101
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -56,8 +56,8 @@ files: | |||||
all: # used as the prefix for the generated dependency file names for conda or requirements files (has no effect on pyproject.toml files) | ||||||
output: [conda, requirements] # which dependency file types to generate. required, can be "conda", "requirements", "pyproject", "none" or a list of non-"none" values | ||||||
conda_dir: conda/environments # where to put conda environment.yaml files. optional, defaults to "conda/environments" | ||||||
requirements_dir: python/cudf # where to put requirements.txt files. optional, but recommended. defaults to "python" | ||||||
pyproject_dir: python/cudf # where to put pyproject.toml files. optional, but recommended. defaults to "python" | ||||||
requirements_dir: python/cudf # where to put requirements.txt files. optional, but recommended. Used for devcontainers. defaults to "python" | ||||||
pyproject_dir: python/cudf # where to put pyproject.toml files. optional, but recommended. Used for wheel builds. defaults to "python" | ||||||
matrix: # (optional) contains an arbitrary set of key/value pairs to determine which dependency files that should be generated. These values are included in the output filename. | ||||||
cuda: ["11.5", "11.6"] # which CUDA version variant files to generate. | ||||||
arch: [x86_64] # which architecture version variant files to generate. This value should be the result of running the `arch` command on a given machine. | ||||||
|
@@ -99,6 +99,8 @@ files: | |||||
|
||||||
When `output: none` is used, the `conda_dir`, `requirements_dir` and `matrix` keys can be omitted. The use case for `output: none` is described in the [_Additional CLI Notes_](#additional-cli-notes) section below. | ||||||
|
||||||
If more than one `files` key specifies the same output and *_dir, their contents are merged. This is how different sections are written to a given output file. | ||||||
|
||||||
#### `extras` | ||||||
|
||||||
A given file may include an `extras` entry that may be used to provide inputs specific to a particular file type | ||||||
|
@@ -109,17 +111,15 @@ Here is an example: | |||||
files: | ||||||
build: | ||||||
output: pyproject | ||||||
includes: # a list of keys from the `dependencies` section which should be included in the generated files | ||||||
- build | ||||||
extras: | ||||||
table: table_name | ||||||
key: key_name | ||||||
``` | ||||||
|
||||||
Currently the supported extras by file type are: | ||||||
- pyproject.toml | ||||||
- table: The table in pyproject.toml where the dependencies should be written. Acceptable values are "build-system", "project", and "project.optional-dependencies". | ||||||
- key: The key corresponding to the dependency list in `table`. This may only be provided for the "project.optional-dependencies" table since the key name is fixed for "build-system" ("requires") and "project" ("dependencies"). Note that this implicitly prohibits including optional dependencies via an inline table under the "project" table. | ||||||
- table: The table in pyproject.toml where the dependencies should be written. Acceptable values are "build-system", "project", "project.optional-dependencies", and "tool.rapids-build-backend" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically |
||||||
- key: The key corresponding to the dependency list in `table`. This may only be provided for the "project.optional-dependencies" or "tool.rapids-build-backend" table since the key name is fixed for "build-system" ("requires") and "project" ("dependencies"). Note that this implicitly prohibits including optional dependencies via an inline table under the "project" table. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's more accurate to say that |
||||||
|
||||||
### `channels` Key | ||||||
|
||||||
|
@@ -223,6 +223,40 @@ dependencies: | |||||
- pytest | ||||||
``` | ||||||
|
||||||
## Naming conventions | ||||||
|
||||||
With non-trivial collections of files and dependencies, names can look very related and become hard to distinguish. Some general guidelines that will help keep things more understandable: | ||||||
|
||||||
### Patterns for [RAPIDS build backend](https://github.com/rapidsai/rapids-build-backend) | ||||||
|
||||||
RBB builds generally include at least two sections: | ||||||
|
||||||
``` | ||||||
files: | ||||||
# This dependency brings in RBB | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
py_build_<something>: | ||||||
output: pyproject | ||||||
extras: | ||||||
table: build-system # This is the thing to match with the py_build_* name | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I didn't understand the language in this comment and the one below that "this is the thing to match". Could you rephrase that, or consider dropping these inline comments? The comments above the sections already pretty clearly describe the purpose. |
||||||
includes: | ||||||
- <rapids_build_skbuild> | ||||||
# This dependency expresses the build-time dependencies for your recipe (what might otherwise go in [build-system] when not using RBB) | ||||||
py_rapids_build_<something>: | ||||||
output: pyproject | ||||||
extras: | ||||||
table: tool.rapids-build-backend # This is the thing to match with the py_rapids_build_* name | ||||||
key: requires | ||||||
includes: | ||||||
- <normal_project_build_time_deps> | ||||||
``` | ||||||
|
||||||
### Patterns for dependencies | ||||||
|
||||||
To help distinguish dependency specifications from file specifications, it is recommended to prefix dependency entries | ||||||
with `dep_<type>_<name>`, where type is one of `build`, `run`, or `test`. This is functionally superfluous, as the `extras.table` | ||||||
value will ultimately determine where the dependency entries will go, but following the convention will make your dependencies.yaml | ||||||
file easier to follow. | ||||||
|
||||||
Comment on lines
+226
to
+259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good to me. I'll let @vyasr, @jameslamb, and @bdice verify. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I've seen a I'd probably just remove that, in favor of gently recommending grouping dependency entries with related purposes using similar prefixes, like It's also not always the case that a dependency entry is only reserved for one of My perspective... the most important thing being documented in this paragraph is not the typical patterns for the names...it's the fact that the names are not functionally meaningful (e.g. you could add |
||||||
## How Dependency Lists Are Merged | ||||||
|
||||||
The information from the top-level `files` and `dependencies` keys are used to determine which dependencies should be included in the final output of the generated dependency files. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was meant to be read as a literal wildcard. If so, it should be inline code-formatted so another one showing up later in the line doesn't accidentally change this to italics.