git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/pyproject.toml
diff options
context:
space:
mode:
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml121
1 files changed, 121 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..803a5cd
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,121 @@
+[build-system]
+requires = ["setuptools >= 61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "project-dummy"
+description = "A dummy as base directory for actual projects"
+authors = [
+ { name = "Glenn Matthews", email = "janitor@sacredheart.com" }
+]
+license = { text = "License :: OSI Approved :: GNU General Public License v2 (GPLv2)" }
+readme = "README.md"
+requires-python = ">=3.6.0"
+dependencies = [
+ "ansible",
+ "ansible-compat",
+ "ansible-core>=2.12.0"
+]
+dynamic = ["version"]
+
+[project.scripts]
+# install a command as part of the package
+hemlo = "project_dummy:hemlo_world"
+
+[project.urls]
+Source = "https://git.lirion.de/python-project-dummy"
+Documentation = "https://wiki.lirion.example.com/python-project-dummy"
+
+[tool.pytest.ini_options]
+# both mode and loop fixture see https://github.com/pytest-dev/pytest-asyncio/issues/924
+asyncio_mode = "auto"
+# Valid fixture loop scopes are: "function", "class", "module", "package", "session"
+# Caution: This works only on "more recent" versions of pytest (7.2.1 doesn't know this, 8.3.3 does)
+asyncio_default_fixture_loop_scope = "function"
+
+[tool.ruff]
+# Assume Python 3.6.
+target-version = "py36"
+fix = true
+show-fixes = true
+preview = true
+
+[tool.ruff.lint]
+select = [
+ "E", # pycodestyle
+ "F", # Pyflakes
+ "I001", # isort
+ "UP", # pyupgrade
+ "ASYNC", # flake8-async
+ "C4", # flake8-comprehensions
+ "T10", # flake8-debugger
+ "FA", # flake8-future-annotations
+ "PT", # flake8-pytest-style
+ "RSE", # flake8-raise
+ "PERF", # Perflint
+ "FURB", # refurb
+]
+ignore = [
+ "E501" # https://www.flake8rules.com/rules/E501.html - Let `black` handle this.
+]
+# Allow autofix for all enabled rules (when `--fix`) is provided.
+fixable = ["ALL"]
+unfixable = []
+# Exclude a variety of commonly ignored directories.
+exclude = [
+ ".bzr",
+ ".direnv",
+ ".eggs",
+ ".git",
+ ".git-rewrite",
+ ".hg",
+ ".mypy_cache",
+ ".nox",
+ ".pants.d",
+ ".pytype",
+ ".ruff_cache",
+ ".svn",
+ ".tox",
+ ".venv",
+ "__pypackages__",
+ "_build",
+ "buck-out",
+ "build",
+ "dist",
+ "node_modules",
+ "venv",
+ "venv*",
+ "tests"
+]
+
+[tool.ruff.lint.per-file-ignores]
+"__init__.py" = [
+ "I001",
+]
+
+[tool.ruff.lint.pyupgrade]
+# Preserve types, even if a file imports `from __future__ import annotations`.
+# Needed for python < 3.10, should be removed afterward.
+keep-runtime-typing = true
+
+[tools.setuptools.dynamic]
+version = {attr = 'project_dummy.__version__'}
+readme = {file = ['README.md', 'README.rst', 'USAGE.rst']}
+classifiers = {file = ['classifiers.txt']}
+# # dependencies supports "file" but does not support comments in requirements.txt ... :|
+# dependencies = {file = ['requirements.txt']}
+# # ...same for optional dependencies...
+# optional-dependencies = {file = ['requirements.txt']}
+
+# look for packages:
+[tools.setuptools.packages.find]
+# Not using "src/" for now. I'm starting with /package_name folders, using "src" as a folder
+# feels redundant. May change when I use larger projects.
+# where = ["src"] # list of folders that contain the packages (["."] by default)
+include = ["project_*"] # package names should match these glob patterns (["*"] by default)
+exclude = ["project_*.tests*"] # exclude packages matching these glob patterns (empty by default)
+namespaces = false # to disable scanning PEP 420 namespaces (true by default)
+
+# ...or list the packages explicitly:
+# [tool.setuptools]
+# packages = ["my_package"] # use [] for meta-dists that just collect dependencies