Skip to content

Commit

Permalink
Merge pull request #270 from RoseauTechnologies/rye
Browse files Browse the repository at this point in the history
Use Rye intead of Poetry
  • Loading branch information
benoit9126 authored Oct 14, 2024
2 parents 2946f26 + 6e2d6cf commit 4adf9c1
Show file tree
Hide file tree
Showing 9 changed files with 373 additions and 2,339 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:

env:
CI: true
UV_SYSTEM_PYTHON: 1

jobs:
build:
Expand Down Expand Up @@ -49,24 +50,24 @@ jobs:
git lfs pull
git lfs prune --verify-remote
- name: Install poetry
run: pipx install poetry
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "requirements**.lock"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

- name: Install dependencies
run: |
poetry env use "${{ matrix.python-version }}"
poetry install --without dev
uv pip install -r requirements-dev.lock
- name: Test with pytest
run: |
poetry run pytest -vv -n=auto --durations=25 --cov-report html \
--cov-config pyproject.toml roseau
pytest -vv -n=auto --durations=25 --cov-report html --cov-config pyproject.toml roseau
env:
ROSEAU_LOAD_FLOW_LICENSE_KEY: ${{ secrets.ROSEAU_LOAD_FLOW_LICENSE_KEY }}

Expand Down
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
- id: poetry-check
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.6.8
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.18.0
hooks:
Expand Down
10 changes: 5 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_create_environment:
- python -m pip install poetry
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only doc

sphinx:
configuration: doc/conf.py

python:
install:
- requirements: requirements-dev.lock
1 change: 1 addition & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ og:description: See what's new in the latest release of Roseau Load Flow !

## Unreleased

- {gh-pr}`270` Use [Rye](https://rye.astral.sh/) instead of [Poetry](https://python-poetry.org/) as dependency manager.
- {gh-pr}`269` Optimize the SVG files of the documentation.
- {gh-pr}`268` Set up ReadTheDoc to automatically compile the documentation.
- {gh-pr}`267` Add a section in the documentation on Google Colab secrets.
Expand Down
2,247 changes: 0 additions & 2,247 deletions poetry.lock

This file was deleted.

142 changes: 70 additions & 72 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
[tool.poetry]
[project]
name = "roseau-load-flow"
version = "0.10.0"
description = "Highly capable three-phase load flow solver"
authors = [
"Ali Hamdan <ali.hamdan@roseautechnologies.com>",
"Sébastien Vallet <sebastien.vallet@roseautechnologies.com>",
"Benoît Vinot <benoit.vinot@roseautechnologies.com>",
"Florent Cadoux <florent.cadoux@roseautechnologies.com>",
"Louise Muller <louise.muller@roseautechnologies.com>",
"Victor Gouin",
{ name = "Ali Hamdan", email = "ali.hamdan@roseautechnologies.com" },
{ name = "Sébastien Vallet", email = "sebastien.vallet@roseautechnologies.com" },
{ name = "Benoît Vinot", email = "benoit.vinot@roseautechnologies.com" },
{ name = "Florent Cadoux", email = "florent.cadoux@roseautechnologies.com" },
{ name = "Louise Muller", email = "louise.muller@roseautechnologies.com" },
{ name = "Victor Gouin" },
]
maintainers = ["Ali Hamdan <ali.hamdan@roseautechnologies.com>"]
license = "BSD-3-Clause"
repository = "https://github.com/RoseauTechnologies/Roseau_Load_Flow/"
readme = "README.md"
include = [
"roseau/load_flow/data/**/*.json",
"roseau/load_flow/data/**/*.csv"
]
exclude = [
"**/tests/**",
"**/conftest.py",
]
packages = [
{ include = "roseau/load_flow" }
maintainers = [
{ name = "Ali Hamdan", email = "ali.hamdan@roseautechnologies.com" },
]
license = { file = "LICENSE.md" }
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
# "License :: OSI Approved :: The 3-Clause BSD License (BSD-3-Clause)", # https://github.com/pypa/trove-classifiers/issues/70
Expand All @@ -37,59 +27,67 @@ classifiers = [
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.10,<4.0.0"
dependencies = [
"numpy>=1.21.5",
"pandas>=1.4.0",
"geopandas>=1.0.0",
"shapely>=2.0.0",
"regex>=2022.1.18",
"pint>=0.21.0",
"typing-extensions>=4.6.2",
"pyproj>=3.3.0",
"certifi>=2023.5.7",
"platformdirs>=4.0.0",
"roseau-load-flow-engine==0.15.0",
]

[project.urls]
homepage = "https://www.roseautechnologies.com/roseau-load-flow/"
repository = "https://github.com/RoseauTechnologies/Roseau_Load_Flow/"
issues = "https://github.com/RoseauTechnologies/Roseau_Load_Flow/issues/"
documentation = "https://roseau-load-flow.roseautechnologies.com/"


[project.optional-dependencies]
plot = ["matplotlib>=3.7.2"]
graph = ["networkx>=3.0.0"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = "^3.10"
numpy = ">=1.21.5"
pandas = ">=1.4.0"
geopandas = ">=1.0.0"
shapely = ">=2.0.0"
regex = ">=2022.1.18"
pint = ">=0.21.0"
typing-extensions = ">=4.6.2"
pyproj = ">=3.3.0"
certifi = ">=2023.5.7"
platformdirs = ">=4.0.0"
roseau-load-flow-engine = "==0.15.0"

# Optional dependencies
matplotlib = { version = ">=3.7.2", optional = true }
networkx = { version = ">=3.0.0", optional = true }

[tool.poetry.extras]
# DO NOT forget to update the installation page in the documentation when extras change
plot = ["matplotlib"]
graph = ["networkx"]

[tool.poetry.group.test.dependencies]
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-xdist = "^3.1.0"
coverage = { version = "^7.0.5", extras = ["toml"] }
coverage-conditional-plugin = ">=0.9.0"
matplotlib = ">=3.7.2"
networkx = ">=3.0.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.0.0"
ruff = ">=0.6.0"

[tool.poetry.group.doc.dependencies]
sphinx = "^8.0.2"
myst-parser = ">=0.16.1"
sphinx-math-dollar = "^1.2.1"
sphinx-autoapi = "^3.0.0"
sphinx-copybutton = ">=0.5.1"
sphinx-inline-tabs = ">=2022.1.2b11"
furo = ">=2022.9.29"
sphinxcontrib-googleanalytics = ">=0.3"
sphinxcontrib-bibtex = "^2.5.0"
sphinx-sitemap = "^2.5.1"
sphinxext-opengraph = ">=0.9.1"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
only-include = ["roseau"]
exclude = ["*tests*", "*conftest.py"]

[tool.hatch.build.targets.wheel]
packages = ["roseau"]


[tool.rye]
managed = true
universal = true
dev-dependencies = [
# Tests
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.1.0",
"coverage[toml]>=7.0.5",
"coverage-conditional-plugin>=0.9.0",
# Docs
"sphinx>=8.0.2",
"myst-parser>=0.16.1",
"sphinx-math-dollar>=1.2.1",
"sphinx-autoapi>=3.0.0",
"sphinx-copybutton>=0.5.1",
"sphinx-inline-tabs>=2022.1.2b11",
"furo>=2022.9.29",
"sphinxcontrib-googleanalytics>=0.3",
"sphinxcontrib-bibtex>=2.5.0",
"sphinx-sitemap>=2.5.1",
"sphinxext-opengraph>=0.9.1",
]

[tool.ruff]
line-length = 120
Expand Down
Loading

0 comments on commit 4adf9c1

Please sign in to comment.