-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore!: migrate to poetry * chore: reformat project using ruff only * chore: set up git blame ignore revs * chore: update actions to use poetry * chore: remove requirements.*.txt files
- Loading branch information
1 parent
e6e7339
commit 3393270
Showing
83 changed files
with
1,398 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Migrate to ruff | ||
73c58b02ea964d62b44b3ded3a33828aaa505910 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,195 +1,50 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
[tool.poetry] | ||
name = "adventofcode" | ||
dynamic = ["version"] | ||
version = "1.10.0" | ||
description = "A collection of Advent of Code solutions" | ||
readme = "README.md" | ||
requires-python = ">=3.11" | ||
authors = ["Marcel Blijleven <[email protected]>"] | ||
license = "MIT" | ||
keywords = [] | ||
authors = [ | ||
{ name = "Marcel Blijleven", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"rich>=10", | ||
|
||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/unknown/adventofcode#readme" | ||
Issues = "https://github.com/unknown/adventofcode/issues" | ||
Source = "https://github.com/unknown/adventofcode" | ||
|
||
[project.scripts] | ||
add-day = "adventofcode.scripts.add_day:add_day" | ||
clean-repo = "adventofcode.scripts.clean_repo:clean_repo" | ||
generate-benchmarks = "adventofcode.scripts.benchmarks:generate_benchmarks" | ||
generate-readme = "adventofcode.scripts.generate_readme:generate_readme" | ||
run-all = "adventofcode.scripts.runner:run_all" | ||
|
||
|
||
[tool.hatch.version] | ||
path = "src/adventofcode/__about__.py" | ||
|
||
[tool.hatch.envs.default] | ||
dependencies = [ | ||
"httpx", | ||
"coverage[toml]>=6.5", | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-mock>=3.10", | ||
] | ||
[tool.hatch.envs.default.scripts] | ||
test = "pytest {args:tests}" | ||
test-cov = "coverage run -m pytest --cov {args:tests} " | ||
cov-report = [ | ||
"- coverage combine", | ||
"coverage report", | ||
] | ||
cov = [ | ||
"test-cov", | ||
"cov-report", | ||
] | ||
|
||
[[tool.hatch.envs.all.matrix]] | ||
python = ["3.11", "3.12"] | ||
|
||
[tool.hatch.envs.lint] | ||
detached = true | ||
dependencies = [ | ||
"black>=23.1.0", | ||
"mypy>=1.0.0", | ||
"ruff>=0.0.243", | ||
] | ||
[tool.hatch.envs.lint.scripts] | ||
typing = "mypy --install-types --non-interactive {args:src/adventofcode}" | ||
style = [ | ||
"ruff {args:.}", | ||
"black --check --diff {args:.}", | ||
] | ||
fmt = [ | ||
"black {args:.}", | ||
"ruff --fix {args:.}", | ||
"style", | ||
] | ||
all = [ | ||
"style", | ||
"typing", | ||
] | ||
readme = "README.md" | ||
|
||
[tool.black] | ||
target-version = ["py311"] | ||
line-length = 120 | ||
skip-string-normalization = true | ||
[tool.poetry.dependencies] | ||
python = ">=3.11" | ||
rich = "^13.9.4" | ||
|
||
[tool.ruff] | ||
target-version = "py311" | ||
line-length = 120 | ||
select = [ | ||
"A", | ||
"ARG", | ||
"B", | ||
"C", | ||
"DTZ", | ||
"E", | ||
"EM", | ||
"F", | ||
"FBT", | ||
"I", | ||
"ICN", | ||
"ISC", | ||
"N", | ||
"PLC", | ||
"PLE", | ||
"PLR", | ||
"PLW", | ||
"Q", | ||
"RUF", | ||
"S", | ||
"T", | ||
"TID", | ||
"UP", | ||
"W", | ||
"YTT", | ||
] | ||
ignore = [ | ||
# Allow non-abstract empty methods in abstract base classes | ||
"B027", | ||
# Allow boolean positional values in function calls, like `dict.get(... True)` | ||
"FBT003", | ||
# Ignore checks for possible passwords | ||
"S105", "S106", "S107", | ||
# Ignore complexity | ||
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", | ||
# Use of magic values | ||
"PLR2004", | ||
# Use of boolean default values in function definition | ||
"FBT001", "FBT002", | ||
# Exceptions with string literals | ||
"EM101", "EM102", | ||
# Concatenated string literals on one line | ||
"ISC001", | ||
|
||
] | ||
unfixable = [ | ||
# Don't touch unused imports | ||
"F401", | ||
] | ||
[tool.poetry.group.dev.dependencies] | ||
httpx = "^0.28.0" | ||
coverage = { extras = ["toml"], version = "^7.6.8" } | ||
pytest = "^8.3.4" | ||
pytest-cov = "^6.0.0" | ||
pytest-mock = "^3.14.0" | ||
ruff = "^0.8.1" | ||
mypy = "^1.13.0" | ||
commitizen = "^4.0.0" | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
known-first-party = ["adventofcode"] | ||
|
||
[tool.ruff.flake8-tidy-imports] | ||
[tool.ruff.lint.flake8-tidy-imports] | ||
ban-relative-imports = "all" | ||
|
||
[tool.ruff.per-file-ignores] | ||
# Tests can use magic values, assertions, and relative imports | ||
"tests/**/*" = ["PLR2004", "S101", "TID252"] | ||
|
||
[tool.coverage.run] | ||
source_pkgs = ["adventofcode", "tests"] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"src/adventofcode/__about__.py", | ||
] | ||
omit = ["src/adventofcode/__about__.py"] | ||
|
||
[tool.coverage.paths] | ||
adventofcode = ["src/adventofcode", "*/adventofcode/src/adventofcode"] | ||
adventofcode = ["src/adventofcode", "*/adventofcode/arc/adventofcode"] | ||
tests = ["tests", "*/adventofcode/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
] | ||
exclude_lines = ["no cov", "if __name__ == __main__:", "if TYPE_CHECKING:"] | ||
|
||
[tool.commitizen] | ||
tag_format = "v$version" | ||
version = "1.10.0" | ||
version_files = [ | ||
"src/adventofcode/__about__.py", | ||
] | ||
version_files = ["src/adventofcode/__about__.py"] | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
"rich.console", | ||
"rich.table", | ||
"httpx", | ||
"utils", | ||
"config", | ||
] | ||
disable_error_code = ["name-defined"] | ||
ignore_missing_imports = true | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.