diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-12-07 00:00:11 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-12-07 00:00:11 +0100 |
commit | bada35304072f4a62dfe688db0b1e4b6d7be62a5 (patch) | |
tree | 50d0ac1d97c9588ef868944b30954062ceb47307 | |
parent | f3dee66079ef795a23e4f339044491c76814db12 (diff) |
move to build tool hatch
don't require proxy field in config
-rw-r--r-- | pyproject.toml | 43 | ||||
-rw-r--r-- | src/jwebmail/__init__.py | 4 |
2 files changed, 30 insertions, 17 deletions
diff --git a/pyproject.toml b/pyproject.toml index 22c7ece..47d8692 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,30 +14,43 @@ dependencies = [ "redis", ] -[project.optional-dependencies] -dev = [ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch] + +[tool.hatch.version] +path = "src/jwebmail/__init__.py" + +[tool.hatch.envs.dev] +dependencies = [ "isort", "black", "pip-tools", "click", ] -test = [ - "pytest", -] -[build-system] -requires = ["flit_core >=3.2,<4"] -build-backend = "flit_core.buildapi" +[tool.hatch.envs.dev.scripts] +serve = "flask --app src/jwebmail --debug run --extra-files src/jwebmail/translations" +tr-compile = "pybabel compile -d src/jwebmail/translations/" +tr-extract = "pybabel extract -F babel.cfg -o messages.pot -k lazy_gettext src/ && pybabel update -i messages.pot -d src/jwebmail/translations/" + +[tool.hatch.build.targets.wheel] +ignore-vcs = true +sources = ["src"] +include = [ + "src/jwebmail/*.py", + "src/jwebmail/model/*.py", + "src/jwebmail/templates/*.html", + "src/jwebmail/static/src/*.js", + "src/jwebmail/static/css/*.css", + "src/jwebmail/translations/*/LC_MESSAGES/messages.mo", +] [tool.isort] -profile = 'black' +profile = "black" [tool.pip-tools] generate-hashes = true strip-extras = true - -[tool.flit.sdist] -include = [ - "script/", - "scss/", -] diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py index aa4d6a7..b7fd03f 100644 --- a/src/jwebmail/__init__.py +++ b/src/jwebmail/__init__.py @@ -32,7 +32,7 @@ else: from toml import load as toml_load toml_read_file = dict(load=toml_load, text=True) -__version__ = "2.0.0" +__version__ = "2.0.0.dev2" def validate_config(app): @@ -62,7 +62,7 @@ def create_app(): else: app.config.from_file(environ["JWEBMAIL_CONFIG"], **toml_read_file) - if app.config["JWEBMAIL"]["PROXY"]: + if app.config["JWEBMAIL"].get("PROXY"): app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1) validate_config(app) |