Skip to content

Latest commit

 

History

History
91 lines (71 loc) · 3.06 KB

CONTRIBUTING.md

File metadata and controls

91 lines (71 loc) · 3.06 KB

Contributing

Contributions are encouraged! Please use the issue page to submit feature requests or bug reports. Issues with attached PRs will be given priority and have a much higher likelihood of acceptance. Please also open an issue and associate it with any submitted PRs. That said, the aim is to keep this library as lightweight as possible. Only features with broad-based use cases will be considered.

We are actively seeking additional maintainers. If you're interested, please contact me.

Installation

django-typer uses Poetry for environment, package, and dependency management:

poetry install

Documentation

django-typer documentation is generated using Sphinx with the readthedocs theme. Any new feature PRs must provide updated documentation for the features added. To build the docs run doc8 to check for formatting issues then run Sphinx:

cd ./doc
poetry run doc8 --ignore-path build --max-line-length 100
poetry run make html

Static Analysis

django-typer uses Pylint for Python linting and mypy and pyright for static type checking. Header imports are also standardized using isort and formatting is done with black. Before any PR is accepted the following must be run, and static analysis tools should not produce any errors or warnings. Disabling certain errors or warnings where justified is acceptable:

poetry run isort django_typer
poetry run black django_typer
poetry run pylint django_typer
poetry run mypy django_typer
pyright
poetry check
poetry run pip check
poetry run python -m readme_renderer ./README.md

Running Tests

django-typer is set up to use pytest to run unit tests. All the tests are housed in django_typer/tests/tests.py. Before a PR is accepted, all tests must be passing and the code coverage must be at 100%. A small number of exempted error handling branches are acceptable.

To run the full suite:

poetry run pytest

To run a single test, or group of tests in a class:

poetry run pytest <path_to_tests_file>::ClassName::FunctionName

For instance, to run all tests in BasicTests, and then just the test_call_command test you would do:

poetry run pytest django_typer/tests/tests.py::BasicTests
poetry run pytest django_typer/tests/tests.py::BasicTests::test_call_command