@@ -4,24 +4,15 @@ Before contributing, please either ask to claim an existing open issue or create
44a new issue to discuss your proposed changes with the owner(s) of this repo
55before making any changes.
66
7- * Any pull requests without an approved issue associated with them will be
8- closed*
7+ Any pull requests without a clearly defined issue being solved will be closed.
98
10- ## Bug reports
9+ ### Bug reports
1110
1211Found a bug but do not have time or do not wish to contribute a fix? Please
1312submit an issue for our awareness. Your feedback drives the continued
1413development of the project!
1514
16- ## Fork
17-
18- Create your own fork of this repo that you will make your changes on.
19-
20- ## Creating your feature
21-
22- Always base your changes off the ` main ` branch unless otherwise asked.
23-
24- ## Pull Request
15+ ### Pull Request
2516
2617All pull requests must:
2718
@@ -30,16 +21,166 @@ All pull requests must:
3021- If the PR is a bug fix there must be a test that duplicates the bug, proving
3122 it is fixed
3223
33- ## Code Style
24+ ### Code Style
3425
3526Follow the patterns seen in the code. Walk where others have walked.
3627
3728The majority of code style nits will be met when passing ` pre-commit ` checks
3829prior to submitting a pull request.
3930
40- ## Tests
31+ ### Tests
4132
4233 - Smaller tests are easier to work with
4334 - Mock at a minimum
4435 - No test should be dependent on another
4536 - No test should be dependent on secrets/tokens
37+
38+
39+ ---
40+
41+ # Local developer installation
42+
43+ The following steps outline how to install this repo for local development.
44+
45+ ## Prerequisites
46+
47+ ### Clone repo
48+
49+ ``` console
50+ git clone https://github.com/[ORG NAME]/[REPO NAME]
51+
52+ cd [REPO NAME]
53+ ```
54+
55+ ### Virtual Environment
56+
57+ Use a ([ ` venv ` ] ( https://docs.python.org/3/library/venv.html ) ), or equivalent,
58+ when working with python projects. Leveraging a ` venv ` will ensure the installed
59+ dependency files will not impact other python projects or any system
60+ dependencies.
61+
62+ ** Windows users** : Depending on your python install you will use ` py ` in place
63+ of ` python ` to create the ` venv ` .
64+
65+ ** Linux/Mac users** : Replace ` python ` , if needed, with the appropriate call to
66+ the desired version while creating the ` venv ` . (e.g. ` python3 ` or ` python3.12 ` )
67+
68+ ** All users** : Once inside an active ` venv ` all systems should allow the use of
69+ ` python ` for command line instructions. This will ensure you are using the
70+ ` venv ` 's python and not the system level python.
71+
72+ ### Create the ` venv ` :
73+
74+ ``` console
75+ python -m venv venv
76+ ```
77+
78+ Activate the ` venv ` :
79+
80+ ``` console
81+ # Linux/Mac
82+ . venv/bin/activate
83+
84+ # Windows
85+ venv\Scripts\activate
86+ ```
87+
88+ The command prompt should now have a ` (venv) ` prefix on it. ` python ` will now
89+ call the version of the interpreter used to create the ` venv `
90+
91+ To deactivate (exit) the ` venv ` :
92+
93+ ``` console
94+ deactivate
95+ ```
96+
97+ ---
98+
99+ ## Developer Installation Steps
100+
101+ ### Install editable library and development requirements
102+
103+ ``` console
104+ python -m pip install --editable .[dev,test]
105+ ```
106+
107+ ### Install pre-commit [ (see below for details)] ( #pre-commit )
108+
109+ ``` console
110+ pre-commit install
111+ ```
112+
113+ ### Install with nox
114+
115+ If you have ` nox ` installed with ` pipx ` or in the current venv you can use the
116+ following session. This is an alternative to the two steps above.
117+
118+ ``` console
119+ nox -s install
120+ ```
121+
122+ ---
123+
124+ ## Pre-commit and nox tools
125+
126+ ### Run pre-commit on all files
127+
128+ ``` console
129+ pre-commit run --all-files
130+ ```
131+
132+ ### Run tests with coverage (quick)
133+
134+ ``` console
135+ nox -e coverage
136+ ```
137+
138+ ### Run tests (slow)
139+
140+ ``` console
141+ nox
142+ ```
143+
144+ ### Build dist
145+
146+ ``` console
147+ nox -e build
148+ ```
149+
150+ ---
151+
152+ ## Updating dependencies
153+
154+ New dependencys can be added to the ` requirements-*.in ` file. It is recommended
155+ to only use pins when specific versions or upgrades beyond a certain version are
156+ to be avoided. Otherwise, allow ` pip-compile ` to manage the pins in the
157+ generated ` requirements-*.txt ` files.
158+
159+ Once updated following the steps below, the package can be installed if needed.
160+
161+ ### Update the generated files with changes
162+
163+ ``` console
164+ nox -e update
165+ ```
166+
167+ ### Upgrade all generated dependencies
168+
169+ ``` console
170+ nox -e upgrade
171+ ```
172+
173+ ---
174+
175+ ## [ pre-commit] ( https://pre-commit.com )
176+
177+ > A framework for managing and maintaining multi-language pre-commit hooks.
178+
179+ This repo is setup with a ` .pre-commit-config.yaml ` with the expectation that
180+ any code submitted for review already passes all selected pre-commit checks.
181+
182+ ---
183+
184+ ## Error: File "setup.py" not found
185+
186+ Update ` pip ` to at least version 22.3.1
0 commit comments