forked from useblocks/sphinx-collections
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[useblocks#2] fix string and symlink handling, adding first basic tests
- Loading branch information
1 parent
4f1fd7d
commit e8c7229
Showing
30 changed files
with
1,610 additions
and
37 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,43 @@ | ||
SRC_FILES = sphinxcontrib/ tests/ noxfile.py | ||
|
||
.PHONY: list | ||
list: | ||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | ||
|
||
.PHONY: lint | ||
lint: | ||
pre-commit run --all-files | ||
|
||
.PHONY: test | ||
test: | ||
poetry run pytest -n auto --tb=long tests/ | ||
|
||
.PHONY: test | ||
test-short: | ||
poetry run pytest -n auto --tb=long --ignore-glob="*official*" tests/ | ||
|
||
.PHONY: test-matrix | ||
test-matrix: | ||
nox | ||
|
||
.PHONY: docs-html | ||
docs-html: | ||
poetry run sphinx-build -a -E -j auto -b html docs/ docs/_build | ||
|
||
.PHONY: docs-html | ||
docs-html-fast: | ||
poetry run sphinx-build -j auto -b html docs/ docs/_build | ||
|
||
.PHONY: docs-pdf | ||
docs-pdf: | ||
poetry run make --directory docs/ clean && make --directory docs/ latexpdf | ||
|
||
|
||
.PHONY: docs-linkcheck | ||
docs-linkcheck: | ||
poetry run make --directory docs/ linkcheck | ||
|
||
.PHONY: format | ||
format: | ||
poetry run black ${SRC_FILES} | ||
poetry run isort ${SRC_FILES} |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sphinx>=3.4 | ||
sphinxcontrib-collections | ||
gitpython |
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,46 @@ | ||
import nox | ||
from nox_poetry import session | ||
|
||
PYTHON_VERSIONS = ["3.6", "3.8", "3.9.7"] | ||
SPHINX_VERSIONS = ["3.2", "3.5.4", "4.1", "4.2"] | ||
TEST_DEPENDENCIES = [ | ||
"pytest", | ||
"pytest-xdist", | ||
"responses", | ||
"pyparsing!=3.0.4", | ||
"requests-mock", | ||
] | ||
|
||
|
||
def is_supported(python: str, sphinx: str) -> bool: | ||
return not (python == "3.6" and sphinx not in ["3.2"]) | ||
|
||
|
||
def run_tests(session, sphinx): | ||
session.install(".") | ||
session.install(*TEST_DEPENDENCIES) | ||
session.run("pip", "install", f"sphinx=={sphinx}", silent=True) | ||
session.run("pip", "install", "-r", "docs/requirements.txt", silent=True) | ||
session.run("echo", "TEST FINAL PACKAGE LIST") | ||
session.run("pip", "freeze") | ||
session.run("make", "test", external=True) | ||
|
||
|
||
@session(python=PYTHON_VERSIONS) | ||
@nox.parametrize("sphinx", SPHINX_VERSIONS) | ||
def tests(session, sphinx): | ||
if is_supported(session.python, sphinx): | ||
run_tests(session, sphinx) | ||
else: | ||
session.skip("unsupported combination") | ||
|
||
|
||
@session(python="3.9") | ||
def linkcheck(session): | ||
session.install(".") | ||
# LinkCheck cn handle rate limits since Sphinx 3.4, which is needed as | ||
# our doc has to many links to github. | ||
session.run("pip", "install", "sphinx==3.5.4", silent=True) | ||
|
||
session.run("pip", "install", "-r", "docs/requirements.txt", silent=True) | ||
session.run("make", "docs-linkcheck", external=True) |
Oops, something went wrong.