Skip to content

Commit

Permalink
Use sphinx rules instead of URL references
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Oct 25, 2021
1 parent 59e3a24 commit 033c5a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@
"issue": (f"{repository}/issues/%s", "issue #%s"),
"pr": (f"{repository}/pull/%s", "PR #%s"),
"discussion": (f"{repository}/discussions/%s", "discussion #%s"),
"pypi": ("https://pypi.org/project/%s", "``%s``"),
"pypi": ("https://pypi.org/project/%s", "%s"),
"github": ("https://github.com/%s", "%s")
}

print(f"loading configurations for {project} {version} ...", file=sys.stderr)
3 changes: 1 addition & 2 deletions docs/dev-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ How it works
``validate-pyproject`` relies mostly on a set of :doc:`specification documents
<json-schemas>` represented as `JSON Schema`_.
To run the checks encoded under these schema files ``validate-pyproject``
uses the fastjsonschema_ package.
uses the :pypi:`fastjsonschema` package.

This procedure is defined in the :mod:`~validate_pyproject.api` module,
specifically under the :class:`~validate_pyproject.api.Validator` class.
Expand Down Expand Up @@ -119,7 +119,6 @@ Also notice plugins are activated in a specific order, using Python's built-in


.. _entry-point: https://setuptools.pypa.io/en/stable/userguide/entry_point.html#entry-points
.. _fastjsonschema: https://github.com/horejsek/python-fastjsonschema
.. _JSON Schema: https://json-schema.org/
.. _Python package: https://packaging.python.org/
.. _setuptools: https://setuptools.pypa.io/en/stable/
13 changes: 5 additions & 8 deletions docs/embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ use the Python API.

Alternatively, if you cannot afford having external dependencies in your
project you can also opt to *"vendorise"* [#vend1]_ ``validate-pyproject``.
This can be done automatically via tools such as
`vendoring <https://pypi.org/project/vendoring/>`_ or
`vendorize <https://pypi.org/project/vendorize/>`_ and many others others,
however this technique will copy several files into your project.
This can be done automatically via tools such as :pypi:`vendoring` or
:pypi:`vendorize` and many others others, however this technique will copy
several files into your project.

If you want to keep the amount of files to a minimum,
``validate-pyproject`` offers a different solution that consists in generating
a validation file (thanks to fastjsonschema_'s ability to compile JSON Schemas
a validation file (thanks to :pypi:`fastjsonschema`'s ability to compile JSON Schemas
to code) and copying only the strictly necessary Python modules.

After :ref:`installing <installation>` ``validate-pyproject`` this can be done
Expand Down Expand Up @@ -54,11 +53,9 @@ code by doing:
.. [#vend1] The words "vendorise" or "vendoring" in this text refer to the act
of copying external dependencies to a folder inside your project, so they
are distributed in the same package and can be used directly without relying
on installation tools, such as pip_.
on installation tools, such as :pypi:`pip`.
.. _fastjsonschema: https://pypi.org/project/fastjsonschema/
.. _pip: https://pip.pypa.io/
.. _project: https://packaging.python.org/tutorials/managing-dependencies/
.. _library dependency: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html
.. _virtual environment: https://realpython.com/python-virtual-environments-a-primer/
7 changes: 3 additions & 4 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ Why ``fastjsonschema``?

While there are other (more popular) `JSON Schema`_ libraries in the Python
community, none of the ones the original author of this package investigated
(other than fastjsonschema_) fulfilled the following requirements:
(other than :pypi:`fastjsonschema`) fulfilled the following requirements:

- Minimal number of dependencies (ideally 0)
- Easy to "vendorise", i.e. copy the source code of the package to be used
directly without requiring installation.

fastjsonschema_ has no dependency and can generate validation code directly,
:pypi:`fastjsonschema` has no dependency and can generate validation code directly,
which bypass the need for copying most of the files when :doc:`"vendoring"
<embedding>`.


Why draft-07 of JSON Schema and not a more modern version?
==========================================================

The most modern version of JSON Schema supported by fastjsonschema_ is Draft 07.
The most modern version of JSON Schema supported by :pypi:`fastjsonschema` is Draft 07.
It is not as bad as it may sound, it even supports `if-then-else`_-style conditions…


Expand All @@ -58,7 +58,6 @@ of the schemas themselves:
from its canonical URI.


.. _fastjsonschema: https://github.com/horejsek/python-fastjsonschema
.. _if-then-else: https://json-schema.org/understanding-json-schema/reference/conditionals.html
.. _issue: https://github.com/pypa/setuptools/issues/2671
.. _JSON Schema: https://json-schema.org/
Expand Down

0 comments on commit 033c5a7

Please sign in to comment.