Skip to content

Commit 17bb0bb

Browse files
write dev guide (#9)
1 parent 83c21c8 commit 17bb0bb

2 files changed

Lines changed: 39 additions & 6 deletions

File tree

docs/dev_guide/contribute.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Contributors guide
22
- welcome contributions!
3-
- types on contributions
4-
- workflow
3+
- types of contributions
54

65
## Setting up your git workflow
76

8-
## Tips & tricks
7+
## Making your changes
8+
9+
### linting
10+
### testing
11+
### documenting
12+
13+
## Making your pull request
14+
15+
16+
## Get help

docs/dev_guide/index.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
# Installing CDIPpy for development
2-
This page contains instructions for CDIPpy users interested in customizing or contributiing to the library.
2+
This page contains instructions for CDIPpy users interested in customizing or contributing to the library.
33

4-
## Download from source
4+
## Download source
5+
Clone the [CDIPpy repository](https://github.com/cdipsw/CDIPpy):
6+
7+
* using `ssh` - `git clone git@github.com:cdipsw/CDIPpy.git`
8+
* using `https` - `git clone https://github.com/cdipsw/CDIPpy.git`
9+
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.
513

614
## Install with dev tools
15+
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+
Navigate to the project root dirctory ('CDIPpy/') and run the following:
18+
``` 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.
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.
725

826
### testing
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.
29+
30+
Learn more about running specific tests or subsets from the [`unittest` docs](https://docs.python.org/3/library/unittest.html).
31+
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 .`.
934

10-
### linting
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

Comments
 (0)