Skip to content

Commit dfc2570

Browse files
committed
update pre-commit and ga workflows to be consistent with mesa
1 parent f9f7d6a commit dfc2570

File tree

5 files changed

+90
-13
lines changed

5 files changed

+90
-13
lines changed

.codespellignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
hist
2+
hart
3+
mutch
4+
ist
5+
inactivate
6+
ue
7+
fpr
8+
falsy

.github/workflows/build_lint.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ jobs:
2020
fail-fast: False
2121
matrix:
2222
os: [windows, ubuntu, macos]
23-
python-version: ["3.11"]
23+
python-version: ["3.12"]
2424
include:
25+
- os: ubuntu
26+
python-version: "3.11"
2527
- os: ubuntu
2628
python-version: "3.10"
2729
- os: ubuntu
@@ -54,24 +56,23 @@ jobs:
5456
runs-on: ubuntu-latest
5557
steps:
5658
- uses: actions/checkout@v4
57-
- name: Set up Python 3.10
59+
- name: Set up Python 3.12
5860
uses: actions/setup-python@v5
5961
with:
60-
python-version: "3.10"
61-
- run: pip install ruff==0.0.254
62+
python-version: "3.12"
63+
- run: pip install ruff==0.1.5
6264
- name: Lint with ruff
63-
# Include `--format=github` to enable automatic inline annotations.
6465
# Use settings from pyproject.toml.
65-
run: ruff . --format=github
66+
run: ruff .
6667

6768
lint-black:
6869
runs-on: ubuntu-latest
6970
steps:
7071
- uses: actions/checkout@v4
71-
- name: Set up Python 3.10
72+
- name: Set up Python 3.12
7273
uses: actions/setup-python@v5
7374
with:
74-
python-version: "3.10"
75+
python-version: "3.12"
7576
- run: pip install black[jupyter]
7677
- name: Lint with black
7778
run: black --check .

.github/workflows/codespell.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release**
8+
pull_request:
9+
10+
jobs:
11+
codespell:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: codespell-project/actions-codespell@master
16+
with:
17+
ignore_words_file: .codespellignore
18+
skip: .*bootstrap.*,*.js,.*bootstrap-theme.css.map

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- release**
7+
paths-ignore:
8+
- '**.md'
9+
- '**.rst'
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
- '**.rst'
14+
workflow_dispatch:
15+
16+
permissions:
17+
id-token: write
18+
19+
jobs:
20+
release:
21+
name: Deploy release to PyPI
22+
runs-on: ubuntu-latest
23+
permissions:
24+
id-token: write
25+
steps:
26+
- name: Checkout source
27+
uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: "3.12"
32+
- name: Install dependencies
33+
run: pip install -U pip build wheel setuptools
34+
- name: Build distributions
35+
run: python -m build
36+
- name: Upload package as artifact to GitHub
37+
if: github.repository == 'projectmesa/mesa-geo' && startsWith(github.ref, 'refs/tags')
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: package
41+
path: dist/
42+
- name: Publish package to PyPI
43+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
44+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ ci:
33
autofix_prs: false
44

55
repos:
6-
- repo: https://github.com/psf/black
7-
rev: 23.12.1
8-
hooks:
9-
- id: black-jupyter
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
# Ruff version.
8+
rev: v0.1.5
9+
hooks:
10+
# Run the linter.
11+
- id: ruff
12+
types_or: [ python, pyi, jupyter ]
13+
# Run the formatter.
14+
- id: ruff-format
15+
types_or: [ python, pyi, jupyter ]
1016
- repo: https://github.com/asottile/pyupgrade
1117
rev: v3.15.0
1218
hooks:
@@ -17,4 +23,4 @@ repos:
1723
hooks:
1824
- id: trailing-whitespace
1925
- id: check-toml
20-
- id: check-yaml
26+
- id: check-yaml

0 commit comments

Comments
 (0)