mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-01 06:54:22 +02:00
dependency-groups.dev and uv in docs (#691)
* dependency-groups.dev and switch to uv in docs * Separate dependency group for docs
This commit is contained in:
parent
5a7f522980
commit
29d84bc95d
10 changed files with 59 additions and 85 deletions
|
|
@ -13,78 +13,61 @@ All improvements to the software should start with an issue. Read `How I build a
|
|||
Obtaining the code
|
||||
==================
|
||||
|
||||
To work on this library locally, first checkout the code. Then create a new virtual environment::
|
||||
To work on this library locally, first checkout the code::
|
||||
|
||||
git clone git@github.com:simonw/sqlite-utils
|
||||
cd sqlite-utils
|
||||
python3 -mvenv venv
|
||||
source venv/bin/activate
|
||||
|
||||
Or if you are using ``pipenv``::
|
||||
Use ``uv run`` to run the development version of the tool::
|
||||
|
||||
pipenv shell
|
||||
|
||||
Within the virtual environment running ``sqlite-utils`` should run your locally editable version of the tool. You can use ``which sqlite-utils`` to confirm that you are running the version that lives in your virtual environment.
|
||||
uv run sqlite-utils --help
|
||||
|
||||
.. _contributing_tests:
|
||||
|
||||
Running the tests
|
||||
=================
|
||||
|
||||
To install the dependencies and test dependencies::
|
||||
Use ``uv run`` to run the tests::
|
||||
|
||||
pip install -e '.[test]'
|
||||
|
||||
To run the tests::
|
||||
|
||||
pytest
|
||||
uv run pytest
|
||||
|
||||
.. _contributing_docs:
|
||||
|
||||
Building the documentation
|
||||
==========================
|
||||
|
||||
To build the documentation, first install the documentation dependencies::
|
||||
To build the documentation run this command::
|
||||
|
||||
pip install -e '.[docs]'
|
||||
uv run make livehtml --directory docs
|
||||
|
||||
Then run ``make livehtml`` from the ``docs/`` directory to start a server on port 8000 that will serve the documentation and live-reload any time you make an edit to a ``.rst`` file::
|
||||
|
||||
cd docs
|
||||
make livehtml
|
||||
This will start a server on port 8000 that will serve the documentation and live-reload any time you make an edit to a ``.rst`` file.
|
||||
|
||||
The `cog <https://github.com/nedbat/cog>`__ tool is used to maintain portions of the documentation. You can run it like so::
|
||||
|
||||
cog -r docs/*.rst
|
||||
uv run cog -r docs/*.rst
|
||||
|
||||
.. _contributing_linting:
|
||||
|
||||
Linting and formatting
|
||||
======================
|
||||
|
||||
``sqlite-utils`` uses `Black <https://black.readthedocs.io/>`__ for code formatting, and `flake8 <https://flake8.pycqa.org/>`__ and `mypy <https://mypy.readthedocs.io/>`__ for linting and type checking.
|
||||
``sqlite-utils`` uses `Black <https://black.readthedocs.io/>`__ for code formatting, and `flake8 <https://flake8.pycqa.org/>`__ and `mypy <https://mypy.readthedocs.io/>`__ for linting and type checking::
|
||||
|
||||
Black is installed as part of ``pip install -e '.[test]'`` - you can then format your code by running it in the root of the project::
|
||||
uv run black .
|
||||
|
||||
black .
|
||||
Linting tools can be run like this::
|
||||
|
||||
To install ``mypy`` and ``flake8`` run the following::
|
||||
|
||||
pip install -e '.[flake8,mypy]'
|
||||
|
||||
Both commands can then be run in the root of the project like this::
|
||||
|
||||
flake8
|
||||
mypy sqlite_utils
|
||||
uv run flake8
|
||||
uv run mypy sqlite_utils
|
||||
|
||||
All three of these tools are run by our CI mechanism against every commit and pull request.
|
||||
|
||||
.. _contributing_just:
|
||||
|
||||
Using Just and uv
|
||||
=================
|
||||
Using Just
|
||||
==========
|
||||
|
||||
If you install `Just <https://github.com/casey/just>`__ and `uv <https://github.com/astral-sh/uv>`__ you can use them to manage your local development environment.
|
||||
If you install `Just <https://github.com/casey/just>`__ you can use it to manage your local development environment.
|
||||
|
||||
To run all of the tests and linters::
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue