|
| 1 | +## Installation |
| 2 | +To install CDIPpy locally, you can either |
| 3 | +1. clone the repository, navigate to the root directory, and run `pip install .` or |
| 4 | +2. without cloning the repositorym, install from github: `pip install git+https://github.com/cdipsw/CDIPpy.git` |
| 5 | + |
| 6 | +🚧 **UNDER CONSTRUCTION** 🚧 |
| 7 | + |
| 8 | +*TODO* add test snippet to check installation here |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Development |
| 13 | +To set up a development copy of CDIPpy, install the project form source using [`uv`](https://docs.astral.sh/uv/): |
| 14 | +``` bash |
| 15 | +>>> pip install uv |
| 16 | +>>> uv venv |
| 17 | +>>> source activate .venv/bin/activate |
| 18 | +>>> uv pip install -e .[dev] |
| 19 | +``` |
| 20 | +This creates a local, virtual environment at `./.venv`, and installs a version of CDIPpy that is editable (`-e`), along with several additional dev dependencies (`[dev]`). |
| 21 | +--- |
| 22 | + |
| 23 | +### Testing |
| 24 | +This project uses python's built in `unittest` package. To run all tests: |
| 25 | +~~~ bash |
| 26 | +>>> python -m unittest discover |
| 27 | +~~~ |
| 28 | +To run with [coverage](https://coverage.readthedocs.io/en/7.8.2/): |
| 29 | +~~~ bash |
| 30 | +>>> coverage run -m unittest discover |
| 31 | +~~~ |
| 32 | +To view the coverage report: |
| 33 | +~~~ bash |
| 34 | +>>> coverage report |
| 35 | +~~~ |
| 36 | +--- |
| 37 | + |
| 38 | +### Contributing |
| 39 | +Contributions are welcome and should be merged via pull request on the `main` branch from a forked repository. Before a PR can be merged, it needs to pass the following checks: |
| 40 | + |
| 41 | +* all tests passed |
| 42 | +* coverage >= threshhold |
| 43 | +* passes [`flake8`](https://flake8.pycqa.org/en/latest/) linter |
| 44 | +* there must be at least one reviewer approval |
| 45 | +* a CLA must be signed by the contributor, if this is their first commit |
| 46 | + |
| 47 | +If you do not wish you manually check the style for every commit, there is a pre-commit hook that can do it for you. After setting up CDIPpy for development, install the hook with: `pre-commit install`. The installed hook will auto-format the files in your commit with [`black`](https://black.readthedocs.io/en/stable/) and checked for any remaining format errors with `flake8`. |
0 commit comments