Use hatch for installing.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Víðir Valberg Guðmundsson 2024-03-03 11:05:08 +01:00
parent fedfca25a5
commit 712c50fac7
3 changed files with 18 additions and 15 deletions

View File

@ -5,3 +5,5 @@
!src/
!requirements/
!entrypoint.sh
!pyproject.toml
!README.md

View File

@ -11,7 +11,13 @@ ARG DJANGO_ENV
ARG BUILD
ENV BUILD ${BUILD}
RUN apt-get update \
WORKDIR /app
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www
COPY --chown=www:www . .
RUN mkdir /app/src/static \
&& chown www:www /app/src/static \
&& apt-get update \
&& apt-get install -y \
binutils \
libpq-dev \
@ -23,15 +29,9 @@ RUN apt-get update \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info \
gettext
WORKDIR /app
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www
COPY --chown=www:www . /app/
RUN mkdir /app/src/static && chown www:www /app/src/static
RUN pip install -r requirements/$([ "$DJANGO_ENV" = "production" ] && echo "base.txt" || echo "dev.txt") &&\
django-admin compilemessages
gettext \
&& pip install . \
&& django-admin compilemessages
ENTRYPOINT ["./entrypoint.sh"]

View File

@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
@ -22,11 +22,12 @@ dependencies = [
"django-zen-queries==2.1.0",
"django-registries==0.0.3",
"django-view-decorator==0.0.4",
"django-oauth-toolkit==2.3.0",
]
dynamic = ["version"]
version = "0.0.1"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src"]
[tool.hatch.envs.default]
dependencies = [
@ -59,7 +60,7 @@ cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --
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"
server = "./src/manage.py runserver 0.0.0.0:8000"
migrate = "./src/manage.py migrate"
makemigrations = "./src/manage.py makemigrations"
createsuperuser = "./src/manage.py createsuperuser"