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
Add Claude Code session hooks and update developer documentation
Session hooks auto-setup venv, install deps, and activate on start.
Getting started docs updated for uv (replacing pyenv/pip/tox).
AGENTS.md quick start updated.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/getting_started.rst
+21-50Lines changed: 21 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,52 +66,37 @@ Finally, add the Learning Equality repo as a remote called `upstream`. That way
66
66
git checkout -t upstream/develop # Checkout the development branch
67
67
68
68
69
-
Python and Pip
70
-
~~~~~~~~~~~~~~
71
-
72
-
To develop on Kolibri, you'll need:
69
+
Python and uv
70
+
~~~~~~~~~~~~~
73
71
74
-
* Python 3.9 or higher (Note: Kolibri does not yet support Python 3.15 or above)
75
-
* `pip <https://pypi.python.org/pypi/pip>`__
72
+
Kolibri uses `uv <https://docs.astral.sh/uv/>`__ to manage Python versions and virtual environments. Install uv following the `official installation guide <https://docs.astral.sh/uv/getting-started/installation/>`__.
76
73
77
-
Managing Python installations can be quite tricky. We *highly* recommend using `pyenv <https://github.com/pyenv/pyenv>`__ or if you are more comfortable using a package manager, then package managers like `Homebrew <http://brew.sh/>`__ on Mac or ``apt`` on Debian for this.
74
+
uv will automatically install the correct Python version when you set up the project — you do not need to install Python separately or use pyenv.
78
75
79
-
To install pyenv see the detailed instructions here :doc:`/howtos/installing_pyenv`.
80
-
..note::
81
-
If you are using a package manager, make sure to install a Python version compatible with Kolibri (3.9 or above, but below 3.15). If you're using `pyenv`, you can install it with a command like `pyenv install 3.9.9`.
82
-
83
-
.. warning::
84
-
Never modify your system's built-in version of Python
76
+
.. note::
77
+
Direct development on Windows is not supported. If you're using a Windows machine, please set up your development environment using WSL (Windows Subsystem for Linux).
85
78
86
79
Python virtual environment
87
80
~~~~~~~~~~~~~~~~~~~~~~~~~~
88
81
89
-
You should use a Python virtual environment to isolate the dependencies of your Python projects from each other and to avoid corrupting your system's Python installation.
90
-
91
-
There are many ways to set up Python virtual environments: You can use `pyenv-virtualenv <https://github.com/pyenv/pyenv-virtualenv>`__ as shown in the instructions below; you can also use `Virtualenv <https://virtualenv.pypa.io/en/latest/>`__, `Virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/en/latest/>`__ `Pipenv <https://pipenv.readthedocs.io/en/latest/>`__, `Python 3 venv <https://docs.python.org/3/library/venv.html>`__, `Poetry <https://poetry.eustace.io>`__ etc.
92
-
93
-
.. note::
94
-
Most virtual environments will require special setup for non-Bash shells such as Fish and ZSH.
95
-
Direct development on Windows is not supported. If you're using a Windows machine, please set up your development environment using WSL (Windows Subsystem for Linux).
82
+
uv automatically creates and manages a virtual environment in the ``.venv`` directory. Set up the project:
96
83
97
-
To setup and start using pyenv-virtualenv, follow the instructions here :doc:`/howtos/pyenv_virtualenv`.
84
+
.. code-block:: bash
98
85
99
-
Once pyenv-virtualenv is installed, you can use the following commands to set up and use a virtual environment from within the Kolibri repo:
86
+
uv sync --group dev # Creates venv, installs Python, installs all dev deps
100
87
88
+
Your virtual environment is now ready. Use ``uv run`` to execute commands within it:
101
89
102
90
.. code-block:: bash
103
91
104
-
pyenv virtualenv 3.9.9 kolibri-py3.9 # can also make an environment for other Python versions, e.g. 3.10
105
-
pyenv activate kolibri-py3.9 # activates the virtual environment
106
-
107
-
Now, any commands you run will target your virtual environment rather than the global Python installation. To deactivate the virtualenv, simply run:
92
+
uv run kolibri --version # Run kolibri CLI
93
+
uv run pytest # Run tests
108
94
95
+
To activate the virtual environment in your shell (for interactive use):
109
96
110
97
.. code-block:: bash
111
98
112
-
pyenv deactivate
113
-
114
-
(Note that you'll want to leave it activated for the remainder of the setup process)
99
+
source .venv/bin/activate # Linux/Mac
115
100
116
101
.. warning::
117
102
Never install project dependencies using ``sudo pip install ...``
@@ -150,20 +135,11 @@ There are two environment variables you should plan to set:
150
135
Install Python dependencies
151
136
~~~~~~~~~~~~~~~~~~~~~~~~~~~
152
137
153
-
To install Kolibri project-specific dependencies make sure you're in the ``kolibri`` directory and your Python virtual environment is active. Then run:
138
+
Python dependencies are installed automatically by ``uv sync --group dev`` above. To update dependencies after pulling new changes:
154
139
155
140
.. code-block:: bash
156
141
157
-
# required
158
-
pip install -r requirements.txt --upgrade
159
-
pip install -r requirements/dev.txt --upgrade
160
-
pip install -e .
161
-
162
-
# optional
163
-
pip install -r requirements/test.txt --upgrade
164
-
pip install -r requirements/docs.txt --upgrade
165
-
166
-
Note that the ``--upgrade`` flags above can usually be omitted to speed up the process.
142
+
uv sync --group dev
167
143
168
144
Install Node.js, pnpm and other dependencies
169
145
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -430,12 +406,11 @@ We have a large number of reusable patterns, conventions, and components built i
430
406
Updating documentation
431
407
----------------------
432
408
433
-
First, install some additional dependencies related to building documentation output:
409
+
First, install the documentation dependencies:
434
410
435
411
.. code-block:: bash
436
412
437
-
pip install -r requirements/docs.txt
438
-
pip install -r requirements/build.txt
413
+
uv sync --group docs
439
414
440
415
To make changes to documentation, edit the ``rst`` files in the ``kolibri/docs`` directory and then run:
441
416
@@ -487,17 +462,13 @@ For more advanced usage, logical operators can also be used in wrapped strings,
487
462
488
463
pytest kolibri/auth/test/test_permissions -k "MembershipPermissionsTestCase and test_admin_can_delete_membership"
489
464
490
-
You can also use ``tox`` to setup a clean and disposable environment:
465
+
You can run tests for a specific Python version using:
491
466
492
467
.. code-block:: bash
493
468
494
-
tox -e py3.4 # Runs tests with Python 3.4
495
-
496
-
To run Python tests for all environments, use simply ``tox``. This simulates what our CI also does on GitHub PRs.
497
-
498
-
.. note::
469
+
uv run --python 3.9 pytest # Runs tests with Python 3.9
499
470
500
-
``tox`` reuses its environment when it is run again. If you add anything to the requirements, you will want to either delete the `.tox` directory, or run ``tox`` with the ``-r`` argument to recreate the environment
471
+
CI runs tests across all supported Python versions automatically.
0 commit comments