Skip to content

Commit d507b19

Browse files
Merge pull request #4 from project-delphi/fix/add-httpx-dependency
Update formatting to include all Python files
2 parents 3cd07ed + d99ca21 commit d507b19

File tree

5 files changed

+54
-29
lines changed

5 files changed

+54
-29
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,17 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25+
pip install -r requirements.txt
2526
pip install -e .
26-
pip install pytest pytest-cov black isort
2727
2828
- name: Check formatting with black
2929
run: |
30-
black --check anomaly_detection/ tests/
30+
black --check .
3131
3232
- name: Check import sorting with isort
3333
run: |
34-
isort --check-only anomaly_detection/ tests/
34+
isort --check-only .
3535
3636
- name: Run tests with coverage
3737
run: |
38-
pytest tests/ --cov=anomaly_detection --cov-report=xml -v
39-
40-
- name: Upload coverage to Codecov
41-
uses: codecov/codecov-action@v4
42-
with:
43-
file: ./coverage.xml
44-
fail_ci_if_error: true
38+
pytest tests/ --cov=anomaly_detection -v

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: check-yaml
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: check-added-large-files
10+
11+
- repo: https://github.com/psf/black
12+
rev: 24.1.1
13+
hooks:
14+
- id: black
15+
language_version: python3.9
16+
17+
- repo: https://github.com/pycqa/isort
18+
rev: 5.13.2
19+
hooks:
20+
- id: isort
21+
args: ["--profile", "black"]
22+
23+
- repo: https://github.com/pre-commit/pre-commit-hooks
24+
rev: v4.5.0
25+
hooks:
26+
- id: no-commit-to-branch
27+
args: [--branch, main]

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
.PHONY: install test lint format check-format check-imports clean
1+
.PHONY: install test lint format check-format check-imports clean setup-pre-commit
22

33
install:
44
pip install -e .
5-
pip install pytest pytest-cov black isort
5+
pip install pytest pytest-cov black isort pre-commit
6+
7+
setup-pre-commit:
8+
pre-commit install
69

710
test:
811
pytest tests/ --cov=anomaly_detection --cov-report=term-missing -v
912

1013
lint:
11-
black --check anomaly_detection/ tests/
12-
isort --check-only anomaly_detection/ tests/
14+
black --check .
15+
isort --check-only .
1316

1417
format:
15-
black anomaly_detection/ tests/
16-
isort anomaly_detection/ tests/
18+
black .
19+
isort .
1720

1821
check-format:
19-
black --check anomaly_detection/ tests/
22+
black --check .
2023

2124
check-imports:
22-
isort --check-only anomaly_detection/ tests/
25+
isort --check-only .
2326

2427
clean:
2528
find . -type d -name "__pycache__" -exec rm -r {} +
@@ -32,4 +35,4 @@ clean:
3235
find . -type d -name ".pytest_cache" -exec rm -r {} +
3336
find . -type d -name ".coverage" -exec rm -r {} +
3437
find . -type d -name "htmlcov" -exec rm -r {} +
35-
find . -type f -name "coverage.xml" -delete
38+
find . -type f -name "coverage.xml" -delete

requirements.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
numpy>=1.21.0
2-
pandas>=1.3.0
3-
scikit-learn>=0.24.2
1+
black>=21.7b0
42
boto3>=1.26.0
53
fastapi>=0.68.0
6-
uvicorn>=0.15.0
4+
flake8>=3.9.2
5+
httpx>=0.24.0
6+
isort>=5.9.3
7+
numpy>=1.21.0
8+
pandas>=1.3.0
9+
pre-commit>=3.6.0
710
python-dotenv>=0.19.0
811
pytest>=6.2.5
912
pytest-cov>=2.12.1
10-
black>=21.7b0
11-
isort>=5.9.3
12-
flake8>=3.9.2
13-
httpx>=0.24.0
13+
scikit-learn>=0.24.2
14+
uvicorn>=0.15.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import find_packages, setup
22

33
setup(
44
name="anomaly_detection",
@@ -16,4 +16,4 @@
1616
"pytest-cov>=2.12.0",
1717
],
1818
python_requires=">=3.8",
19-
)
19+
)

0 commit comments

Comments
 (0)