22
33DoubleML is a community effort.
44Everyone is welcome to contribute.
5- All contributors should adhere to this contributing guidelines
5+ All contributors should adhere to these contributing guidelines
66and our [ code of conduct] ( https://github.com/DoubleML/doubleml-for-py/blob/main/CODE_OF_CONDUCT.md ) .
77The contributing guidelines are particularly helpful to get started for your first contribution.
88
@@ -34,7 +34,7 @@ In case of an exception the full traceback is appreciated.
3434``` python
3535import platform; print (platform.platform())
3636import sys; print (" Python" , sys.version)
37- import doubleml; print (" DoubleML" , sklearn .__version__ )
37+ import doubleml; print (" DoubleML" , doubleml .__version__ )
3838import sklearn; print (" Scikit-Learn" , sklearn.__version__ )
3939```
4040
@@ -79,10 +79,19 @@ $ git merge upstream/main
7979```
8080
81815 . ** Install DoubleML in editable mode** (more details can be found
82- [ here] ( https://docs.doubleml.org/stable/intro/install.html#python-building-the-package-from-source ) )
83- via
82+ [ here] ( https://docs.doubleml.org/stable/intro/install.html#python-building-the-package-from-source ) ).
83+
84+ We recommend [ uv] ( https://docs.astral.sh/uv/ ) for development. The following command creates a virtual
85+ environment, provisions Python 3.12 (as pinned in ` .python-version ` ), and installs DoubleML in editable
86+ mode together with the ` dev ` dependency group and the ` rdd ` extra:
87+ ``` bash
88+ $ uv sync --extra rdd
89+ ```
90+ Prefix tooling commands with ` uv run ` to execute them inside this environment (e.g. ` uv run pytest . ` ).
91+
92+ Alternatively, you can use ` pip ` (requires pip >= 25.1 for the ` --group ` flag):
8493``` bash
85- $ pip install --editable .[dev, rdd]
94+ $ pip install --editable " .[ rdd]" --group dev
8695```
8796
88976 . ** Develop** your code changes. The changes can be added and pushed via
@@ -109,7 +118,7 @@ When opening the PR you will be guided with a checklist.
109118for details).
110119To check, please run
111120``` bash
112- $ pytest .
121+ $ uv run pytest . # or, without uv: pytest .
113122```
114123
115124- [x] If you add an ** enhancements** or ** new feature** , ** unit tests**
@@ -118,13 +127,13 @@ $ pytest .
118127- [x] Check whether your changes adhere to the ** PEP8 standards** .
119128For the check you can use the following code
120129``` bash
121- $ git diff upstream/main -u -- " *.py" | ruff check --diff
130+ $ git diff upstream/main -u -- " *.py" | uv run ruff check --diff # or: ... | ruff check --diff
122131```
123132
124- - [x] Check wether the code formatting adheres to the ** Black code style**
133+ - [x] Check whether the code formatting adheres to the ** Black code style**
125134by running
126135``` bash
127- $ black . --check --diff
136+ $ uv run black . --check --diff # or, without uv: black . --check --diff
128137```
129138
130139If your PR is still ** work in progress** , please consider marking it a ** draft PR**
@@ -137,13 +146,13 @@ To ensure code quality and consistency before committing your changes, we recomm
1371461 . ** Install hooks** :
138147 If you haven't already, install the required hooks by running:
139148 ``` bash
140- $ pre-commit install
149+ $ uv run pre-commit install # or, without uv: pre-commit install
141150 ```
142151
1431522 . ** Run pre-commit manually** :
144153 To run the pre-commit checks manually, use:
145154 ``` bash
146- $ pre-commit run --all-files
155+ $ uv run pre-commit run --all-files # or, without uv: pre-commit run --all-files
147156 ```
148157
149158### Unit Tests and Test Coverage
@@ -156,7 +165,7 @@ Coverage reports for the package, PRs, branches etc. are available from
156165It is mandatory to equip new features with an appropriate level of unit test coverage.
157166To ** run all unit tests** (for further option see the [ pytest docu] ( https://docs.pytest.org ) ) call
158167``` bash
159- $ pytest --cov .
168+ $ uv run pytest --cov . # or, without uv: pytest --cov .
160169```
161170If ` pytest ` is called with the ` --cov ` flag, a unit test coverage report is being generated.
162171
0 commit comments