Skip to content

Commit

Permalink
Add infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessel Bruinsma committed Jul 24, 2024
1 parent 1643b8a commit 59f2a2f
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
pull_request:

push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["3.9", "3.10", "3.11"]

name: Test with Python ${{ matrix.version }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade --no-cache-dir -e '.[dev]'
- name: Run tests
run: |
pytest -v --cov=aurora --cov-report term-missing
17 changes: 17 additions & 0 deletions .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check formatting

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"

- uses: pre-commit/[email protected]
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Autogenerated files
aurora/_version.py

# Byte-compiled files
*.pyc

# Virtual environments
venv
.tox

# Packaging
*.egg-info
dist
pip-wheel-metadata

# Documentation and coverage
docs/_build
docs/_static
docs/source
docs/readme.rst
cover

# Other
.DS_Store
*.swp
.envrc
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ci:
autoupdate_commit_msg: "chore: Update pre-commit hooks"
autofix_commit_msg: "style: Pre-commit fixes"

default_language_version:
python: python3.9

repos:
- repo: meta
hooks:
- id: check-useless-excludes

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.1"
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi]
args: ["--fix", "--show-fixes"]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
Empty file added aurora/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions aurora/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
print("Hello world!")
15 changes: 6 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
{name = "Richard E. Turner", email = "[email protected]"},
{name = "Paris Perdikaris", email = "[email protected]"},
]
license = {text = "MIT"}
license = {text = "MIT", file = "LICENCE.txt"}
readme = "README.md"
keywords = [
"aurora model",
Expand All @@ -31,22 +31,19 @@ classifiers = [
]
dynamic = ["version"]

requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
]

[project.optional-dependencies]
dev = [
"numpy",
"pytest",
"pytest-cov",
"coveralls",
"pre-commit",
"ghp-import",
"wheel",
"build",
"pytest",
"pytest-cov",
"mypy",
"ruff",
"ruff==0.4.1",
"pre-commit",
]

[project.urls]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test():
assert 1 == 1

0 comments on commit 59f2a2f

Please sign in to comment.