Skip to content

Commit

Permalink
build: replace black with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
kreczko committed Jun 12, 2024
1 parent 52d47fc commit 8e29907
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 11 deletions.
82 changes: 72 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = ["flit_core >=3.4"]
build-backend = "flit_core.buildapi"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"



[project]
Expand All @@ -15,7 +16,7 @@ maintainers = [
description = "Enhanced logging for the FAST-HEP toolkit"
readme = "README.md"

requires-python = ">=3.7"
requires-python = ">=3.9"

classifiers = [
"License :: OSI Approved :: BSD License",
Expand All @@ -26,17 +27,16 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 1 - Planning",
]

dynamic = ["version"]

dependencies = [
"typing_extensions >=3.7; python_version<'3.8'",
"rich >=10.12.0",
]

Expand All @@ -56,7 +56,18 @@ docs = [

[project.urls]
homepage = "https://github.com/FAST-HEP/fasthep-logging"
"Bug Tracker" = "https://github.com/FAST-HEP/fasthep-logging/issues"
Discussions = "https://github.com/FAST-HEP/fasthep-logging/discussions"
Changelog = "https://github.com/FAST-HEP/fasthep-logging/releases"


[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/fasthep_logging/_version.py"
envs.default.dependencies = [
"pytest",
"pytest-cov",
]

[tool.pytest.ini_options]
minversion = "6.0"
Expand All @@ -78,13 +89,64 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true


[tool.isort]
profile = "black"
[tool.coverage]
run.source = ["fasthep_flow"]
port.exclude_lines = [
'pragma: no cover',
'\.\.\.',
'if typing.TYPE_CHECKING:',
]


[tool.ruff]
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
extend-ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
]
src = ["src"]
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
]
exclude = []
flake8-unused-arguments.ignore-variadic-names = true
isort.required-imports = ["from __future__ import annotations"]
# Uncomment if using a _compat.typing backport
# typing-modules = ["fasthep_flow._compat.typing"]

[tool.ruff.per-file-ignores]
"tests/**" = ["T20"]
"noxfile.py" = ["T20"]


[tool.pylint]
master.py-version = "3.8"
master.ignore-paths= ["src/fasthep_logging/_version.py"]
py-version = "3.10"
ignore-paths= ["src/fasthep_logging/_version.py"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
Expand Down
2 changes: 1 addition & 1 deletion src/fasthep_logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from ._logging import DEFAULT_LOG_LEVEL, TIMING, TRACE, get_logger, getLogger

__version__ = "0.1.1"
from ._version import version as __version__

__all__ = (
"__version__",
Expand Down
5 changes: 5 additions & 0 deletions src/fasthep_logging/_version.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Type hints for the version module."""
from __future__ import annotations

version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]

0 comments on commit 8e29907

Please sign in to comment.