Skip to content

Commit c7b8c26

Browse files
authored
Merge pull request #322 from pymc-labs/automate-pre-commit-updates
Automate pre commit updates
2 parents dbaa17b + e13b919 commit c7b8c26

11 files changed

+19
-21
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@ on:
77
branches: [main]
88

99
jobs:
10-
lint:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: ["3.10", "3.11"]
15-
16-
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Run lint
23-
uses: pre-commit/action@v3.0.0
24-
2510
test:
2611
runs-on: ubuntu-latest
2712
strategy:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
mkdir -p test-sdist
2828
cd test-sdist
2929
python -m venv venv-sdist
30-
venv-sdist/bin/python -m pip install ../dist/CausalPy*.tar.gz
30+
venv-sdist/bin/python -m pip install ../dist/causalpy*.tar.gz
3131
echo "Checking import and version number (on release)"
3232
venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
3333
cd ..

.pre-commit-config.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1+
ci:
2+
autofix_prs: false
3+
14
# See https://pre-commit.com for more information
25
# See https://pre-commit.com/hooks.html for more hooks
36
repos:
47
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
8+
rev: v4.6.0
69
hooks:
10+
- id: debug-statements
711
- id: trailing-whitespace
812
exclude_types: [svg]
913
- id: end-of-file-fixer
1014
exclude_types: [svg]
1115
- id: check-yaml
1216
- id: check-added-large-files
13-
args: ['--maxkb=1500']
14-
- repo: https://github.com/charliermarsh/ruff-pre-commit
15-
rev: v0.1.4
17+
args: ["--maxkb=1500"]
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.4.2
1620
hooks:
1721
- id: ruff
22+
args: ["--fix", "--output-format=full"]
1823
- id: ruff-format
1924
- repo: https://github.com/nbQA-dev/nbQA
20-
rev: 1.7.0
25+
rev: 1.8.5
2126
hooks:
2227
- id: nbqa-ruff
2328
- repo: https://github.com/econchick/interrogate

causalpy/data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Code for loading datasets."""
2+
23
from .datasets import load_data
34

45
__all__ = ["load_data"]

causalpy/data/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions to load example datasets
33
"""
4+
45
import pathlib
56

67
import pandas as pd

causalpy/data/simulate_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions that generate data sets used in examples
33
"""
4+
45
import numpy as np
56
import pandas as pd
67
from scipy.stats import dirichlet, gamma, norm, uniform

causalpy/skl_experiments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- DifferenceInDifferences
99
- RegressionDiscontinuity
1010
"""
11+
1112
import warnings
1213
from typing import Optional
1314

causalpy/skl_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Weighted Proportion
55
66
"""
7+
78
from functools import partial
89

910
import numpy as np

causalpy/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Functions:
55
* rng: random number generator with session level scope
66
"""
7+
78
import numpy as np
89
import pytest
910

causalpy/tests/test_data_loading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests that example data can be loaded into data frames.
33
"""
4+
45
import pandas as pd
56
import pytest
67

causalpy/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Utility functions
33
"""
4+
45
import numpy as np
56
import pandas as pd
67

0 commit comments

Comments
 (0)