|
| 1 | +[build-system] |
| 2 | +requires = ["hatchling", "hatch-vcs"] |
| 3 | +build-backend = "hatchling.build" |
| 4 | + |
| 5 | +[project] |
| 6 | +name = "DIRACCommon" |
| 7 | +description = "Stateless utilities extracted from DIRAC for use by DiracX and other projects" |
| 8 | +readme = "README.md" |
| 9 | +requires-python = ">=3.11" |
| 10 | +license = {text = "GPL-3.0-only"} |
| 11 | +authors = [ |
| 12 | + {name = "DIRAC Collaboration", email = "dirac-dev@cern.ch"}, |
| 13 | +] |
| 14 | +classifiers = [ |
| 15 | + "Development Status :: 5 - Production/Stable", |
| 16 | + "Intended Audience :: Science/Research", |
| 17 | + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", |
| 18 | + "Programming Language :: Python :: 3", |
| 19 | + "Topic :: Scientific/Engineering", |
| 20 | + "Topic :: System :: Distributed Computing", |
| 21 | +] |
| 22 | +dependencies = [ |
| 23 | + "typing-extensions>=4.0.0", |
| 24 | +] |
| 25 | +dynamic = ["version"] |
| 26 | + |
| 27 | +[project.optional-dependencies] |
| 28 | +testing = [ |
| 29 | + "pytest>=7.0.0", |
| 30 | + "pytest-cov>=4.0.0", |
| 31 | +] |
| 32 | + |
| 33 | +[project.urls] |
| 34 | +Homepage = "https://github.com/DIRACGrid/DIRAC" |
| 35 | +Documentation = "https://dirac.readthedocs.io/" |
| 36 | +"Source Code" = "https://github.com/DIRACGrid/DIRAC" |
| 37 | + |
| 38 | +[tool.hatch.version] |
| 39 | +source = "vcs" |
| 40 | + |
| 41 | +[tool.hatch.version.raw-options] |
| 42 | +root = ".." |
| 43 | + |
| 44 | +[tool.hatch.build.targets.sdist] |
| 45 | +include = [ |
| 46 | + "/src", |
| 47 | + "/tests", |
| 48 | +] |
| 49 | + |
| 50 | +[tool.hatch.build.targets.wheel] |
| 51 | +packages = ["src/DIRACCommon"] |
| 52 | + |
| 53 | +[tool.pytest.ini_options] |
| 54 | +testpaths = ["tests"] |
| 55 | +python_files = "test_*.py" |
| 56 | +python_classes = "Test*" |
| 57 | +python_functions = "test_*" |
| 58 | +addopts = ["-v", "--cov=DIRACCommon", "--cov-report=term-missing"] |
| 59 | + |
| 60 | +[tool.coverage.run] |
| 61 | +source = ["src/DIRACCommon"] |
| 62 | +omit = ["*/tests/*"] |
| 63 | + |
| 64 | +[tool.coverage.report] |
| 65 | +exclude_lines = [ |
| 66 | + "pragma: no cover", |
| 67 | + "def __repr__", |
| 68 | + "raise AssertionError", |
| 69 | + "raise NotImplementedError", |
| 70 | + "if __name__ == .__main__.:", |
| 71 | + "if TYPE_CHECKING:", |
| 72 | +] |
| 73 | + |
| 74 | +[tool.mypy] |
| 75 | +python_version = "3.11" |
| 76 | +files = ["src/DIRACCommon"] |
| 77 | +strict = true |
| 78 | +warn_return_any = true |
| 79 | +warn_unused_configs = true |
| 80 | +disallow_untyped_defs = true |
| 81 | +disallow_incomplete_defs = true |
| 82 | +check_untyped_defs = true |
| 83 | +no_implicit_optional = true |
| 84 | +warn_redundant_casts = true |
| 85 | +warn_unused_ignores = true |
| 86 | +warn_no_return = true |
| 87 | +warn_unreachable = true |
| 88 | +strict_equality = true |
| 89 | + |
| 90 | +[tool.ruff] |
| 91 | +line-length = 120 |
| 92 | +target-version = "py311" |
| 93 | +select = [ |
| 94 | + "E", # pycodestyle errors |
| 95 | + "F", # pyflakes |
| 96 | + "B", # flake8-bugbear |
| 97 | + "I", # isort |
| 98 | + "PLE", # pylint errors |
| 99 | + "UP", # pyupgrade |
| 100 | +] |
| 101 | +ignore = [ |
| 102 | + "B905", # zip without explicit strict parameter |
| 103 | + "B008", # do not perform function calls in argument defaults |
| 104 | + "B006", # do not use mutable data structures for argument defaults |
| 105 | +] |
| 106 | + |
| 107 | +[tool.ruff.lint.flake8-tidy-imports.banned-api] |
| 108 | +# This ensures DIRACCommon never imports from DIRAC |
| 109 | +"DIRAC" = {msg = "DIRACCommon must not import from DIRAC to avoid global state initialization"} |
| 110 | + |
| 111 | +[tool.black] |
| 112 | +line-length = 120 |
| 113 | +target-version = ['py311'] |
| 114 | + |
| 115 | +[tool.isort] |
| 116 | +profile = "black" |
| 117 | +line_length = 120 |
| 118 | + |
| 119 | +[tool.pixi.workspace] |
| 120 | +channels = ["conda-forge"] |
| 121 | +platforms = ["linux-64", "linux-aarch64", "osx-arm64"] |
| 122 | + |
| 123 | +[tool.pixi.pypi-dependencies] |
| 124 | +DIRACCommon = { path = ".", editable = true } |
| 125 | + |
| 126 | +[tool.pixi.feature.testing.tasks.pytest] |
| 127 | +cmd = "pytest" |
| 128 | + |
| 129 | +[tool.pixi.environments] |
| 130 | +default = { solve-group = "default" } |
| 131 | +testing = { features = ["testing"], solve-group = "default" } |
| 132 | + |
| 133 | +[tool.pixi.tasks] |
0 commit comments