-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pypi to step decorators docs. (#119)
* Added pypi to step decorators docs. Updated conda-vs-pypi to include information about wheel requirements for pypi packages. * Update conda-vs-pypi.md * Update README.md --------- Co-authored-by: Savin <[email protected]>
- Loading branch information
1 parent
d302585
commit a9f2341
Showing
4 changed files
with
133 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d1023227", | ||
"metadata": {}, | ||
"source": [ | ||
"# @pypi\n", | ||
"\n", | ||
"The `@pypi` decorator specifies what packages should be made available for a step.\n", | ||
"\n", | ||
"The packages are installed from [PyPI repositories](https://pypi.org/). Packages must be a wheel. For more information, see [Managing External Libraries](/scaling/dependencies)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "8d5bb116", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2024-01-19T07:19:59.070862Z", | ||
"iopub.status.busy": "2024-01-19T07:19:59.070787Z", | ||
"iopub.status.idle": "2024-01-19T07:19:59.348157Z", | ||
"shell.execute_reply": "2024-01-19T07:19:59.347872Z" | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"#meta:tag=hide\n", | ||
"from functools import partial\n", | ||
"from nbdoc.showdoc import ShowDoc\n", | ||
"ShowDoc = partial(ShowDoc, module_nm='metaflow')\n", | ||
"\n", | ||
"from metaflow import pypi" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "29af6ee3", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2024-01-19T07:19:59.350675Z", | ||
"iopub.status.busy": "2024-01-19T07:19:59.350507Z", | ||
"iopub.status.idle": "2024-01-19T07:19:59.358078Z", | ||
"shell.execute_reply": "2024-01-19T07:19:59.357812Z" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<HTMLRemove>\n", | ||
"<h3> <code>decorator</code> <span style=\"color:Brown\">@pypi</span> <em>(...)</em><a href=\"https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/pypi/pypi_decorator.py#L5\" style=\"float:right\">[source]</a></h3><strong>metaflow</strong><p><blockquote>Specifies the PyPI packages for the step.<br><br>Information in this decorator will augment any<br>attributes set in the `@pyi_base` flow-level decorator. Hence,<br>you can use `@pypi_base` to set packages required by all<br>steps and use `@pypi` to specify step-specific overrides.<br><br>Parameters<br>----------<br>packages : Dict[str, str], default: {}<br> Packages to use for this step. The key is the name of the package<br> and the value is the version to use.<br>python : str, optional, default: None<br> Version of Python to use, e.g. '3.7.4'. A default value of None implies<br> that the version used will correspond to the version of the Python interpreter used to start the run.</blockquote></p>\n", | ||
"</HTMLRemove>\n", | ||
"<DocSection type=\"decorator\" name=\"pypi\" module=\"metaflow\" show_import=\"True\" heading_level=\"3\" link=\"https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/pypi/pypi_decorator.py#L5\">\n", | ||
"<SigArgSection>\n", | ||
"<SigArg name=\"...\" />\n", | ||
"</SigArgSection>\n", | ||
"<Description summary=\"Specifies the PyPI packages for the step.\" extended_summary=\"Information in this decorator will augment any\\nattributes set in the `@pyi_base` flow-level decorator. Hence,\\nyou can use `@pypi_base` to set packages required by all\\nsteps and use `@pypi` to specify step-specific overrides.\" />\n", | ||
"<ParamSection name=\"Parameters\">\n", | ||
"\t<Parameter name=\"packages\" type=\"Dict[str, str], default: {}\" desc=\"Packages to use for this step. The key is the name of the package\\nand the value is the version to use.\" />\n", | ||
"\t<Parameter name=\"python\" type=\"str, optional, default: None\" desc=\"Version of Python to use, e.g. '3.7.4'. A default value of None implies\\nthat the version used will correspond to the version of the Python interpreter used to start the run.\" />\n", | ||
"</ParamSection>\n", | ||
"</DocSection>" | ||
], | ||
"text/plain": [ | ||
"<nbdoc.showdoc.ShowDoc at 0x118eaf820>" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"ShowDoc(pypi, skip_sections='Attributes', show_import=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0a84d95f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# @pypi | ||
|
||
The `@pypi` decorator specifies what packages should be made available for a step. | ||
|
||
The packages are installed from [PyPI repositories](https://pypi.org/). Packages must be a wheel. For more information, see [Managing External Libraries](/scaling/dependencies). | ||
|
||
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! Instead, edit the notebook w/the location & name as this file. --> | ||
|
||
|
||
<DocSection type="decorator" name="pypi" module="metaflow" show_import="True" heading_level="3" link="https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/pypi/pypi_decorator.py#L5"> | ||
<SigArgSection> | ||
<SigArg name="..." /> | ||
</SigArgSection> | ||
<Description summary="Specifies the PyPI packages for the step." extended_summary="Information in this decorator will augment any\nattributes set in the `@pyi_base` flow-level decorator. Hence,\nyou can use `@pypi_base` to set packages required by all\nsteps and use `@pypi` to specify step-specific overrides." /> | ||
<ParamSection name="Parameters"> | ||
<Parameter name="packages" type="Dict[str, str], default: {}" desc="Packages to use for this step. The key is the name of the package\nand the value is the version to use." /> | ||
<Parameter name="python" type="str, optional, default: None" desc="Version of Python to use, e.g. '3.7.4'. A default value of None implies\nthat the version used will correspond to the version of the Python interpreter used to start the run." /> | ||
</ParamSection> | ||
</DocSection> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters