diff --git a/pyproject.toml b/pyproject.toml index bf92800..14950ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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", @@ -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", ] @@ -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" @@ -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 = [ diff --git a/src/fasthep_logging/__init__.py b/src/fasthep_logging/__init__.py index ac7f212..c180923 100644 --- a/src/fasthep_logging/__init__.py +++ b/src/fasthep_logging/__init__.py @@ -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__", diff --git a/src/fasthep_logging/_version.pyi b/src/fasthep_logging/_version.pyi new file mode 100644 index 0000000..e232c84 --- /dev/null +++ b/src/fasthep_logging/_version.pyi @@ -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]