You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create isolated environment with required Python version. This can be done with tools like venv or conda:
43
+
Create isolated environment with required Python version. This assumes that you have `conda` installed ([see instructions](https://docs.anaconda.com/free/miniconda/)):
Alternatively, you can use the included `env.yml` file that performs all the previous steps (except the pre-commit hooks):
75
-
76
-
```{bash}
77
-
conda env create -f env.yml
78
-
```
79
-
80
-
or `make`
81
-
82
-
```{bash}
83
-
make env
84
-
conda activate python-template
85
-
make install
86
64
make hooks
87
65
```
88
66
@@ -91,33 +69,29 @@ make hooks
91
69
The `requirements.txt` is generated automatically with `pip-tools` and it should not be edited manually. Add abstract dependencies to `requirements.in` and `requirements-dev.in`. If necessary, add version requirements but try to be as flexible as possible. Then, update the `requirements.txt` file with:
92
70
93
71
```{bash}
94
-
pip-compile --extra dev pyproject.toml
72
+
make compile
95
73
```
96
74
97
-
If you want to pin separately production and dev dependencies you can use instead:
75
+
Sync the local environment with the `requirements-dev.txt` file:
98
76
99
77
```{bash}
100
-
pip-compile pyproject.toml
78
+
make sync
101
79
```
102
80
103
-
And:
81
+
## Run linter and formatter
104
82
105
83
```{bash}
106
-
pip-compile --extra dev -o requirements-dev.txt -c requirements.txt pyproject.toml
84
+
make ruff
107
85
```
108
86
109
-
Or simply:
87
+
## Run tests
110
88
111
89
```{bash}
112
-
make compile
90
+
make test
113
91
```
114
92
115
-
Flag `-c` constrains the `dev` dependencies to be the same exact versions as the production dependencies. `pip-tools` also has a `pip-sync` command to make sure that the local environment is in sync with the `requirements.txt` or `requirements-dev.txt` file:
0 commit comments