File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ See the [ Scientific Python Developer Guide] [ spc-dev-intro ] for a detailed
2
+ description of best practices for developing scientific packages.
3
+
4
+ [ spc-dev-intro ] : https://learn.scientific-python.org/development/
5
+
6
+ # Setting up a development environment manually
7
+
8
+ You can set up a development environment by running:
9
+
10
+ ``` zsh
11
+ python3 -m venv venv # create a virtualenv called venv
12
+ source ./venv/bin/activate # now `python` points to the virtualenv python
13
+ pip install -v -e " .[dev]" # -v for verbose, -e for editable, [dev] for dev dependencies
14
+ ```
15
+
16
+ # Post setup
17
+
18
+ You should prepare pre-commit, which will help you by checking that commits pass
19
+ required checks:
20
+
21
+ ``` bash
22
+ pip install pre-commit # or brew install pre-commit on macOS
23
+ pre-commit install # this will install a pre-commit hook into the git repo
24
+ ```
25
+
26
+ You can also/alternatively run ` pre-commit run ` (changes only) or
27
+ ` pre-commit run --all-files ` to check even without installing the hook.
28
+
29
+ # Testing
30
+
31
+ This repo uses ` unittest ` for testing. You can run locally the tests by running the following command:
32
+
33
+ ``` bash
34
+ python -m unittest discover -s tests
35
+ ```
36
+ there is also a autamtated test pipeline that runs the tests on every push to the repository (see [ here] ( .github/workflows/ci.yml ) ).
37
+
38
+
39
+ # Pre-commit
40
+
41
+ This project uses pre-commit for all style checking. Install pre-commit and run:
42
+
43
+ ``` bash
44
+ pre-commit run -a
45
+ ```
46
+
47
+ to check all files.
You can’t perform that action at this time.
0 commit comments