-
Notifications
You must be signed in to change notification settings - Fork 58
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
Change to tab layout for pyproject.toml vs setup.cfg #1155
Merged
zacharyburnett
merged 2 commits into
asdf-format:master
from
WilliamJamieson:docs/pyproject
Jun 20, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -881,17 +881,19 @@ containing your schema files to the pytest section of your project's build confi | |
(``pyproject.toml`` or ``setup.cfg``). If you do not already have such a file, creating | ||
one with the following should be sufficient: | ||
|
||
.. code:: toml | ||
.. tab:: pyproject.toml | ||
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. |
||
|
||
# pyproject.toml | ||
[tool.pytest.ini_options] | ||
asdf_schema_root = 'path/to/schemas another/path/to/schemas' | ||
.. code-block:: toml | ||
|
||
.. code:: ini | ||
[tool.pytest.ini_options] | ||
asdf_schema_root = 'path/to/schemas another/path/to/schemas' | ||
|
||
# setup.cfg | ||
[tool:pytest] | ||
asdf_schema_root = path/to/schemas another/path/to/schemas | ||
.. tab:: setup.cfg | ||
|
||
.. code-block:: ini | ||
|
||
[tool:pytest] | ||
asdf_schema_root = path/to/schemas another/path/to/schemas | ||
|
||
The schema directory paths should be paths that are relative to the top of the | ||
package directory **when it is installed**. If this is different from the path | ||
|
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 |
---|---|---|
|
@@ -193,17 +193,19 @@ instance: | |
Then in ``pyproject.toml``, define an ``[project.entry-points]`` section (or ``[options.entry_points]`` in ``setup.cfg``) | ||
that identifies the method as an ``asdf.resource_mappings`` entry point: | ||
|
||
.. code-block:: toml | ||
.. tab:: pyproject.toml | ||
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. |
||
|
||
# pyproject.toml | ||
[project.entry-points] | ||
'asdf.resource_mappings' = { asdf_foo_schemas = 'asdf_foo_schemas.integration:get_resource_mappings' } | ||
.. code-block:: toml | ||
|
||
.. code-block:: ini | ||
[project.entry-points] | ||
'asdf.resource_mappings' = { asdf_foo_schemas = 'asdf_foo_schemas.integration:get_resource_mappings' } | ||
|
||
# setup.cfg | ||
[options.package_data] | ||
* = *.yaml | ||
.. tab:: setup.cfg | ||
|
||
.. code-block:: ini | ||
|
||
[options.package_data] | ||
* = *.yaml | ||
|
||
After installing the package, it should be possible to load one of our schemas | ||
in a new session without any additional setup: | ||
|
@@ -221,17 +223,19 @@ YAML files. There are multiple ways to accomplish this, but one easy option | |
is to add a ``[tool.setuptools.package-data]`` section to ``pyproject.toml`` (or ``[options.package_data]`` in | ||
``setup.cfg``) requesting that all files with a ``.yaml`` extension be installed: | ||
|
||
.. code-block:: toml | ||
.. tab:: pyproject.toml | ||
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. |
||
|
||
.. code-block:: toml | ||
|
||
[tool.setuptools.package-data] | ||
'*' = ['*.yaml'] | ||
|
||
# pyproject.toml | ||
[tool.setuptools.package-data] | ||
'*' = ['*.yaml'] | ||
.. tab:: setup.cfg | ||
|
||
.. code-block:: ini | ||
.. code-block:: ini | ||
|
||
# setup.cfg | ||
[options.package_data] | ||
* = *.yaml | ||
[options.package_data] | ||
* = *.yaml | ||
|
||
Entry point performance considerations | ||
-------------------------------------- | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
https://asdf--1155.org.readthedocs.build/en/1155/asdf/extending/extensions.html#installing-extensions-via-entry-points