We welcome contributions to cdx_toolkit! Whether you're adding new features, improving documentation, or fixing bugs, your help is greatly appreciated.
Clone the repository, setup a virtual environment, and run the following command:
make installFor S3-related features or tests, install optional dependencies:
pip install -e ".[s3]"To install everything (dev/test/S3), use:
pip install -e ".[all]"To test code changes, please run our test suite before submitting pull requests:
# all tests (same as CI)
make test
# simple unit tests without integration tests
make unitBy default, all remote requests are mocked. To change this behaviour and actually call remote APIs (if you run this from a whitelisted IP address), the following environment variable can be set:
export DISABLE_MOCK_RESPONSES=1If the remote APIs change, new mock data can be semi-automatically collected by setting another environment variable, running corresponding unit tests, and overwriting existing mock data in tests/data/mock_responses:
# set environment variable (DISABLE_MOCK_RESPONSES should not be set)
export SAVE_MOCK_RESPONSES=./tmp/mock_responses
# run the test for what mock data should be saved to $SAVE_MOCK_RESPONSES/<test_file>/<test_func>.jsonl
pytest tests/test_cli.py::test_basicsPlease following the definitions from .editorconfig and .flake8.
To test the linting, run this command:
make lintTo automatically run the linting on every commit, you can use the pre-commit hooks (automatically installed via make install).
You can also run the hooks manually on all files:
pre-commit run --all-files