Skip to content

Commit 8d5fe60

Browse files
authored
Merge pull request #3 from AlteredCoder/add_uv_and_precommit
Add UV and pre-commit
2 parents 2478675 + 5dd700a commit 8d5fe60

File tree

7 files changed

+377
-11
lines changed

7 files changed

+377
-11
lines changed

.github/workflows/pylint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Pylint
22

3-
on: [push]
3+
on:
4+
push:
5+
branch: main
6+
pull_request:
7+
paths:
8+
- "**.py"
9+
- ".github/workflows/pytest.yml"
10+
411

512
jobs:
613
lint:

.github/workflows/pytest.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
name: Tests
22

3-
on: [push]
3+
on:
4+
push:
5+
branch: main
6+
pull_request:
7+
paths:
8+
- "**.py"
9+
- ".github/workflows/pytest.yml"
410

511
jobs:
612
tests:
13+
strategy:
14+
matrix:
15+
python-version:
16+
- "3.11"
17+
- "3.12"
18+
- "3.13"
719
runs-on: ubuntu-latest
820
steps:
921
- uses: actions/checkout@v4
10-
- name: Set up Python
11-
uses: actions/setup-python@v5
12-
with:
13-
python-version: '3.11'
14-
- name: Install requirements.txt
15-
run: |
16-
pip install -r requirements.txt
17-
pip install pytest pytest-cov
22+
- name: Install UV
23+
run: astral-sh/setup-uv@v5
24+
python-version: ${{ matrix.python-version }}
25+
- uses: astral-sh/ruff-action@v3
1826
- name: Run the tests
1927
run: pytest --cov --cov-report=json:coverage.json tests/
2028
- name: Extract coverage

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- repo: https://github.com/astral-sh/uv-pre-commit
2+
rev: 0.5.18
3+
hooks:
4+
- id: uv-lock
5+
- id: ruff
6+
args: [ --fix ]
7+
- id: ruff-format

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

lib/pyclamd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def __init__(self, filename=None, timeout=None):
693693

694694
# try to get unix socket from clamd.conf
695695
if filename is None:
696-
for clamdpath in ["/etc/clamav/clamd.conf", "/etc/clamd.conf"]:
696+
for clamdpath in ["/etc/clamav/clamd.conf", "/etc/clamd.conf", "/opt/homebrew/etc/clamav/clamd.conf"]:
697697
if os.path.isfile(clamdpath):
698698
break
699699
else:

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "pyclamav"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.11"
7+
dependencies = [
8+
"dateparser>=1.2.0",
9+
"logging>=0.4.9.6",
10+
"pyclamd>=0.4.0",
11+
"pydantic>=2.10.5",
12+
"pytest>=8.3.4",
13+
"python-json-logger>=3.2.1",
14+
"ruff>=0.9.1",
15+
]

uv.lock

Lines changed: 328 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)