Skip to content

Automate pre commit updates #322

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

Merged
merged 4 commits into from
May 2, 2024
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
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ on:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run lint
uses: pre-commit/action@v3.0.0

test:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/CausalPy*.tar.gz
venv-sdist/bin/python -m pip install ../dist/causalpy*.tar.gz
echo "Checking import and version number (on release)"
venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
cd ..
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
ci:
autofix_prs: false

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: debug-statements
- id: trailing-whitespace
exclude_types: [svg]
- id: end-of-file-fixer
exclude_types: [svg]
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1500']
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.4
args: ["--maxkb=1500"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
hooks:
- id: ruff
args: ["--fix", "--output-format=full"]
- id: ruff-format
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.8.5
hooks:
- id: nbqa-ruff
- repo: https://github.com/econchick/interrogate
Expand Down
1 change: 1 addition & 0 deletions causalpy/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Code for loading datasets."""

from .datasets import load_data

__all__ = ["load_data"]
1 change: 1 addition & 0 deletions causalpy/data/datasets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions to load example datasets
"""

import pathlib

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions causalpy/data/simulate_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Functions that generate data sets used in examples
"""

import numpy as np
import pandas as pd
from scipy.stats import dirichlet, gamma, norm, uniform
Expand Down
1 change: 1 addition & 0 deletions causalpy/skl_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- DifferenceInDifferences
- RegressionDiscontinuity
"""

import warnings
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions causalpy/skl_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Weighted Proportion

"""

from functools import partial

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions causalpy/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Functions:
* rng: random number generator with session level scope
"""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions causalpy/tests/test_data_loading.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests that example data can be loaded into data frames.
"""

import pandas as pd
import pytest

Expand Down
1 change: 1 addition & 0 deletions causalpy/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utility functions
"""

import numpy as np
import pandas as pd

Expand Down
Loading