From 2ed5df524118c6a477a44b797552a5a0c630c329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sat, 13 Jan 2024 15:39:31 +0100 Subject: [PATCH] Add pyproject.toml file. --- pyproject.toml | 105 ++++++++++++++++++++++++++++++++++++++++++ requirements/base.txt | 29 ++++++++---- 2 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e571243 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,105 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "membersystem" +description = '' +readme = "README.md" +requires-python = ">=3.11" +keywords = [] +authors = [ + { name = "Víðir Valberg Guðmundsson", email = "valberg@orn.li" }, +] +dependencies = [ + "Django==5.0.1", + "django-money==3.4.1", + "django-allauth==0.60.0", + "psycopg[binary]==3.1.16", + "environs[django]==10.0.0", + "uvicorn==0.25.0", + "whitenoise==6.6.0", + "django-zen-queries==2.1.0", + "django-registries==0.0.3", +] +dynamic = ["version"] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.envs.default] +dependencies = [ + "coverage[toml]==7.3.0", + "pytest==7.2.2", + "pytest-cov", + "pytest-django==4.5.2", + "mypy==1.1.1", + "django-stubs==1.16.0", + "pip-tools==7.3.0", + "django-debug-toolbar==4.2.0", + "django-browser-reload==1.7.0", + "model-bakery==1.17.0", +] + +[[tool.hatch.envs.tests.matrix]] +python = ["3.12"] +django = ["4.2", "5.0"] + +[tool.hatch.envs.tests.overrides] +matrix.django.dependencies = [ + { value = "django~={matrix:django}" }, +] +matrix.python.dependencies = [ + { value = "typing_extensions==4.5.0", if = ["3.10"]}, +] + +[tool.hatch.envs.default.scripts] +cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --cov=tests --cov=append {args}" +no-cov = "cov --no-cov {args}" +typecheck = "mypy --config-file=pyproject.toml ." +requirements = "pip-compile --output-file requirements/base.txt pyproject.toml" +server = "./src/manage.py runserver" +migrate = "./src/manage.py migrate" +makemigrations = "./src/manage.py makemigrations" +createsuperuser = "./src/manage.py createsuperuser" +shell = "./src/manage.py shell" + +[tool.pytest.ini_options] +DJANGO_SETTINGS_MODULE="tests.settings" +addopts = "--reuse-db" +norecursedirs = "build dist docs .eggs/* *.egg-info htmlcov .git" +python_files = "test*.py" +testpaths = "tests" +pythonpath = ". tests" + +[tool.coverage.run] +branch = true +parallel = true + +[tool.coverage.report] +exclude_lines = [ + "no cov", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] + +[tool.mypy] +mypy_path = "src/" +exclude = [ + "venv/", + "dist/", + "docs/", +] +namespace_packages = false +show_error_codes = true +strict = true +warn_unreachable = true +follow_imports = "normal" +#plugins = ["mypy_django_plugin.main"] + +[tool.django-stubs] +#django_settings_module = "tests.settings" + +[[tool.mypy.overrides]] +module = "tests.*" +allow_untyped_defs = true diff --git a/requirements/base.txt b/requirements/base.txt index 30a40f4..7213dee 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --output-file=requirements/base.txt requirements/base.in +# pip-compile --output-file=requirements/base.txt pyproject.toml # asgiref==3.7.2 # via django @@ -26,21 +26,26 @@ dj-email-url==1.0.6 # via environs django==5.0.1 # via - # -r requirements/base.in # dj-database-url # django-allauth # django-money + # django-registries # django-zen-queries + # membersystem (pyproject.toml) django-allauth==0.60.0 - # via -r requirements/base.in + # via membersystem (pyproject.toml) django-cache-url==3.4.5 # via environs django-money==3.4.1 - # via -r requirements/base.in + # via membersystem (pyproject.toml) +django-registries==0.0.3 + # via membersystem (pyproject.toml) django-zen-queries==2.1.0 - # via -r requirements/base.in + # via membersystem (pyproject.toml) environs[django]==10.0.0 - # via -r requirements/base.in + # via + # environs + # membersystem (pyproject.toml) h11==0.14.0 # via uvicorn idna==3.6 @@ -52,7 +57,9 @@ oauthlib==3.2.2 packaging==23.2 # via marshmallow psycopg[binary]==3.1.16 - # via -r requirements/base.in + # via + # membersystem (pyproject.toml) + # psycopg psycopg-binary==3.1.16 # via psycopg py-moneyed==3.0 @@ -60,7 +67,9 @@ py-moneyed==3.0 pycparser==2.21 # via cffi pyjwt[crypto]==2.8.0 - # via django-allauth + # via + # django-allauth + # pyjwt python-dotenv==1.0.0 # via environs python3-openid==3.2.0 @@ -81,9 +90,9 @@ typing-extensions==4.9.0 urllib3==2.1.0 # via requests uvicorn==0.25.0 - # via -r requirements/base.in + # via membersystem (pyproject.toml) whitenoise==6.6.0 - # via -r requirements/base.in + # via membersystem (pyproject.toml) # The following packages are considered to be unsafe in a requirements file: # setuptools