Skip to content

Commit 2aa71fe

Browse files
author
juanitorduz
committed
init ci
1 parent 5d16fae commit 2aa71fe

File tree

8 files changed

+82
-0
lines changed

8 files changed

+82
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10"]
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Run lint
19+
run: |
20+
make init
21+
make check_lint
22+
test:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python-version: ["3.8", "3.9", "3.10"]
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Set up Python
31+
uses: actions/setup-python@v3
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Run tests
35+
run: |
36+
make init
37+
make test

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: init lint check_lint test
2+
3+
init:
4+
python -m pip install -e .
5+
6+
lint:
7+
pip install -r requirements-lint.txt
8+
isort .
9+
black .
10+
11+
check_lint:
12+
pip install -r requirements-lint.txt
13+
flake8 .
14+
isort --check-only .
15+
black --diff --check --fast .
16+
17+
test:
18+
pip install -r requirements-test.txt
19+
pytest

causalpy/tests/__init__.py

Whitespace-only changes.

causalpy/tests/test_dummy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_dummy() -> None:
2+
assert True

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[tool.isort]
2+
profile = "black"
3+
4+
[tool.pytest.ini_options]
5+
addopts = [
6+
"-v",
7+
"--strict-markers",
8+
"--strict-config",
9+
"--cov=causalpy",
10+
]
11+
testpaths = "causalpy/tests"

requirements-lint.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
black>=22.3.0
2+
flake8>=4.0.1
3+
isort>=5.10.1
4+
pre-commit>=2.19.0

requirements-test.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
3+
pytest
4+
pytest-cov

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
[metadata]
22
description-file=README.md
33
license_files=LICENSE
4+
5+
[flake8]
6+
max-line-length = 88
7+
extend-ignore = E203
8+
per-file-ignores = */__init__.py:F401,F403

0 commit comments

Comments
 (0)