Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Commits on Jul 29, 2020
Implements the Python handler option `show_root_members_full_path`:
shows the full Python path of the direct children of the object at the
root of the documentation tree. Defaults to false.

Issue #134
PR #136
Commits on Aug 21, 2020
PR #146.
Commits on Sep 03, 2020
We were previously using canonical URLs to
fix cross-references throughout the built site.
This was not working when the site was served
on a sub-URL, for example an URL including
the version or the language of the docs.

Cross-references URLs are now relative
to each other. This also allow us to get
rid of the check for the configuration
value `site_url`, which is not needed anymore.

Fixes #144.
References #147.
Commits on Sep 04, 2020
Commits on Sep 25, 2020
Issue: https://github.com/pawamoy/mkdocstrings/154
PR: https://github.com/pawamoy/mkdocstrings/155
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Commits on Sep 26, 2020
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 309bc30
_commit: a06692b
_src_path: gh:pawamoy/copier-poetry
author_email: pawamoy@pm.me
author_fullname: "Timoth\xE9e Mazzucotelli"
@@ -0,0 +1,7 @@
github:
- pawamoy
ko_fi: pawamoy
liberapay: pawamoy
patreon: pawamoy
custom:
- https://www.paypal.me/pawamoy
@@ -35,7 +35,7 @@ jobs:

- name: Set up the project
run: |
pip install poetry safety
pip install poetry invoke safety
poetry config virtualenvs.in-project true
make setup
@@ -83,7 +83,7 @@ jobs:
- name: Set up the project
run: |
pip install poetry
pip install poetry invoke
poetry config virtualenvs.in-project true
make setup
@@ -4,12 +4,11 @@ __pycache__/
dist/
*.egg-info/
build/
.coverage
tests/tmp/*
!tests/tmp/.gitkeep
.coverage*
pip-wheel-metadata/
.pytest_cache/
.python-version
site/
poetry.lock
.mypy_cache
.mypy_cache/
.venv/

Large diffs are not rendered by default.

@@ -14,12 +14,43 @@ cd mkdocstrings
make setup
```

That's it!
!!! note
If it fails for some reason,
you'll need to install these tools manually:
[Poetry](https://github.com/python-poetry/poetry) and
[Invoke](https://github.com/pyinvoke/invoke).

You can install them with:

```bash
python3 -m pip install --user pipx
pipx install poetry
pipx install invoke
```

Now you can try running `make setup` again,
or simply `poetry install`.

You now have the dependencies installed.

Run `make help` to see all the available actions!

## Tasks

This project uses [Invoke](https://github.com/pyinvoke/invoke) to run tasks.
A Makefile is also provided. The Makefile will try to run the task
on multiple Python versions. If for some reason you don't want to run the task
on multiple Python versions, you can do one of the following:

1. `export PYTHON_VERSIONS= `: this will run the task
with only the current Python version
2. run the task directly with `poetry run invoke TASK`,
or `invoke TASK` if the environment was already activated
through `poetry shell`

The Makefile detects if the Poetry environment is activated,
so `make` will work the same with the virtualenv activated or not.

## Development

As usual:
@@ -10,21 +10,20 @@ These projects were used to build `mkdocstrings`. **Thank you!**
[`copier-poetry`](https://github.com/pawamoy/copier-poetry)

### Direct dependencies
[`bandit`](https://bandit.readthedocs.io/en/latest/) |
[`autoflake`](https://github.com/myint/autoflake) |
[`beautifulsoup4`](http://www.crummy.com/software/BeautifulSoup/bs4/) |
[`black`](https://github.com/psf/black) |
[`coverage`](https://github.com/nedbat/coveragepy) |
[`failprint`](https://github.com/pawamoy/failprint) |
[`flake8`](https://gitlab.com/pycqa/flake8) |
[`flake8-bandit`](https://github.com/tylerwince/flake8-bandit) |
[`flake8-black`](https://github.com/peterjc/flake8-black) |
[`flake8-builtins`](https://github.com/gforcada/flake8-builtins) |
[`flake8-comprehensions`](https://github.com/adamchainz/flake8-comprehensions) |
[`flake8-docstrings`](https://gitlab.com/pycqa/flake8-docstrings) |
[`flake8-isort`](https://github.com/gforcada/flake8-isort) |
[`flake8-pytest-style`](https://pypi.org/project/flake8-pytest-style) |
[`flake8-tidy-imports`](https://github.com/adamchainz/flake8-tidy-imports) |
[`flake8-variables-names`](https://github.com/best-doctor/flake8-variables-names) |
[`flakehell`](None) |
[`git-changelog`](https://github.com/pawamoy/git-changelog) |
[`httpx`](https://github.com/encode/httpx) |
[`invoke`](http://docs.pyinvoke.org) |
[`ipython`](https://ipython.org) |
[`isort`](https://github.com/timothycrosley/isort) |
[`jinja2-cli`](https://github.com/mattrobenolt/jinja2-cli) |
@@ -34,65 +33,99 @@ These projects were used to build `mkdocstrings`. **Thank you!**
[`pymdown-extensions`](https://github.com/facelessuser/pymdown-extensions) |
[`pytest`](https://docs.pytest.org/en/latest/) |
[`pytest-cov`](https://github.com/pytest-dev/pytest-cov) |
[`pytest-randomly`](https://github.com/pytest-dev/pytest-randomly) |
[`pytest-sugar`](http://pivotfinland.com/pytest-sugar/) |
[`pytest-xdist`](https://github.com/pytest-dev/pytest-xdist) |
[`pytkdocs`](https://github.com/pawamoy/pytkdocs) |
[`requests`](https://requests.readthedocs.io) |
[`toml`](https://github.com/uiri/toml)
[`toml`](https://github.com/uiri/toml) |
[`wemake-python-styleguide`](https://wemake-python-stylegui.de) |
[`wrapt`](https://github.com/GrahamDumpleton/wrapt)

### Indirect dependencies
[`ansimarkup`](https://github.com/gvalkov/python-ansimarkup) |
[`apipkg`](https://github.com/pytest-dev/apipkg) |
[`appdirs`](http://github.com/ActiveState/appdirs) |
[`appnope`](http://github.com/minrk/appnope) |
[`astor`](https://github.com/berkerpeksag/astor) |
[`astroid`](https://github.com/PyCQA/astroid) |
[`atomicwrites`](https://github.com/untitaker/python-atomicwrites) |
[`attrs`](https://www.attrs.org/) |
[`backcall`](https://github.com/takluyver/backcall) |
[`bandit`](https://bandit.readthedocs.io/en/latest/) |
[`certifi`](https://certifiio.readthedocs.io/en/latest/) |
[`chardet`](https://github.com/chardet/chardet) |
[`click`](https://palletsprojects.com/p/click/) |
[`colorama`](https://github.com/tartley/colorama) |
[`contextvars`](http://github.com/MagicStack/contextvars) |
[`darglint`](None) |
[`dataclasses`](https://github.com/ericvsmith/dataclasses) |
[`decorator`](https://github.com/micheles/decorator) |
[`docutils`](http://docutils.sourceforge.net/) |
[`entrypoints`](https://github.com/takluyver/entrypoints) |
[`eradicate`](https://github.com/myint/eradicate) |
[`execnet`](https://execnet.readthedocs.io/en/latest/) |
[`flake8`](https://gitlab.com/pycqa/flake8) |
[`flake8-bandit`](https://github.com/tylerwince/flake8-bandit) |
[`flake8-broken-line`](https://github.com/sobolevn/flake8-broken-line) |
[`flake8-bugbear`](https://github.com/PyCQA/flake8-bugbear) |
[`flake8-commas`](https://github.com/PyCQA/flake8-commas/) |
[`flake8-comprehensions`](https://github.com/adamchainz/flake8-comprehensions) |
[`flake8-debugger`](https://github.com/jbkahn/flake8-debugger) |
[`flake8-docstrings`](https://gitlab.com/pycqa/flake8-docstrings) |
[`flake8-eradicate`](https://github.com/sobolevn/flake8-eradicate) |
[`flake8-isort`](https://github.com/gforcada/flake8-isort) |
[`flake8-plugin-utils`](https://pypi.org/project/flake8-plugin-utils) |
[`flake8-polyfill`](https://gitlab.com/pycqa/flake8-polyfill) |
[`flake8-quotes`](http://github.com/zheller/flake8-quotes/) |
[`flake8-rst-docstrings`](https://github.com/peterjc/flake8-rst-docstrings) |
[`flake8-string-format`](https://github.com/xZise/flake8-string-format) |
[`future`](https://python-future.org) |
[`gitdb`](https://github.com/gitpython-developers/gitdb) |
[`GitPython`](https://github.com/gitpython-developers/GitPython) |
[`h11`](https://github.com/python-hyper/h11) |
[`httpcore`](https://github.com/encode/httpcore) |
[`idna`](https://github.com/kjd/idna) |
[`immutables`](https://github.com/MagicStack/immutables) |
[`importlib-metadata`](http://importlib-metadata.readthedocs.io/) |
[`iniconfig`](http://github.com/RonnyPfannschmidt/iniconfig) |
[`ipython-genutils`](http://ipython.org) |
[`jedi`](https://github.com/davidhalter/jedi) |
[`Jinja2`](https://palletsprojects.com/p/jinja/) |
[`joblib`](https://joblib.readthedocs.io) |
[`lazy-object-proxy`](https://github.com/ionelmc/python-lazy-object-proxy) |
[`livereload`](https://github.com/lepture/python-livereload) |
[`lunr`](https://github.com/yeraydiazdiaz/lunr.py) |
[`Markdown`](https://Python-Markdown.github.io/) |
[`MarkupSafe`](https://palletsprojects.com/p/markupsafe/) |
[`mccabe`](https://github.com/pycqa/mccabe) |
[`mkdocs-material-extensions`](https://github.com/facelessuser/mkdocs-material-extensions) |
[`more-itertools`](https://github.com/more-itertools/more-itertools) |
[`mypy-extensions`](https://github.com/python/mypy_extensions) |
[`nltk`](http://nltk.org/) |
[`packaging`](https://github.com/pypa/packaging) |
[`parso`](https://github.com/davidhalter/parso) |
[`pathspec`](https://github.com/cpburnz/python-path-specification) |
[`pbr`](https://docs.openstack.org/pbr/latest/) |
[`pep8-naming`](https://github.com/PyCQA/pep8-naming) |
[`pexpect`](https://pexpect.readthedocs.io/) |
[`pickleshare`](https://github.com/pickleshare/pickleshare) |
[`pluggy`](https://github.com/pytest-dev/pluggy) |
[`prompt-toolkit`](https://github.com/prompt-toolkit/python-prompt-toolkit) |
[`ptyprocess`](https://github.com/pexpect/ptyprocess) |
[`py`](http://py.readthedocs.io/) |
[`py`](https://py.readthedocs.io/) |
[`pycodestyle`](https://pycodestyle.readthedocs.io/) |
[`pydocstyle`](https://github.com/PyCQA/pydocstyle/) |
[`pyflakes`](https://github.com/PyCQA/pyflakes) |
[`Pygments`](https://pygments.org/) |
[`pylint`](https://github.com/PyCQA/pylint) |
[`pyparsing`](https://github.com/pyparsing/pyparsing/) |
[`pytest-forked`](https://github.com/pytest-dev/pytest-forked) |
[`PyYAML`](https://github.com/yaml/pyyaml) |
[`regex`](https://bitbucket.org/mrabarnett/mrab-regex) |
[`restructuredtext-lint`](https://github.com/twolfson/restructuredtext-lint) |
[`rfc3986`](http://rfc3986.readthedocs.io) |
[`six`](https://github.com/benjaminp/six) |
[`smmap`](https://github.com/gitpython-developers/smmap) |
[`sniffio`](https://github.com/python-trio/sniffio) |
[`snowballstemmer`](https://github.com/snowballstem/snowball) |
[`soupsieve`](https://github.com/facelessuser/soupsieve) |
[`stevedore`](https://docs.openstack.org/stevedore/latest/) |
134 Makefile
@@ -1,110 +1,50 @@
.DEFAULT_GOAL := help
SHELL := bash

PY_SRC := src/ tests/ scripts/
CI ?= false
TESTING ?= false
INVOKE_OR_POETRY = $(shell command -v invoke &>/dev/null || echo poetry run) invoke
INVOKE_AND_POETRY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo poetry run) invoke

.PHONY: changelog
changelog: ## Update the changelog in-place with latest commits.
@poetry run failprint -t "Updating changelog" -- python scripts/update_changelog.py \
CHANGELOG.md "<!-- insertion marker -->" "^## \[(?P<version>[^\]]+)"
PYTHON_VERSIONS ?= 3.6 3.7 3.8

.PHONY: check
check: check-docs check-code-quality check-types check-dependencies ## Check it all!
POETRY_TASKS = \
changelog \
combine \
coverage \
docs \
docs-deploy \
docs-regen \
docs-serve \
format \
release

.PHONY: check-code-quality
check-code-quality: ## Check the code quality.
@poetry run failprint -t "Checking code quality" -- flake8 --config=config/flake8.ini $(PY_SRC)
QUALITY_TASKS = \
check \
check-code-quality \
check-dependencies \
check-docs \
check-types \
test

.PHONY: check-dependencies
check-dependencies: ## Check for vulnerabilities in dependencies.
@SAFETY=safety; \
if ! $(CI); then \
if ! command -v $$SAFETY &>/dev/null; then \
SAFETY="pipx run safety"; \
fi; \
fi; \
poetry export -f requirements.txt --without-hashes | \
poetry run failprint --no-pty -t "Checking dependencies" -- $$SAFETY check --stdin --full-report
INVOKE_TASKS = \
clean

.PHONY: check-docs
check-docs: ## Check if the documentation builds correctly.
@poetry run failprint -t "Building documentation" -- mkdocs build -s

.PHONY: check-types
check-types: ## Check that the code is correctly typed.
@poetry run failprint -t "Type-checking" -- mypy --config-file config/mypy.ini $(PY_SRC)

.PHONY: clean
clean: ## Delete temporary files.
@rm -rf build 2>/dev/null
@rm -rf .coverage* 2>/dev/null
@rm -rf dist 2>/dev/null
@rm -rf .mypy_cache 2>/dev/null
@rm -rf pip-wheel-metadata 2>/dev/null
@rm -rf .pytest_cache 2>/dev/null
@rm -rf src/*.egg-info 2>/dev/null
@rm -rf src/mkdocstrings/__pycache__ 2>/dev/null
@rm -rf scripts/__pycache__ 2>/dev/null
@rm -rf site 2>/dev/null
@rm -rf tests/__pycache__ 2>/dev/null
@find . -name "*.rej" -delete 2>/dev/null

.PHONY: docs
docs: docs-regen ## Build the documentation locally.
@poetry run mkdocs build

.PHONY: docs-regen
docs-regen: ## Regenerate some documentation pages.
@poetry run python scripts/regen_docs.py

.PHONY: docs-serve
docs-serve: docs-regen ## Serve the documentation (localhost:8000).
@poetry run mkdocs serve

.PHONY: docs-deploy
docs-deploy: docs-regen ## Deploy the documentation on GitHub pages.
@poetry run mkdocs gh-deploy

.PHONY: help
help: ## Print this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
help:
@$(INVOKE_OR_POETRY) --list

.PHONY: format
format: ## Run formatting tools on the code.
@poetry run failprint -t "Formatting code" -- black $(PY_SRC)
@poetry run failprint -t "Ordering imports" -- isort -y -rc $(PY_SRC)
.PHONY: setup
setup:
@env PYTHON_VERSIONS="$(PYTHON_VERSIONS)" bash scripts/setup.sh

.PHONY: release
release: ## Create a new release (commit, tag, push, build, publish, deploy docs).
ifndef v
$(error Pass the new version with 'make release v=0.0.0')
endif
@poetry run failprint -t "Bumping version" -- poetry version $(v)
@poetry run failprint -t "Staging files" -- git add pyproject.toml CHANGELOG.md
@poetry run failprint -t "Committing changes" -- git commit -m "chore: Prepare release $(v)"
@poetry run failprint -t "Tagging commit" -- git tag v$(v)
@poetry run failprint -t "Building dist/wheel" -- poetry build
-@if ! $(CI) && ! $(TESTING); then \
poetry run failprint -t "Pushing commits" -- git push; \
poetry run failprint -t "Pushing tags" -- git push --tags; \
poetry run failprint -t "Publishing version" -- poetry publish; \
poetry run failprint -t "Deploying docs" -- poetry run mkdocs gh-deploy; \
fi
.PHONY: $(POETRY_TASKS)
$(POETRY_TASKS):
@$(INVOKE_AND_POETRY) $@ $(args)

.PHONY: setup
setup: ## Setup the development environment (install dependencies).
@if ! $(CI); then \
if ! command -v poetry &>/dev/null; then \
if ! command -v pipx &>/dev/null; then \
pip install --user pipx; \
fi; \
pipx install poetry; \
fi; \
fi; \
poetry install -v
.PHONY: $(QUALITY_TASKS)
$(QUALITY_TASKS):
@env PYTHON_VERSIONS="$(PYTHON_VERSIONS)" bash scripts/run_task.sh $(INVOKE_AND_POETRY) $@ $(args)

.PHONY: test
test: ## Run the test suite and report coverage.
@poetry run pytest -c config/pytest.ini -n auto -k "$(K)" 2>/dev/null
-@poetry run coverage html --rcfile=config/coverage.ini
.PHONY: $(INVOKE_TASKS)
$(INVOKE_TASKS):
@$(INVOKE_OR_POETRY) $@ $(args)
@@ -96,10 +96,10 @@ export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"
# install Python 3.6
pyenv install 3.6.8
pyenv install 3.6.12
# make it available globally
pyenv global system 3.6.8
pyenv global system 3.6.12
```
</details>

@@ -11,4 +11,5 @@ python_files =
tests.py
addopts =
--cov
--cov-append
--cov-config config/coverage.ini

No commit comments for this range