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
25 changes: 18 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ repos:
args: [--autofix, --trailing-commas]
- id: pretty-format-yaml
args: [--autofix]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: 9339507e9522e953c07479c9f6abeec0f2fe4e12 # frozen: v3.2.0
hooks:
- id: setup-cfg-fmt
args: [--min-py-version, '3.12']
- repo: https://github.com/asottile/reorder-python-imports
rev: 7885866bd38c852b5e042c4aeef0285d715ffeee # frozen: v3.16.0
hooks:
- id: reorder-python-imports
args: [--py312-plus, --add-import, from __future__ import annotations]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 22f0422809455ec89ffdcf5a00170ba816e42ddb # frozen: v0.15.16
rev: 3b3f7c3f57fe9925356faf5fe6230835138be230 # frozen: v0.15.17
hooks:
- id: ruff-check
args: [--fix]
Expand Down Expand Up @@ -58,8 +53,24 @@ repos:
- setuptools
- tenacity
language_version: python3.12
- repo: https://github.com/mxr/mirrors-ty
rev: b0cc809b854427130bbdc84b922e0e38c6c6b8eb # frozen: v0.0.48
hooks:
- id: ty
additional_dependencies:
- aiohttp>=3
- aiopathlib
- aiosqlite
- asyncio-for-ynab~=1.84.0
- coverage
- fasteners
- pytest
- pytest-asyncio
- rich>=10
- setuptools
- tenacity
- repo: https://github.com/mxr/sync-typing-deps
rev: 8e97e35c846b35976c59b973cd40690152b3c716 # frozen: v0.4.0
rev: 34b664ec01850e0d9cb4fe97c1a03d8ed71f393c # frozen: v0.5.0
hooks:
- id: sync-typing-deps
- repo: https://github.com/zizmorcore/zizmor-pre-commit
Expand Down
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[dependency-groups]
dev = [
"covdefaults>=2.1.0",
"coverage",
"pytest",
"pytest-asyncio",
]

[project]
authors = [{name = "Max R", email = "mxr@users.noreply.github.com"}]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"aiohttp>=3",
"aiopathlib",
"aiosqlite",
"asyncio-for-ynab~=1.84.0",
"fasteners",
"rich>=10",
"tenacity",
]
description = "SQLite Export for YNAB - Export YNAB Data to SQLite"
keywords = ["ynab", "sqlite", "sql", "budget", "plan", "cli"]
license = "MIT"
license-files = ["LICENSE"]
name = "sqlite_export_for_ynab"
readme = "README.md"
requires-python = ">=3.12"
version = "2.9.0"

[project.scripts]
sqlite-export-for-ynab = "sqlite_export_for_ynab._main:main"

[project.urls]
Homepage = "https://github.com/mxr/sqlite-export-for-ynab"

[tool.coverage.run]
plugins = ["covdefaults"]

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
Expand Down Expand Up @@ -34,6 +77,13 @@ extend-select = [
"TC", # see flake8-type-checking
]

[tool.setuptools.package-data]
"*" = ["*.sql"]
sqlite_export_for_ynab = ["py.typed"]

[tool.setuptools.packages]
find = {}

[tool.sqlfluff.layout.type.comma]
line_position = "leading"
spacing_before = "touch"
Expand Down Expand Up @@ -65,3 +115,19 @@ require_final_semicolon = true

[tool.sqlfluff.rules.references.quoting]
prefer_quoted_keywords = true

[tool.tox]
env_list = ["py", "pypy3", "pre-commit"]

[tool.tox.env.pre-commit]
commands = [["pre-commit", "run", "--all-files", "--show-diff-on-failure"]]
deps = ["pre-commit-uv"]
skip_install = true

[tool.tox.env_run_base]
commands = [
["coverage", "erase"],
["coverage", "run", "-m", "pytest", "{posargs:tests}"],
["coverage", "report"],
]
dependency_groups = ["dev"]
66 changes: 0 additions & 66 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

8 changes: 4 additions & 4 deletions tests/_main_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from configparser import ConfigParser
import tomllib
from pathlib import Path
from unittest.mock import AsyncMock
from unittest.mock import Mock
Expand Down Expand Up @@ -875,9 +875,9 @@ async def test_async_main_parses_full_refresh_and_quiet(sync, tmp_path, monkeypa


def test_main_version(capsys):
cp = ConfigParser()
cp.read(Path(__file__).parent.parent / "setup.cfg")
expected_version = cp["metadata"]["version"]
with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as f:
data = tomllib.load(f)
expected_version = data["project"]["version"]

with pytest.raises(SystemExit) as excinfo:
main(("--version",))
Expand Down
Loading