Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split ruff and hatch configs from pyproject.toml to their own config files #36

Merged
merged 14 commits into from
Oct 15, 2024
Merged
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,3 @@ src/simple_sqlite3_orm/_version.py

# vscode config
.vscode

# local hatch config
hatch.toml
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 pga2rn

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
49 changes: 49 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[version]
source = "vcs"

[build.hooks.vcs]
version-file = "src/simple_sqlite3_orm/_version.py"

[build.targets.sdist]
exclude = [
"/.github",
"/docs",
]

[build.targets.wheel]
only-include = [
"src",
]
sources = [
"src",
]

[envs.dev_py38]
type = "virtual"
python = "3.8"
path = "./venv/hatch_venv_dev_py38"
features = ["dev"]

[envs.dev_py39]
type = "virtual"
python = "3.9"
path = "./venv/hatch_venv_dev_py39"
features = ["dev"]

[envs.dev_py310]
type = "virtual"
python = "3.10"
path = "./venv/hatch_venv_dev_py310"
features = ["dev"]

[envs.dev_py311]
type = "virtual"
python = "3.11"
path = "./venv/hatch_venv_dev_py311"
features = ["dev"]

[envs.dev_py312]
type = "virtual"
python = "3.12"
path = "./venv/hatch_venv_dev_py312"
features = ["dev"]
54 changes: 6 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ requires = [
[project]
name = "simple-sqlite3-orm"
description = "A simple yet powerful SQLite3 ORM, powered by pydantic."

readme = "README.md"
license = { text = "LICENSE.md" }
license = { file = "LICENSE" }
authors = [
{ name = "pga2rn", email = "aaronpigybd@gmail.com" },
]
requires-python = ">=3.8"
classifiers = [
"License :: OSI Approved :: Apache Software License",
Expand Down Expand Up @@ -39,27 +41,9 @@ optional-dependencies.dev = [
"pytest-mock<3.15,>=3.14",
"ruff<0.8,>=0.6",
]
urls.Source = "https://github.com/pga2rn/simple-sqlite3-orm"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/simple_sqlite3_orm/_version.py"

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/docs",
]

[tool.hatch.build.targets.wheel]
only-include = [
"src",
]
sources = [
"src",
]
urls.Source = "https://github.com/pga2rn/simple-sqlite3-orm"
urls.Tracker = "https://github.com/pga2rn/simple-sqlite3-orm/issues"

[tool.black]
line-length = 88
Expand All @@ -70,32 +54,6 @@ target-version = [
'py311',
]

[tool.ruff]
target-version = "py38"
include = [
"pyproject.toml",
"src/**/*.py",
"tests/**/*.py",
]

lint.select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"E4",
"E7",
"E9",
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"Q", # flake8-quotes
]
lint.ignore = [
"E203", # (white space before ':'): this error conflicts with black linting
"E266", # (too many leading '#'): sometimes we use multiple # for separting sections
"E701", # (multiple statements on one line)
"S101", # (use of assert): mostly we use assert for typing
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
log_auto_indent = true
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated from pyproject.toml, only for reference use!
pydantic<3,>=2.6
typing-extensions>=4
26 changes: 26 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

target-version = "py38"
include = [
"tests/**/*.py",
"src/**/*.py",
"pyproject.toml",
]

[lint]
select = [
"E4",
"E7",
"E9",
"F", # pyflakes
"Q", # flake8-quotes
"I", # isort
"B", # flake8-bugbear
"A", # flake8-builtins
"ICN", # flake8-import-conventions
]
ignore = [
"E266", # (too many leading '#'): sometimes we use multiple # for separting sections
"E203", # (white space before ':'): this error conflicts with black linting
"E701", # (multiple statements on one line)
"S101", # (use of assert): mostly we use assert for typing
]