@@ -47,22 +47,41 @@ git clone git@github.com:YOUR-USERNAME/narwhals.git
47
47
48
48
### 4. Setting up your environment
49
49
50
- Here's how you can set up your local development environment to contribute:
51
-
52
- 1 . Make sure you have Python3.8+ installed (for example, Python 3.11)
53
- 2 . Create a new virtual environment with ` python3.11 -m venv .venv ` (or whichever version of Python3.9+ you prefer)
54
- 3 . Activate it: ` . .venv/bin/activate `
55
- 4 . Install Narwhals: ` pip install -e . `
56
- 5 . Install test requirements: ` pip install -r requirements-dev.txt `
57
- 6 . Install docs requirements: ` pip install -r docs/requirements-docs.txt `
50
+ Here's how you can set up your local development environment to contribute.
51
+
52
+ #### Option 1: Use UV (recommended)
53
+
54
+ 1 . Make sure you have Python3.8+ installed (for example, Python 3.11), create a virtual environment,
55
+ and activate it. If you're new to this, here's one way that we recommend:
56
+ 1 . Install uv: https://github.com/astral-sh/uv?tab=readme-ov-file#getting-started
57
+ 2 . Install some version of Python greater than Python3.8. For example, to install
58
+ Python3.11:
59
+ ```
60
+ uv python install 3.11
61
+ ```
62
+ 3. Create a virtual environment:
63
+ ```
64
+ uv venv -p 3.11 --seed
65
+ ```
66
+ 4. Activate it. On Linux, this is `. .venv/bin/activate`, on Windows `.\.venv\Scripts\activate`.
67
+ 2. Install Narwhals: `uv pip install -e .`
68
+ 3. Install test requirements: `uv pip install -r requirements-dev.txt`
69
+ 4. Install docs requirements: `uv pip install -r docs/requirements-docs.txt`
58
70
59
71
You should also install pre-commit:
60
72
```
61
- pip install pre-commit
73
+ uv pip install pre-commit
62
74
pre-commit install
63
75
```
64
76
This will automatically format and lint your code before each commit, and it will block the commit if any issues are found.
65
77
78
+ #### Option 2: use python3-venv
79
+
80
+ 1. Make sure you have Python 3.8+ installed. If you don't, you can check [install Python](https://realpython.com/installing-python/)
81
+ to learn how. Then, [create and activate](https://realpython.com/python-virtual-environments-a-primer/)
82
+ a virtual environment.
83
+ 2. Then, follow steps 2-4 from above but using `pip install` instead of `uv pip install`.
84
+
66
85
### 5. Working on your issue
67
86
68
87
Create a new git branch from the `main` branch in your local repository.
0 commit comments