Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install dependencies
run: |
uv pip install --group=test .
uv pip install --group=dev .

- name: Run tests with coverage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Install dependencies
run: |
uv pip install --group=test .
uv pip install --group=dev .

- name: Test with pytest
run: uv run pytest --verbose
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

- name: Install dependencies (${{ matrix.deps.label }})
run: >-
uv pip install --group=test .
uv pip install --group=dev .
"${{ matrix.deps.scipy }}"
"${{ matrix.deps.pandas }}"
"${{ matrix.deps.statsmodels }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Install dependencies
run: |
uv pip install --group=test .
uv pip install --group=dev .

- name: Install scipy prerelease
run: |
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ To build and install from source, clone this repository and install in editable

git clone https://github.com/raphaelvallat/pingouin.git
cd pingouin
uv pip install --group=test --editable .
uv pip install --group=dev --editable .

# test the package
pytest --verbose
Expand Down
26 changes: 17 additions & 9 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Code guidelines

*Before starting new code*, we highly recommend opening an issue on `GitHub <https://github.com/raphaelvallat/pingouin>`_ to discuss potential changes.

* Please follow `PEP 8 <https://peps.python.org/pep-0008/>`_ Python style guidelines. Pingouin uses `Ruff <https://github.com/astral-sh/ruff>`_ for linting and formatting. Before submitting a PR, please run the following commands from the root folder of Pingouin to sort imports and format code:
* Please follow `PEP 8 <https://peps.python.org/pep-0008/>`_ Python style guidelines. Pingouin uses `Ruff <https://github.com/astral-sh/ruff>`_ for linting and formatting. The easiest way to ensure your code is properly formatted before committing is to use the `pre-commit <https://pre-commit.com/>`_ hooks (see :ref:`pre-commit-hooks`). Alternatively, you can run the following commands manually from the root folder of Pingouin:

.. code-block:: bash

Expand All @@ -34,22 +34,30 @@ Code guidelines

$ pytest --verbose

Setting up a development environment
-------------------------------------
.. _pre-commit-hooks:

Pre-commit hooks
-----------------

Pingouin uses `uv <https://docs.astral.sh/uv/>`_ for fast dependency management. To set up a local development environment, first clone the repository and then install the package in editable mode with the test dependencies:
Pingouin uses `pre-commit <https://pre-commit.com/>`_ to automatically run Ruff linting and formatting on every commit. To set it up:

.. code-block:: bash

$ git clone https://github.com/raphaelvallat/pingouin.git
$ cd pingouin
$ uv pip install --group=test --editable .
$ uv pip install pre-commit
$ pre-commit install

To also install the development tools (Ruff), add the ``dev`` group:
Once installed, Ruff will run automatically on all staged files before each commit.

Setting up a development environment
-------------------------------------

Pingouin uses `uv <https://docs.astral.sh/uv/>`_ for fast dependency management. To set up a local development environment, first clone the repository and then install the package in editable mode with all development dependencies (testing, linting, pre-commit):

.. code-block:: bash

$ uv pip install --group=dev --group=test --editable .
$ git clone https://github.com/raphaelvallat/pingouin.git
$ cd pingouin
$ uv pip install --group=dev --editable .

Continuous Integration
-----------------------
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ extras = [

[dependency-groups]
dev = [
"pre-commit",
"ruff>=0.15.0",
]
test = [
"pytest>=6",
"pytest-cov",
# Ensure coverage is new enough for `source_pkgs`.
Expand Down
Loading