Skip to content

Commit 6e5e110

Browse files
committed
add github issue templates and workflows
1 parent a95d71f commit 6e5e110

File tree

7 files changed

+193
-1
lines changed

7 files changed

+193
-1
lines changed

.github/ISSUE_TEMPLATE/asking-help.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Asking for help
3+
about: If you need help using Mesa-Viz-Tornado, you should post in https://github.com/projectmesa/mesa/discussions
4+
---
5+
6+
<!--
7+
ATTENTION: Don't raise an issue here!
8+
If you need help, ask in https://github.com/projectmesa/mesa/discussions
9+
-->

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug report
3+
about: Let us know if something is broken on Mesa-Viz-Tornado
4+
5+
---
6+
7+
**Describe the bug**
8+
<!-- A clear and concise description the bug -->
9+
10+
**Expected behavior**
11+
<!-- A clear and concise description of what you expected to happen -->
12+
13+
**To Reproduce**
14+
<!-- Steps to reproduce the bug, or a link to a project where the bug is visible -->
15+
16+
**Additional context**
17+
<!--
18+
Add any other context here.
19+
Any details about your specific platform:
20+
* If the problem is in the browser, what browser, version, and OS?
21+
-->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for Mesa-Viz-Tornado
4+
5+
---
6+
7+
**What's the problem this feature will solve?**
8+
<!-- A clear and concise description of what the problem is. -->
9+
10+
**Describe the solution you'd like**
11+
<!-- A clear and concise description of what you want to happen. -->
12+
13+
**Additional context**
14+
<!-- Add any other context, links, etc. about the feature here. -->

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
# Check for updates to GitHub Actions every week
8+
interval: "weekly"

.github/workflows/build_lint.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release**
8+
paths-ignore:
9+
- '**.md'
10+
- '**.rst'
11+
pull_request:
12+
paths-ignore:
13+
- '**.md'
14+
- '**.rst'
15+
16+
jobs:
17+
build:
18+
runs-on: ${{ matrix.os }}-latest
19+
strategy:
20+
fail-fast: False
21+
matrix:
22+
os: [windows, ubuntu, macos]
23+
python-version: ["3.11"]
24+
include:
25+
- os: ubuntu
26+
python-version: "3.10"
27+
- os: ubuntu
28+
python-version: "3.9"
29+
- os: ubuntu
30+
python-version: "3.8"
31+
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253
32+
#- os: ubuntu
33+
# python-version: 'pypy-3.8'
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- uses: actions/cache@v3
42+
with:
43+
path: ~/.cache/pip
44+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
45+
- name: Install dependencies
46+
run: pip install wheel && pip install .[dev]
47+
# - name: Test with pytest
48+
# run: pytest --cov=mesa_viz_tornado tests/ --cov-report=xml
49+
- if: matrix.os == 'ubuntu'
50+
name: Codecov
51+
uses: codecov/codecov-action@v3
52+
53+
lint-ruff:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Set up Python 3.10
58+
uses: actions/setup-python@v4
59+
with:
60+
python-version: "3.10"
61+
- run: pip install ruff==0.0.254
62+
- name: Lint with ruff
63+
# Include `--format=github` to enable automatic inline annotations.
64+
# Use settings from pyproject.toml.
65+
run: ruff . --format=github
66+
67+
lint-black:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Set up Python 3.10
72+
uses: actions/setup-python@v4
73+
with:
74+
python-version: "3.10"
75+
- run: pip install black
76+
- name: Lint with black
77+
run: black --check .

pyproject.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[tool.ruff]
2+
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
3+
select = [
4+
# "ANN", # annotations TODO
5+
"B", # bugbear
6+
"C4", # comprehensions
7+
"DTZ", # naive datetime
8+
"E", # style errors
9+
"F", # flakes
10+
"I", # import sorting
11+
"ISC", # string concatenation
12+
"N", # naming
13+
"PGH", # pygrep-hooks
14+
"PIE", # miscellaneous
15+
"PLC", # pylint convention
16+
"PLE", # pylint error
17+
# "PLR", # pylint refactor TODO
18+
"PLW", # pylint warning
19+
"Q", # quotes
20+
"RUF", # Ruff
21+
"S", # security
22+
"SIM", # simplify
23+
"T10", # debugger
24+
"UP", # upgrade
25+
"W", # style warnings
26+
"YTT", # sys.version
27+
]
28+
# Ignore list taken from https://github.com/psf/black/blob/master/.flake8
29+
# E203 Whitespace before ':'
30+
# E266 Too many leading '#' for block comment
31+
# E501 Line too long (82 > 79 characters)
32+
# W503 Line break occurred before a binary operator
33+
# But we don't specify them because ruff's Black already
34+
# checks for it.
35+
# See https://github.com/charliermarsh/ruff/issues/1842#issuecomment-1381210185
36+
extend-ignore = [
37+
"E501",
38+
"S101", # Use of `assert` detected
39+
"B017", # `assertRaises(Exception)` should be considered evil TODO
40+
"PGH004", # Use specific rule codes when using `noqa` TODO
41+
"B905", # `zip()` without an explicit `strict=` parameter
42+
"N802", # Function name should be lowercase
43+
"N999", # Invalid module name. We should revisit this in the future, TODO
44+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO
45+
"S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
46+
"S603", # `subprocess` call: check for execution of untrusted input
47+
]
48+
extend-exclude = ["docs", "build"]
49+
# Hardcode to Python 3.8.
50+
# Reminder to update mesa-examples if the value below is changed.
51+
target-version = "py38"

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88

99
requires = ["tornado"]
1010

11+
extras_require = {
12+
"dev": [
13+
"black",
14+
"ruff==0.0.275",
15+
# "coverage",
16+
# "pytest >= 4.6",
17+
# "pytest-cov",
18+
# "sphinx",
19+
],
20+
}
21+
1122
version = "0.1.1"
1223

13-
with open("README.md", "r", encoding="utf-8") as fh:
24+
with open("README.md", encoding="utf-8") as fh:
1425
long_description = fh.read()
1526

1627
# Ensure JS dependencies are downloaded
@@ -105,6 +116,7 @@ def ensure_js_dep_single(url, out_name=None):
105116
},
106117
include_package_data=True,
107118
install_requires=requires,
119+
extras_require=extras_require,
108120
keywords="agent based modeling model ABM simulation multi-agent",
109121
license="Apache 2.0",
110122
zip_safe=False,

0 commit comments

Comments
 (0)