diff --git a/doc/source/conf.py b/doc/source/conf.py index 3c61464..ac0a0a3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,7 +22,7 @@ # -- Project information ----------------------------------------------------- project = 'proxy-protocol' -copyright = '2023, Ian Good' +copyright = '2024, Ian Good' author = 'Ian Good' # The short X.Y version diff --git a/docker/Dockerfile b/docker/Dockerfile index af21651..14de82d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,13 +1,13 @@ -FROM python:3.11-alpine +FROM python:3.12-alpine WORKDIR /src COPY . . -RUN pip install -U pip wheel setuptools typing-extensions +RUN pip install -U pip wheel setuptools hatch typing-extensions RUN apk --update add --virtual build-dependencies python3-dev build-base \ - && pip install -r requirements-all.txt \ + && hatch env create docker \ && apk del build-dependencies -ENTRYPOINT ["proxyprotocol-server"] +ENTRYPOINT ["hatch", "run", "docker:server"] CMD ["--help"] diff --git a/pyproject.toml b/pyproject.toml index 6482d91..e88bbd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Ian C. Good +# Copyright (c) 2024 Ian C. Good # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -51,6 +51,19 @@ dependencies = [ [project.optional-dependencies] crc32c = ['crc32c ~= 2.2'] +dev = [ + 'mypy', + 'pytest', + 'pytest-cov', + 'ruff', + 'pycodestyle', + 'autopep8', +] +doc = [ + 'sphinx', + 'sphinx-autodoc-typehints', + 'cloud_sptheme', +] [project.urls] 'Homepage' = 'https://github.com/icgood/proxy-protocol/' @@ -109,15 +122,7 @@ exclude_lines = [ ] [tool.hatch.envs.default] -dependencies = [ - 'mypy', - 'pytest', - 'pytest-cov', - 'ruff', - 'pycodestyle', - 'autopep8', -] -features = ['crc32c'] +features = ['dev', 'crc32c'] [tool.hatch.envs.default.scripts] run-pytest = 'py.test --cov-report=term-missing --cov=proxyprotocol' @@ -130,12 +135,14 @@ check = ['run-pytest', 'run-autopep8', 'run-mypy', 'run-ruff'] python = ['3.8', '3.9', '3.10', '3.11', '3.12'] [tool.hatch.envs.doc] -dependencies = [ - 'sphinx', - 'sphinx-autodoc-typehints', - 'cloud_sptheme', -] +features = ['doc'] [tool.hatch.envs.doc.scripts] build = 'make -C doc html' browse = ['build', 'open doc/build/html/index.html'] + +[tool.hatch.envs.docker] +features = ['crc32c'] + +[tool.hatch.envs.docker.scripts] +server = 'proxyprotocol-server' diff --git a/requirements-all.txt b/requirements-all.txt deleted file mode 100644 index 6e98770..0000000 --- a/requirements-all.txt +++ /dev/null @@ -1 +0,0 @@ --e '.[crc32c]'