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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# ruff version is read from the `lint` extra in pyproject.toml
- name: ruff check
uses: astral-sh/ruff-action@v3
with:
version-file: pyproject.toml
args: check

- name: ruff format
uses: astral-sh/ruff-action@v3
with:
version-file: pyproject.toml
args: format --check

test:
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ sco.plot()
## Development

```bash
pip install -e ".[test]" mypy
pip install -e ".[test,lint]" mypy
ruff check . # lint
ruff format . # format
mypy src/pathsim_fusion # type check
pytest tests/ -v # run tests
```
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/linear_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"# Apply PathSim docs matplotlib style for consistent, theme-friendly figures\n",
"plt.style.use(\"../pathsim_docs.mplstyle\")\n",
"\n",
"from pathsim import Simulation, Connection\n",
"from pathsim.blocks import Source, Integrator, Amplifier, Adder, Scope"
"from pathsim import Connection, Simulation\n",
"from pathsim.blocks import Adder, Amplifier, Integrator, Scope, Source"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dependencies:
- ipykernel
- mypy
- pip:
- -e .[test]
- -e .[test,lint]
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ test = [
"pytest>=7.0",
"pytest-cov>=4.0",
]
# Pinned so local runs and CI apply the same default rule set
lint = [
"ruff==0.17.3",
]

[project.urls]
Homepage = "https://pathsim.org"
Expand All @@ -69,3 +73,6 @@ files = ["src/pathsim_fusion"]
python_version = "3.10"
ignore_missing_imports = true
warn_unused_ignores = true

[tool.ruff]
src = ["src", "tests"]
Loading