Skip to content

Commit

Permalink
switch to rye
Browse files Browse the repository at this point in the history
  • Loading branch information
carderne committed Apr 16, 2024
1 parent 5cb8e08 commit 3c839e8
Show file tree
Hide file tree
Showing 6 changed files with 515 additions and 44 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: deploy

on:
push:
tags:
Expand All @@ -15,8 +17,11 @@ jobs:
with:
python-version: '3.12'

- name: Install
run: pip install '.[dev]'
- name: Install requirements
run: pip install -r requirements.lock

- name: Install pytest
run: pip install pytest

- name: Test
run: pytest
Expand Down
13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,13 @@ Download or clone the repository and install the required packages (preferably i
```bash
git clone https://github.com/carderne/gridfinder.git
cd gridfinder
pip install -e '.[dev]'
rye sync
```

### Linting
Useful commands:
```bash
make lint
```

### Typecheck
```bash
make check
```

### Testing
```bash
make test
rye fmt
rye lint
rye run check # type check
rye run test
```
36 changes: 20 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[build-system]
requires = [
"setuptools>=65",
"wheel>=0.37.1",
"setuptools-scm[toml]>=7.0.5",
]
build-backend = "setuptools.build_meta"
[tool.rye.scripts]
check = "pyright"
test = "pytest"
ex = "./examples/test.sh"

[project]
name = "gridfinder"
Expand All @@ -15,7 +12,7 @@ requires-python = ">=3.9"
keywords = ["ntl", "electricity", "grid"]

authors = [
{name = "Chris Arderne", email="chris@rdrn.me"},
{name = "Chris Arderne", email="chris@rdrn.me"},
]

dynamic = ["version"]
Expand Down Expand Up @@ -49,28 +46,33 @@ dependencies = [
"Shapely ~= 2.0",
]

[project.optional-dependencies]
dev = [
[tool.rye]
managed = true
dev-dependencies = [
"pyright",
"pytest",
"descartes ~= 1.1.0",
"folium ~= 0.15",
"matplotlib ~= 3.8",
"pytest ~= 8.0",
"ruff ~= 0.2",
"seaborn ~= 0.13",
"jupyterlab ~= 4.1",
]

[project.urls]
homepage = "https://gridfinder.rdrn.me"
repository = "https://github.com/carderne/gridfinder"

[tool.setuptools]
include-package-data = false
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.setuptools.packages.find]
include = ["gridfinder"]
exclude = ["docs*", "tests*"]
[tool.pdm.build]
includes = ["gridfinder/"]

[tool.setuptools_scm]
[tool.pdm.version]
source = "scm"

[tool.ruff]
target-version = "py39"
Expand All @@ -96,6 +98,8 @@ select = [
known-first-party = ["gridfinder"]

[tool.pyright]
venvPath = "."
venv = ".venv"
include = ["gridfinder", "tests"]
reportMissingImports = true
reportMissingParameterType = true
Expand Down
Loading

0 comments on commit 3c839e8

Please sign in to comment.