Skip to content

Commit

Permalink
#53: Updated Sphinx doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Mar 14, 2024
1 parent de1a69e commit 8054c8b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_api

# PyBuilder
target/

# IDEs
.idea/
.vscode/
.vscode/
59 changes: 48 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,61 @@ clean-pyc: ## remove Python file artifacts

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr reports/

test: ## run tests quickly with the default Python
python setup.py test

test-all: ## run tests on every Python version with tox
tox

pylint: ## run style checks and static analysis with pylint
@-mkdir -p reports/
@-pylint $(PYTHON_PACKAGE) -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > reports/pylint.txt
@echo "See reports/pylint.txt"
@-pylint $(PYTHON_PACKAGE)

flake8: ## run style checks and static analysis with flake8
@flake8
@-mkdir -p reports/
flake8 $(PYTHON_PACKAGE) $(TESTS_PACKAGE) --format='%(path)s:%(row)d: [%(code)s(%(code)s), ] %(text)s' --output-file=reports/flake8.txt --tee

docstrings: ## check docstring presence and style conventions with pydocstyle
pydocstyle $(PYTHON_PACKAGE)

lint: flake8 docstrings pylint

coverage: ## check code coverage quickly with the default Python
py.test --cov-report html:reports/htmlcov --cov-report xml:reports/coverage.xml
@echo "See reports/htmlcov/index.html"

metrics: ## print code metrics with radon
radon raw -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)
radon cc -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)
radon mi -s $(PYTHON_PACKAGE) $(TEST_PACKAGE)

docs: ## generate Sphinx HTML documentation, including API docs
@if python -c 'import sys; sys.exit(sys.version_info[0]<3)'; then \
rm -rf docs/_api; \
sphinx-apidoc --no-toc -o docs/_api $(PYTHON_PACKAGE) "**/tests" "**/migrations" "**/south_migrations"; \
$(MAKE) -C docs clean; \
$(MAKE) -C docs html; \
echo "See docs/_build/html/index.html"; \
else \
echo "Please build the docs using Python 3."; \
fi

docs-open:
$(BROWSER) docs/_build/html/index.html

docs-all: docs docs-open

release: clean ## package and upload a release
python setup.py sdist upload
python setup.py bdist_wheel upload
python setup.py release upload

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python setup.py release
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py install

test:
@pytest

test-all: ## run tests on every Python version with tox
@tox
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ API
.. toctree::
:maxdepth: 4

pganonymize
_api/pganonymize

0 comments on commit 8054c8b

Please sign in to comment.