Skip to content
Draft
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/claude-code-review.yml.bkp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}

# Project-specific tools for Python development
allowed_tools: "Bash(pytest),Bash(ruff check .),Bash(ruff format .),Bash(mypy .),Bash(uv pip install -e .[dev,solvers])"
allowed_tools: "Bash(pytest),Bash(ruff check .),Bash(ruff format .),Bash(mypy .),Bash(uv pip install -e .[solvers] --group dev)"

# Optional: Skip review for certain conditions
# if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# assignee_trigger: "claude-bot"

# Project-specific tools for Python development
allowed_tools: "Bash(pytest),Bash(ruff check .),Bash(ruff format .),Bash(mypy .),Bash(uv pip install -e .[dev,solvers])"
allowed_tools: "Bash(pytest),Bash(ruff check .),Bash(ruff format .),Bash(mypy .),Bash(uv pip install -e .[solvers] --group dev)"

# Custom instructions for linopy project
custom_instructions: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --system -e ".[docs]"
uv pip install --system -e . --group docs

- name: Execute notebooks
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --system "$(ls dist/*.whl)[dev,solvers,oetc]"
uv pip install --system "$(ls dist/*.whl)[solvers,oetc]" --group dev

- name: Test with pytest
env:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --system "$(ls dist/*.whl)[dev]"
uv pip install --system "$(ls dist/*.whl)" --group dev

- name: Run type checker (mypy)
run: |
Expand Down
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
- git fetch --unshallow # Needed to get version tags
python:
install:
- method: pip
path: .
extra_requirements:
- method: uv
command: sync
groups:
- docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Note that these do have to be installed by the user separately.
To set up a local development environment for linopy and to run the same tests that are run in the CI, you can run:

```sh
uv sync --extra dev --extra solvers
uv sync --group dev --extra solvers
source .venv/bin/activate
pytest
```
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Measures linopy's own performance (build time, LP write speed, memory usage) acr
## Setup

```bash
pip install -e ".[benchmarks]"
pip install -e . --group benchmarks # pip >= 25.1
# or: uv sync --group benchmarks
```

## Running benchmarks
Expand Down
18 changes: 16 additions & 2 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ To run the test suite:
.. code-block:: bash

# Install development dependencies
uv sync --extra dev --extra solvers
uv sync --group dev --extra solvers

# Run all tests
pytest
Expand All @@ -57,6 +57,20 @@ To run the test suite:
# Run a specific test function
pytest test/test_model.py::test_model_creation

The contributor toolchains (``dev``, ``docs``, ``benchmarks``) are
`PEP 735 <https://peps.python.org/pep-0735/>`_ dependency groups rather than
extras, so they are installed with ``--group`` instead of ``--extra`` and are
not reachable through the ``.[...]`` syntax. With pip, dependency groups
require **pip >= 25.1**:

.. code-block:: bash

pip install -e . --group dev # pip >= 25.1
uv sync --group dev # uv (any recent version)

The runtime extras (``solvers``, ``oetc``, ``remote``) are unaffected and are
still installed the usual way, e.g. ``pip install linopy[solvers]``.

GPU Testing
-----------

Expand Down Expand Up @@ -84,7 +98,7 @@ When working on performance-sensitive code, use the internal benchmark suite in
.. code-block:: bash

# Install benchmark dependencies
uv sync --extra benchmarks
uv sync --group benchmarks

# Quick timing benchmarks
pytest benchmarks/ --quick
Expand Down
28 changes: 15 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ oetc = [
remote = [
"paramiko",
]
solvers = [
"gurobipy",
"highspy>=1.5.0,!=1.14.0; python_version < '3.12'",
"highspy>=1.7.1,!=1.14.0; python_version >= '3.12'",
"cplex; platform_system != 'Darwin'",
"mosek",
"mindoptpy",
"coptpy!=7.2.1",
"xpress; platform_system != 'Darwin'",
"pyscipopt; platform_system != 'Darwin'",
"knitro>=15.1.0",
# "cupdlpx>=0.1.2", pip package currently unstable
]

[dependency-groups]
docs = [
"ipython==8.26.0",
"numpydoc==1.7.0",
Expand Down Expand Up @@ -88,19 +103,6 @@ benchmarks = [
"highspy>=1.7.1",
"pytest-memray",
]
solvers = [
"gurobipy",
"highspy>=1.5.0,!=1.14.0; python_version < '3.12'",
"highspy>=1.7.1,!=1.14.0; python_version >= '3.12'",
"cplex; platform_system != 'Darwin'",
"mosek",
"mindoptpy",
"coptpy!=7.2.1",
"xpress; platform_system != 'Darwin'",
"pyscipopt; platform_system != 'Darwin'",
"knitro>=15.1.0",
# "cupdlpx>=0.1.2", pip package currently unstable
]

[tool.setuptools.packages.find]
include = ["linopy"]
Expand Down
Loading