Skip to content

Commit

Permalink
docs: add mention of store plugin (#146)
Browse files Browse the repository at this point in the history
* docs: add mention of store plugin

Signed-off-by: Henry Schreiner <[email protected]>

* Apply suggestions from code review

Co-authored-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: Anderson Bravalheri <[email protected]>
  • Loading branch information
henryiii and abravalheri authored Jan 27, 2024
1 parent 999ffb1 commit 3adaeec
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ extending the validation with your own plugins_.
If you consider contributing to this project, have a look on our
`contribution guides`_.

Plugins
=======

The `validate-pyproject-schema-store`_ plugin has a vendored copy of
pyproject.toml related `SchemaStore`_ entries. You can even install this using
the ``[store]`` extra:

$ pipx install 'validate-pyproject[all,store]'

Some of the tools in SchemaStore also have integrated validate-pyproject
plugins, like ``cibuildwheel`` and ``scikit-build-core``. However, unless you
want to pin an exact version of those tools, the SchemaStore copy is lighter
weight than installing the entire package.

If you want to write a custom plugin for your tool, please consider also contributing a copy to SchemaStore.

pre-commit
==========

Expand All @@ -146,9 +162,11 @@ pre-commit
---
repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: main
rev: <insert current version here>
hooks:
- id: validate-pyproject
# Optional extra validations from SchemaStore:
additional_dependencies: ["validate-pyproject-schema-store[all]"]
By default, this ``pre-commit`` hook will only validate the ``pyproject.toml``
file at the root of the project repository.
Expand All @@ -158,6 +176,8 @@ the ``files`` parameter.
You can also use ``pre-commit autoupdate`` to update to the latest stable
version of ``validate-pyproject`` (recommended).

You can also use `validate-pyproject-schema-store`_ as a pre-commit hook, which
allows pre-commit to pin and update that instead of ``validate-pyproject`` itself.

Note
====
Expand Down Expand Up @@ -188,3 +208,5 @@ For details and usage information on PyScaffold see https://pyscaffold.org/.
.. _pre-compiled way: https://validate-pyproject.readthedocs.io/en/latest/embedding.html
.. _plugins: https://validate-pyproject.readthedocs.io/en/latest/dev-guide.html
.. _virtual environment: https://realpython.com/python-virtual-environments-a-primer/
.. _validate-pyproject-schema-store: https://github.com/henryiii/validate-pyproject-schema-store
.. _SchemaStore: https://www.schemastore.org
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ platforms = any
# https://pypi.org/classifiers/
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Operating System :: OS Independent
Programming Language :: Python
Topic :: Software Development :: Quality Assurance
Typing :: Typed


[options]
Expand Down Expand Up @@ -66,6 +70,9 @@ all =
packaging>=20.4
trove-classifiers>=2021.10.20

store =
validate-pyproject-schema-store

# Add here test requirements (semicolon/line-separated)
testing =
setuptools
Expand Down

0 comments on commit 3adaeec

Please sign in to comment.