Skip to content

Developer Tools

Tyler Yep edited this page May 5, 2020 · 7 revisions

Developer Commands

Update requirements.txt

This project doesn't have any significant dependencies (yet), so for now it is best to always update to the latest requirements.

pur -r requirements.txt
pip install -r requirements.txt

Testing

Run all tests:

pytest -vv [-s to see print/logging output] [unit_test/ or integration_test/]

Coverage Testing

pytest --cov=src --cov-report=html unit_test/

For truly deterministic results during testing, run:

PYTHONHASHSEED=0 python main.py

Make sure const.py sets the random seed.

Static Type Checking

Type-check the directory using Pyre-Check or mypy:

pyre check
mypy .

Linting

Pylint entire directory using:

pylinta
find . -iname "*.py" | xargs pylint

Pylint include/exclude all test files using:

find . -iname "*.py" ! -iname "*_test.py" | xargs pylint
find . -iname "*_test.py" | xargs pylint

Also, check style guidelines with auto-formatter:

isort -y
black . -l 100
flake8 .
pycodestyle .

Profiling

python profile.py
Clone this wiki locally