|
1 | | -# Installing CDIPpy for development |
| 1 | +# Installing CDIPpy for development |
2 | 2 | This page contains instructions for CDIPpy users interested in customizing or contributing to the library. |
3 | 3 |
|
4 | 4 | ## Download source |
5 | | -Clone the [CDIPpy repository](https://github.com/cdipsw/CDIPpy): |
| 5 | +Clone the [CDIPpy repository](https://github.com/cdipsw/CDIPpy): |
6 | 6 |
|
7 | 7 | * using `ssh` - `git clone git@github.com:cdipsw/CDIPpy.git` |
8 | 8 | * using `https` - `git clone https://github.com/cdipsw/CDIPpy.git` |
9 | 9 |
|
10 | 10 | If you need help getting started with [Git](https://git-scm.com/doc) and [GitHub](https://docs.github.com/en/enterprise-cloud@latest/get-started). |
11 | | -You'll specifically want to look at configuring credentials with [https](https://git-scm.com/docs/gitcredentials) or [ssh](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). |
12 | | -[Oh Shit, Git?!](https://ohshitgit.com/) is another great resource for fixing git problems. |
| 11 | +You'll specifically want to look at configuring credentials with [https](https://git-scm.com/docs/gitcredentials) or [ssh](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). |
| 12 | + |
| 13 | +[Dangit, Git!?!](https://dangitgit.com/) is another great resource for fixing git problems. |
13 | 14 |
|
14 | 15 | ## Install with dev tools |
15 | 16 | It is recommended to us [`uv`](https://docs.astral.sh/uv/) to manage you development environment for this project, but other package managers will likely work as well. This documentation provides instructions for using `uv`. |
16 | 17 |
|
17 | 18 | Navigate to the project root dirctory ('CDIPpy/') and run the following: |
18 | 19 | ``` bash |
19 | | ->>> pip install uv # install uv pacakge manager |
20 | | ->>> uv venv # create a virtual envionment at CDIPpy/.venv/ |
21 | | ->>> source activate .venv/bin/activate # activate the environment |
22 | | ->>> uv pip install -e .[dev] # install the source code, its runtime dependencies, and its dev. dependencies. |
| 20 | +>>> pip install uv # install uv pacakge manager |
| 21 | +>>> uv sync # create a virtual envionment at CDIPpy/.venv/, install the source code, its runtime dependencies and it's dev dependencies defined in pyproject.toml. |
| 22 | +>>> source .venv/bin/activate # activate the environment |
23 | 23 | ``` |
24 | | -Using the `-e` flag tells `uv` to point the installation to the source code directory, so that changes you make will be automatically reflected in the environment without reinstalling the package. The `[dev]` specifier installs the packages requires to run tests, lint, and build documentation. |
| 24 | +To exclude the development dpendancies, you can run `uv sync --no-dev`. |
25 | 25 |
|
26 | 26 | ### testing |
27 | 27 | You can check that your dev installation was successful by running unit tests from the root directory: `python -m unittest discover`. |
28 | | -This runs every test in the library; you should see all successful tests. |
| 28 | +This runs every test in the library; you should see all successful tests. |
29 | 29 |
|
30 | 30 | Learn more about running specific tests or subsets from the [`unittest` docs](https://docs.python.org/3/library/unittest.html). |
31 | 31 |
|
32 | 32 | ### linting |
33 | | -This library uses `flake8` to check for adherance to the [PEP8](https://peps.python.org/pep-0008/) style guide. To check whether your code is compliant with the project style, run `flake8 .` from the project root. You can fix problems manually, or use a tool like [`black`](https://black.readthedocs.io/en/stable/) to autolint: `black .`. |
| 33 | +This library uses `flake8` to check for adherance to the [PEP8](https://peps.python.org/pep-0008/) style guide. To check whether your code is compliant with the project style, run `flake8 .` from the project root. You can fix problems manually, or use a tool like [`black`](https://black.readthedocs.io/en/stable/) to autolint: `black .`. |
34 | 34 |
|
35 | 35 | This project also provides a [`pre-commit`](https://pre-commit.com/) hook to manage style for you autmatically on every `git commit`. To install it, run `pre-commit install` from the project root - this will use `black` and `flake` to autolint and check any changes you make for style before committing them to the repository. |
0 commit comments