File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : https://github.com/astral-sh/ruff-pre-commit
3+ rev : v0.12.12
4+ hooks :
5+ - id : ruff
6+ args : [--fix]
7+ - id : ruff-format
8+ - repo : https://github.com/pre-commit/mirrors-mypy
9+ rev : v1.17.1
10+ hooks :
11+ - id : mypy
12+ args : [--ignore-missing-imports]
13+ - repo : local
14+ hooks :
15+ - id : pytest-coverage
16+ name : Tests with 80% coverage
17+ entry : python -m pytest --cov=eoapi_notifier --cov-fail-under=80 --tb=short
18+ language : system
19+ types : [python]
20+ pass_filenames : false
21+ always_run : true
Original file line number Diff line number Diff line change @@ -19,6 +19,26 @@ uv sync --extra test
1919uv run pytest
2020```
2121
22+ ## Development
23+
24+ Install development dependencies including pre-commit:
25+
26+ ``` bash
27+ uv sync --extra dev
28+ ```
29+
30+ Set up pre-commit hooks:
31+
32+ ``` bash
33+ uv run pre-commit install
34+ ```
35+
36+ Run pre-commit manually:
37+
38+ ``` bash
39+ uv run pre-commit run --all-files
40+ ```
41+
2242## License
2343
2444This project is licensed under the MIT License - see the [ LICENSE] ( LICENSE ) file for details.
Original file line number Diff line number Diff line change 55import re
66from pathlib import Path
77
8+
89def get_version ():
910 """Get version from pyproject.toml."""
1011 try :
@@ -15,10 +16,13 @@ def get_version():
1516 except Exception :
1617 return "unknown"
1718
19+
1820__version__ = get_version ()
1921
22+
2023def version ():
2124 print (f"Version: { __version__ } " )
2225
26+
2327if __name__ == "__main__" :
2428 version ()
Original file line number Diff line number Diff line change @@ -14,4 +14,10 @@ authors = [
1414[project .optional-dependencies ]
1515test = [
1616 " pytest>=8.4.2" ,
17+ " pytest-cov" ,
18+ ]
19+ dev = [
20+ " pre-commit" ,
21+ " mypy" ,
22+ " ruff" ,
1723]
Original file line number Diff line number Diff line change 66from io import StringIO
77from unittest .mock import patch
88
9- import pytest
109
1110from eoapi_notifier import get_version , version , __version__
1211
@@ -28,7 +27,7 @@ def test_version_attribute():
2827
2928def test_version_function ():
3029 """Test that version function prints expected output."""
31- with patch (' sys.stdout' , new = StringIO ()) as fake_out :
30+ with patch (" sys.stdout" , new = StringIO ()) as fake_out :
3231 version ()
3332 output = fake_out .getvalue ()
3433 assert "Version:" in output
You can’t perform that action at this time.
0 commit comments