aboutsummaryrefslogtreecommitdiff
path: root/pyproject.toml
diff options
context:
space:
mode:
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml186
1 files changed, 186 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..aab4b3f
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,186 @@
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[project]
+name = "wikiget"
+dynamic = ["version"]
+description = "CLI tool for downloading files from MediaWiki sites"
+readme = "README.md"
+authors = [
+ {name = "Cody Logan", email = "clpo13@gmail.com"}
+]
+requires-python = ">=3.7"
+license = {text = "GPL-3.0-or-later"}
+keywords = ["commons", "mediawiki", "wikimedia", "wikipedia"]
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: End Users/Desktop",
+ "Operating System :: OS Independent",
+ "Topic :: Internet",
+ "Topic :: Internet :: WWW/HTTP",
+ "Topic :: Multimedia",
+ "Topic :: Multimedia :: Graphics",
+ "Topic :: Multimedia :: Sound/Audio",
+ "Topic :: Multimedia :: Video",
+ "Topic :: Utilities",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3 :: Only",
+ "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",
+]
+dependencies = [
+ "mwclient>=0.10.0",
+ "requests",
+ "tqdm",
+]
+
+[project.urls]
+Repository = "https://github.com/clpo13/wikiget"
+"Bug Reports" = "https://github.com/clpo13/wikiget/issues"
+
+[project.scripts]
+wikiget = "wikiget.wikiget:main"
+
+[tool.hatch.version]
+path = "src/wikiget/version.py"
+
+[tool.pytest.ini_options]
+addopts = [
+ "--import-mode=importlib",
+]
+testpaths = ["tests"]
+
+[tool.hatch.build.targets.sdist]
+exclude = [
+ "/.github",
+]
+
+[tool.hatch.envs.default]
+dependencies = [
+ "coverage[toml]>=6.5",
+ "pytest",
+]
+[tool.hatch.envs.default.scripts]
+test = "python -m pytest {args}"
+test-cov = "coverage run -m pytest {args}"
+cov-report = [
+ "- coverage combine",
+ "coverage report",
+]
+cov = [
+ "test-cov",
+ "cov-report",
+]
+
+[[tool.hatch.envs.all.matrix]]
+python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+
+[tool.hatch.envs.lint]
+detached = true
+dependencies = [
+ "black",
+ "mypy",
+ "ruff",
+]
+[tool.hatch.envs.lint.scripts]
+typing = "mypy --install-types --non-interactive {args:src/wikiget tests}"
+style = [
+ "ruff {args:.}",
+ "black --check --diff {args:.}",
+]
+fmt = [
+ "black {args:.}",
+ "ruff --fix {args:.}",
+ "style",
+]
+all = [
+ "style",
+ "typing",
+]
+
+[tool.black]
+target-version = ["py37"]
+line-length = 88
+
+[tool.ruff]
+target-version = "py37"
+line-length = 88
+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",
+ # FIXME: temporarily ignore usage of `print()`
+ "T201",
+]
+unfixable = [
+ # Don't touch unused imports
+ "F401",
+]
+
+[tool.ruff.isort]
+known-first-party = ["wikiget"]
+
+[tool.ruff.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 = ["wikiget"]
+branch = true
+parallel = true
+
+[tool.coverage.paths]
+wikiget = ["wikiget"]
+tests = ["tests"]
+
+[tool.coverage.report]
+exclude_lines = [
+ "no cov",
+ "if __name__ == .__main__.:",
+ "if TYPE_CHECKING:",
+]
+
+[[tool.mypy.overrides]]
+module = ["mwclient"]
+ignore_missing_imports = true