Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github issue templates and workflows #35

Merged
merged 1 commit into from
Sep 26, 2023
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
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/asking-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Asking for help
about: If you need help using Mesa-Viz-Tornado, you should post in https://github.com/projectmesa/mesa/discussions
---

<!--
ATTENTION: Don't raise an issue here!
If you need help, ask in https://github.com/projectmesa/mesa/discussions
-->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug report
about: Let us know if something is broken on Mesa-Viz-Tornado

---

**Describe the bug**
<!-- A clear and concise description the bug -->

**Expected behavior**
<!-- A clear and concise description of what you expected to happen -->

**To Reproduce**
<!-- Steps to reproduce the bug, or a link to a project where the bug is visible -->

**Additional context**
<!--
Add any other context here.
Any details about your specific platform:
* If the problem is in the browser, what browser, version, and OS?
-->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest a new feature for Mesa-Viz-Tornado

---

**What's the problem this feature will solve?**
<!-- A clear and concise description of what the problem is. -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Additional context**
<!-- Add any other context, links, etc. about the feature here. -->
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
77 changes: 77 additions & 0 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: build

on:
push:
branches:
- main
- release**
paths-ignore:
- '**.md'
- '**.rst'
pull_request:
paths-ignore:
- '**.md'
- '**.rst'

jobs:
build:
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: False
matrix:
os: [windows, ubuntu, macos]
python-version: ["3.11"]
include:
- os: ubuntu
python-version: "3.10"
- os: ubuntu
python-version: "3.9"
- os: ubuntu
python-version: "3.8"
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253
#- os: ubuntu
# python-version: 'pypy-3.8'

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
- name: Install dependencies
run: pip install wheel && pip install .[dev]
# - name: Test with pytest
# run: pytest --cov=mesa_viz_tornado tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
name: Codecov
uses: codecov/codecov-action@v3

lint-ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install ruff==0.0.254
- name: Lint with ruff
# Include `--format=github` to enable automatic inline annotations.
# Use settings from pyproject.toml.
run: ruff . --format=github

lint-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install black
- name: Lint with black
run: black --check .
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[tool.ruff]
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
select = [
# "ANN", # annotations TODO
"B", # bugbear
"C4", # comprehensions
"DTZ", # naive datetime
"E", # style errors
"F", # flakes
"I", # import sorting
"ISC", # string concatenation
"N", # naming
"PGH", # pygrep-hooks
"PIE", # miscellaneous
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor TODO
"PLW", # pylint warning
"Q", # quotes
"RUF", # Ruff
"S", # security
"SIM", # simplify
"T10", # debugger
"UP", # upgrade
"W", # style warnings
"YTT", # sys.version
]
# Ignore list taken from https://github.com/psf/black/blob/master/.flake8
# E203 Whitespace before ':'
# E266 Too many leading '#' for block comment
# E501 Line too long (82 > 79 characters)
# W503 Line break occurred before a binary operator
# But we don't specify them because ruff's Black already
# checks for it.
# See https://github.com/charliermarsh/ruff/issues/1842#issuecomment-1381210185
extend-ignore = [
"E501",
"S101", # Use of `assert` detected
"B017", # `assertRaises(Exception)` should be considered evil TODO
"PGH004", # Use specific rule codes when using `noqa` TODO
"B905", # `zip()` without an explicit `strict=` parameter
"N802", # Function name should be lowercase
"N999", # Invalid module name. We should revisit this in the future, TODO
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO
"S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
"S603", # `subprocess` call: check for execution of untrusted input
]
extend-exclude = ["docs", "build"]
# Hardcode to Python 3.8.
# Reminder to update mesa-examples if the value below is changed.
target-version = "py38"
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@

requires = ["tornado"]

extras_require = {
"dev": [
"black",
"ruff==0.0.275",
# "coverage",
# "pytest >= 4.6",
# "pytest-cov",
# "sphinx",
],
}

version = "0.1.1"

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

# Ensure JS dependencies are downloaded
Expand Down Expand Up @@ -105,6 +116,7 @@ def ensure_js_dep_single(url, out_name=None):
},
include_package_data=True,
install_requires=requires,
extras_require=extras_require,
keywords="agent based modeling model ABM simulation multi-agent",
license="Apache 2.0",
zip_safe=False,
Expand Down