Contributing
Contributions are welcome from anyone interested! The build process is a little complicated, though, so this section is
going to walk you through it. For starters, there is a number of make
recipes that you may find useful.
Pull requests are always welcome, especially (but not only) if they address an open issue.
Variables
The following variables can be overridden to affect the build process
- PY
Holds the name of the python executable. Defaults to
python3
- PIP
Holds the name of the pip executable. Defaults to
$(PY) -m pip
- MOCHA
Holds the name of the mocha executable. Defaults to
npx mocha
unless coverage is enabled, in which case it changes tonpx nyc --reporter=lcov mocha
- COV
Controls whether the python and mocha test runners collect code coverage. Set to
true
orfalse
. Defaults totrue
.
- LINT
Controls how much python linting is done.
less
will enable onlymypy
. Otherwise set totrue
orfalse
. Defaults totrue
if mypy is disabled, otherwiseless
.
- MYPY
Controls whether mypy type checking is done. Set to
true
orfalse
. Defaults totrue
.
- benchmark_flags
Can be used to override the benchmark-specific arguments to the python test runner. I recommend you don’t touch it.
- pytest_args
Can be used to override the automatically-generated pytest arguments. I recommend you don’t touch it.
Build
- clean
Removes any stray build files, and also javascript dependencies.
- dependencies: js_dependencies py_dependencies
Grab all project dependencies.
- py_dependencies
Grab python project dependencies.
- js_dependencies
Grab javascript project dependencies.
- html: bundle
Generates the HTML documentation
- pysrc/_static/fedi_scrip%.min.js: dependencies
This should not be called individually, but these recipes process the javascript found in
jssrc
through Babel and prepend the license to them.
- bundle: js_dependencies
Moves all javascript and dependencies into the python static directory for use and packaging purposes
- build: clean dependencies bundle
Builds a distribution version of the python package.
- publish: build
Provided you have the proper token, uploads the built package to PyPi.
Tests
- test: js_test py_test
Run through all tests in sequence. Utilizes the pytest and mocha test runner infrastructures
- test_%: js_test_% py_test_%
Run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the pytest and mocha runners.
- py_test
Run through all tests in sequence. Utilizes the pytest test runner infrastructures.
- py_test_%
Run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the pytest runner.
- js_test
Run through all tests in sequence. Utilizes the mocha test runner infrastructure.
- js_test_%
Run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the mocha runner.
- js_lint
Run the javascript linters. Unlike in python, this must be done separately.