Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.env
___pycache__
*.pyc
*.egg-info/
.DS_Store

# Ignore Claude configuration
Expand Down
60 changes: 57 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[build-system]
requires = ["setuptools>=45", "wheel"]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "sfs-processor"
version = "0.1.0"
description = "Swedish legal document processor"
version = "1.0.0"
description = "Konvertera svensk författningssamling (SFS) från JSON till Markdown och andra format"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{name = "Martin Rimskog", email = "martin@marca.se"},
]
dependencies = [
"requests>=2.25.0",
"pyyaml>=6.0",
Expand All @@ -21,6 +24,52 @@ test = [
"pytest-mock>=3.12.0",
"requests-mock>=1.11.0",
]
dev = [
"ruff>=0.1.0",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"requests-mock>=1.11.0",
]

[project.scripts]
sfs-processor = "sfs_processor:main"

[tool.setuptools]
py-modules = ["sfs_processor"]

[tool.setuptools.packages.find]
where = ["."]
include = ["formatters*", "exporters*", "temporal*", "downloaders*", "util*", "scripts*"]
exclude = ["test*", "logs*", "data*", "reports*", "output*", "sfs_docs*"]

[tool.ruff]
line-length = 120
target-version = "py310"

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]

[tool.ruff.lint.isort]
known-first-party = ["formatters", "exporters", "temporal", "util", "downloaders"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports in __init__ files
"test_*.py" = ["ARG"] # unused arguments in tests

[tool.pytest.ini_options]
# Test discovery
Expand Down Expand Up @@ -52,6 +101,7 @@ markers = [

# Coverage settings
[tool.coverage.run]
branch = true
source = ["."]
omit = [
"test/*",
Expand All @@ -60,6 +110,9 @@ omit = [
"*/site-packages/*",
".venv/*",
"venv/*",
"sfs_docs/*",
"SFS/*",
"output/*",
]

[tool.coverage.report]
Expand All @@ -70,4 +123,5 @@ exclude_lines = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
]