summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJean Abou-Samra <jean@abou-samra.fr>2023-02-23 13:44:22 +0100
committerGitHub <noreply@github.com>2023-02-23 13:44:22 +0100
commite589fee754a76e9600dcb42baaeb3372d9e163d7 (patch)
tree34a4a1bef36b0d1b65b8925e9751a9ee3bdc7281 /doc
parent1e85f7c2ad2edfeae7f0c566163931324f64f949 (diff)
downloadpygments-git-e589fee754a76e9600dcb42baaeb3372d9e163d7.tar.gz
Replace Makefile with tox (#2331)
Porting notes: - tox handles Python environments automatically. Remove a bit of PYTHONPATH manipulation (that was using Python 2 code which always failed!) - No `clean` target: `git clean -xdf` should fit the bill. - No `reindent` target: the `reindent.py` script it was using does not exist (anymore?). - No equivalent of tox-test-coverage, which was an artifact of the past, using nose. Instead, the test-coverage target only is ported, which uses pytest, and works.
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile10
-rw-r--r--doc/docs/lexerdevelopment.rst8
-rw-r--r--doc/styles.rst3
3 files changed, 6 insertions, 15 deletions
diff --git a/doc/Makefile b/doc/Makefile
index a0dcaaa4..f648bfa8 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -18,7 +18,6 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
help:
@echo "Please use \`make <target>' where <target> is one of"
- @echo " pyodide to make Pyodide with currently checked out Pygments"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@@ -42,21 +41,12 @@ help:
clean:
-rm -rf $(BUILDDIR)/*
-pyodide:
- $(if $(test ! -f docker), $(error "Could not find Docker. Please install that before continuing."))
- # Enable the BuildKit backend to use the --output option.
- DOCKER_BUILDKIT=1 docker build --file pyodide/Dockerfile --output $(BUILDDIR)/pyodide/pyodide ..
- @echo
- @echo "Pyodide build finished. The Pyodide artifacts are in $(BUILDDIR)/pyodide."
-
html:
- $(if $(WEBSITE_BUILD), $(MAKE) pyodide)
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
- $(if $(WEBSITE_BUILD), $(MAKE) pyodide)
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst
index 0809e75e..29bdd6ca 100644
--- a/doc/docs/lexerdevelopment.rst
+++ b/doc/docs/lexerdevelopment.rst
@@ -171,17 +171,17 @@ Add the name of your lexer class to this list (or create the list if your lexer
is the only class in the module).
Finally the lexer can be made publicly known by rebuilding the lexer mapping.
-In the root directory of the source (where the ``Makefile`` is located), run:
+In the root directory of the source (where the ``tox.ini`` file is located), run:
.. code-block:: console
- $ make mapfiles
+ $ tox -e mapfiles
To test the new lexer, store an example file in
``tests/examplefiles/<alias>``. For example, to test your
``DiffLexer``, add a ``tests/examplefiles/diff/example.diff`` containing a
sample diff output. To (re)generate the lexer output which the file is checked
-against, use the command ``pytest tests/examplefiles/diff --update-goldens``.
+against, use the command ``tox -- tests/examplefiles/diff --update-goldens``.
Now you can use ``python -m pygments`` from the current root of the checkout to
render your example to HTML:
@@ -201,7 +201,7 @@ Once the example renders as expected, you should run the complete test suite:
.. code-block:: console
- $ make test
+ $ tox
It also tests that your lexer fulfills the lexer API and certain invariants,
such as that the concatenation of all token text is the same as the input text.
diff --git a/doc/styles.rst b/doc/styles.rst
index a1bb0195..1c58748f 100644
--- a/doc/styles.rst
+++ b/doc/styles.rst
@@ -2,4 +2,5 @@
This file is overridden by _templates/styles.html and just exists to allow the
Styles gallery to be reliably linked from the documentation
-(since its location varies between `make html` and `make dirhtml`).
+(since its location varies between the ``html`` and ``dirhtml``
+builders).