This project comes with a full test suite. To install development and testing dependencies, use:
pip install -e ".[test]"
To also install 3rd party JSON libraries used for running benchmarks, use:
pip install -e ".[benchmark]"
To run the tests, just type
pytest. To also run the benchmarks, use
--runslow will also run the NumPy integration tests.
To properly test builds on Windows, you need both a recent version of Visual Studio as well as VS2015, patch 3. Older versions of CPython required portable C/C++ extensions to be built with the same version of VS as the interpreter. Use the Developer Command Prompt to easily switch between versions.
pysimdjson is written using Cython. However, by default
use the already-generated
csimdjson.cpp instead of regenerating it. This
is to avoid making Cython an install-time requirement.
To force the usage of Cython, use
BUILD_WITH_CYTHON=1 python setup.py develop
This will cause Cython to regenerate the
csimdjson.cpp from the
To build pysimdjson with support for linetracing and coverage, use
BUILD_WITH_CYTHON=1 BUILD_FOR_DEBUG=1 python setup.py develop
pysimdjson will also reuse the generated .so file if you build it more than
once, so to force Cython to rebuild it, use
BUILD_WITH_CYTHON=1 FORCE_REBUILD=1 python setup.py develop