Embrace poetry

pip-tools doesn't work well on renovate, and also makes some things annoying. Poetry has been a pain in the past, but let's see if intense usage will win me over.
This commit is contained in:
Jake Howard 2022-09-13 14:52:06 +01:00
parent ce5ab07ced
commit 72642d948f
Signed by: jake
GPG key ID: 57AFB45680EDD477
10 changed files with 2289 additions and 282 deletions

View file

@ -32,10 +32,11 @@ pip:
before_script:
- apt-get update --yes
- apt-get install --yes build-essential libpq-dev git
- pip install poetry==1.2.0
script:
- python -m venv env
- source env/bin/activate
- pip install -r requirements/dev.txt
- poetry install
artifacts:
name: 'pip-$CI_JOB_ID'
paths:
@ -124,12 +125,11 @@ npm_lint:
script:
- npm run lint
pip_tools:
poetry:
extends: .python_test_template
script:
- ./scripts/compile-requirements.sh
- git diff
- git diff-index --quiet HEAD --
- poetry check
- poetry lock --check
crontab:
image: alpine

View file

@ -25,6 +25,8 @@ RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-r
RUN curl -fsSL https://github.com/aptible/supercronic/releases/download/v0.2.1/supercronic-linux-amd64 -o /usr/local/bin/supercronic && chmod +x /usr/local/bin/supercronic
RUN pip install --no-cache poetry==1.2.0
ENV PATH=$VIRTUAL_ENV/bin:$PATH \
PYTHONUNBUFFERED=1
@ -33,8 +35,8 @@ EXPOSE 8000
USER website
RUN python -m venv $VIRTUAL_ENV
COPY --chown=website requirements/base.txt ./requirements/base.txt
RUN pip install --no-cache --upgrade pip && pip install --no-cache -r ./requirements/base.txt
COPY --chown=website pyproject.toml poetry.lock ./
RUN poetry install --without=dev --no-cache
COPY --chown=website --from=frontend ./static/build ./static/build
@ -58,7 +60,6 @@ RUN curl -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin
# Restore user
USER website
COPY --chown=website requirements/dev.txt ./requirements/dev.txt
RUN pip install -r requirements/dev.txt
RUN poetry install --no-cache
CMD sleep infinity

2217
poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,64 @@
[tool.poetry]
name = "website"
version = "0.0.0"
description = ""
authors = []
[tool.poetry.dependencies]
python = "^3.10"
Django = "4.0.6"
wagtail = "3.0.1"
django-environ = "0.9.0"
whitenoise = {version = "6.2.0", extras = ["brotli"]}
Pygments = "2.13.0"
beautifulsoup4 = "4.9.3"
lxml = "4.9.1"
more-itertools = "8.13.0"
requests = "2.28.1"
wagtail-generic-chooser = "0.4.1"
django-rq = "2.5.1"
django-redis = "5.2.0"
wagtail-draftail-snippet = "0.4.1"
gunicorn = "20.1.0"
psycopg2 = "2.9.3"
djangorestframework = "3.13.1"
django-htmx = "1.12.1"
wagtail-metadata = "4.0.0"
humanize = "4.3.0"
drf-yasg = "1.21.3"
django-plausible = "0.3.0"
sentry-sdk = "1.9.5"
wagtail-favicon = "0.2.0"
django-sri = "0.5.0"
wagtail-2fa = "1.6.0"
django-health-check = "3.16.7"
wagtail-autocomplete = {git = "https://github.com/wagtail/wagtail-autocomplete", rev = "03f46a0c256989690d0a43fc21fe0f37f9ede765"}
[tool.poetry.group.dev.dependencies]
honcho = "1.1.0"
flake8 = "4.0.1"
isort = "5.10.1"
black = "22.6.0"
django-browser-reload = "1.6.0"
django-debug-toolbar = "3.5.0"
types-requests = "2.28.5"
mypy = "0.971"
curlylint = "0.13.1"
djhtml = "1.5.1"
wagtail-factories = "3.1.0"
coverage = "6.4.4"
flake8-bugbear = "22.8.23"
flake8-builtins = "1.5.3"
flake8-comprehensions = "3.10.0"
flake8-mutable = "1.2.0"
flake8-print = "5.0.0"
flake8-tuple = "0.4.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.curlylint]
include = '/website/.*\.html'
exclude = '''

View file

@ -3,8 +3,5 @@
"extends": [
"config:base"
],
"prConcurrentLimit": 0,
"pip-compile": {
"fileMatch": ["requirements\/(.*)\\.in$"]
}
"prConcurrentLimit": 0
}

View file

@ -1,29 +0,0 @@
Django==4.0.6
wagtail==3.0.1
django-environ==0.9.0
whitenoise[brotli]==6.2.0
pygments==2.13.0
beautifulsoup4==4.9.3
lxml==4.9.1
more-itertools==8.13.0
requests==2.28.1
wagtail-generic-chooser==0.4.1
django-rq==2.5.1
django-redis==5.2.0
wagtail-draftail-snippet==0.4.1
gunicorn==20.1.0
psycopg2==2.9.3
djangorestframework==3.13.1
django-htmx==1.12.1
wagtail-metadata==4.0.0
humanize==4.3.0
drf-yasg==1.21.3
django-plausible==0.3.0
sentry-sdk==1.9.5
wagtail-favicon==0.2.0
django-sri==0.5.0
wagtail-2fa==1.6.0
django-health-check==3.16.7
# Pinned due to lack of Wagtail 3 support
git+https://github.com/wagtail/wagtail-autocomplete@03f46a0c256989690d0a43fc21fe0f37f9ede765

View file

@ -1,84 +0,0 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile --annotation-style=line --output-file=requirements/base.txt --resolver=backtracking requirements/base.in
#
anyascii==0.3.1 # via wagtail
asgiref==3.5.2 # via django
async-timeout==4.0.2 # via redis
beautifulsoup4==4.9.3 # via -r requirements/base.in, wagtail
brotli==1.0.9 # via whitenoise
certifi==2022.6.15 # via requests, sentry-sdk
charset-normalizer==2.1.0 # via requests
click==8.1.3 # via rq
coreapi==2.3.3 # via drf-yasg
coreschema==0.0.4 # via coreapi, drf-yasg
deprecated==1.2.13 # via redis
django==4.0.6 # via -r requirements/base.in, django-filter, django-health-check, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa
django-environ==0.9.0 # via -r requirements/base.in
django-filter==21.1 # via wagtail
django-health-check==3.16.7 # via -r requirements/base.in
django-htmx==1.12.1 # via -r requirements/base.in
django-modelcluster==6.0 # via wagtail
django-otp==1.1.3 # via wagtail-2fa
django-permissionedforms==0.1 # via wagtail
django-plausible==0.3.0 # via -r requirements/base.in
django-redis==5.2.0 # via -r requirements/base.in
django-rq==2.5.1 # via -r requirements/base.in
django-sri==0.5.0 # via -r requirements/base.in
django-taggit==2.1.0 # via wagtail
django-treebeard==4.5.1 # via wagtail
djangorestframework==3.13.1 # via -r requirements/base.in, drf-yasg, wagtail
draftjs-exporter==2.1.7 # via wagtail
drf-yasg==1.21.3 # via -r requirements/base.in
et-xmlfile==1.1.0 # via openpyxl
gunicorn==20.1.0 # via -r requirements/base.in
html5lib==1.1 # via wagtail
humanize==4.3.0 # via -r requirements/base.in
idna==3.3 # via requests
inflection==0.5.1 # via drf-yasg
itypes==1.2.0 # via coreapi
jinja2==3.1.2 # via coreschema
l18n==2021.3 # via wagtail
lxml==4.9.1 # via -r requirements/base.in
markupsafe==2.1.1 # via jinja2
more-itertools==8.13.0 # via -r requirements/base.in
openpyxl==3.0.10 # via tablib
packaging==21.3 # via drf-yasg, redis
pillow==9.2.0 # via wagtail
psycopg2==2.9.3 # via -r requirements/base.in
pygments==2.13.0 # via -r requirements/base.in
pyparsing==3.0.9 # via packaging
pytz==2022.1 # via django-modelcluster, djangorestframework, drf-yasg, l18n
qrcode==7.3.1 # via wagtail-2fa
redis==4.3.4 # via django-redis, django-rq, rq
requests==2.28.1 # via -r requirements/base.in, coreapi, wagtail, wagtail-generic-chooser
rq==1.10.1 # via django-rq
ruamel-yaml==0.17.21 # via drf-yasg
ruamel-yaml-clib==0.2.6 # via ruamel-yaml
sentry-sdk==1.9.5 # via -r requirements/base.in
six==1.16.0 # via html5lib, l18n, wagtail-2fa
soupsieve==2.3.2.post1 # via beautifulsoup4
sqlparse==0.4.2 # via django
tablib[xls,xlsx]==3.2.1 # via wagtail
telepath==0.2 # via wagtail
uritemplate==4.1.1 # via coreapi, drf-yasg
urllib3==1.26.11 # via requests, sentry-sdk
wagtail==3.0.1 # via -r requirements/base.in, wagtail-2fa, wagtail-autocomplete, wagtail-draftail-snippet, wagtail-metadata
wagtail-2fa==1.6.0 # via -r requirements/base.in
wagtail-autocomplete @ git+https://github.com/wagtail/wagtail-autocomplete@03f46a0c256989690d0a43fc21fe0f37f9ede765 # via -r requirements/base.in
wagtail-draftail-snippet==0.4.1 # via -r requirements/base.in
wagtail-favicon==0.2.0 # via -r requirements/base.in
wagtail-generic-chooser==0.4.1 # via -r requirements/base.in
wagtail-metadata==4.0.0 # via -r requirements/base.in
webencodings==0.5.1 # via html5lib
whitenoise[brotli]==6.2.0 # via -r requirements/base.in
willow==1.4.1 # via wagtail
wrapt==1.14.1 # via deprecated
xlrd==2.0.1 # via tablib
xlsxwriter==3.0.3 # via wagtail
xlwt==1.3.0 # via tablib
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,22 +0,0 @@
-r base.txt
pip-tools==6.8.0
honcho==1.1.0
flake8==4.0.1
isort==5.10.1
black==22.6.0
django-browser-reload==1.6.0
django-debug-toolbar==3.5.0
types-requests==2.28.5
mypy==0.971
curlylint==0.13.1
djhtml==1.5.1
wagtail-factories==3.1.0
coverage==6.4.4
flake8-bugbear==22.8.23
flake8-builtins==1.5.3
flake8-comprehensions==3.10.0
flake8-mutable==1.2.0
flake8-print==5.0.0
flake8-tuple==0.4.1

View file

@ -1,122 +0,0 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile --annotation-style=line --output-file=requirements/dev.txt --resolver=backtracking requirements/dev.in
#
anyascii==0.3.1 # via -r requirements/base.txt, wagtail
asgiref==3.5.2 # via -r requirements/base.txt, django
async-timeout==4.0.2 # via -r requirements/base.txt, redis
attrs==22.1.0 # via curlylint, flake8-bugbear
beautifulsoup4==4.9.3 # via -r requirements/base.txt, wagtail
black==22.6.0 # via -r requirements/dev.in
brotli==1.0.9 # via -r requirements/base.txt, whitenoise
build==0.8.0 # via pip-tools
certifi==2022.6.15 # via -r requirements/base.txt, requests, sentry-sdk
charset-normalizer==2.1.0 # via -r requirements/base.txt, requests
click==8.1.3 # via -r requirements/base.txt, black, curlylint, pip-tools, rq
coreapi==2.3.3 # via -r requirements/base.txt, drf-yasg
coreschema==0.0.4 # via -r requirements/base.txt, coreapi, drf-yasg
coverage==6.4.4 # via -r requirements/dev.in
curlylint==0.13.1 # via -r requirements/dev.in
deprecated==1.2.13 # via -r requirements/base.txt, redis
django==4.0.6 # via -r requirements/base.txt, django-browser-reload, django-debug-toolbar, django-filter, django-health-check, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa
django-browser-reload==1.6.0 # via -r requirements/dev.in
django-debug-toolbar==3.5.0 # via -r requirements/dev.in
django-environ==0.9.0 # via -r requirements/base.txt
django-filter==21.1 # via -r requirements/base.txt, wagtail
django-health-check==3.16.7 # via -r requirements/base.txt
django-htmx==1.12.1 # via -r requirements/base.txt
django-modelcluster==6.0 # via -r requirements/base.txt, wagtail
django-otp==1.1.3 # via -r requirements/base.txt, wagtail-2fa
django-permissionedforms==0.1 # via -r requirements/base.txt, wagtail
django-plausible==0.3.0 # via -r requirements/base.txt
django-redis==5.2.0 # via -r requirements/base.txt
django-rq==2.5.1 # via -r requirements/base.txt
django-sri==0.5.0 # via -r requirements/base.txt
django-taggit==2.1.0 # via -r requirements/base.txt, wagtail
django-treebeard==4.5.1 # via -r requirements/base.txt, wagtail
djangorestframework==3.13.1 # via -r requirements/base.txt, drf-yasg, wagtail
djhtml==1.5.1 # via -r requirements/dev.in
draftjs-exporter==2.1.7 # via -r requirements/base.txt, wagtail
drf-yasg==1.21.3 # via -r requirements/base.txt
et-xmlfile==1.1.0 # via -r requirements/base.txt, openpyxl
factory-boy==3.2.1 # via wagtail-factories
faker==14.1.0 # via factory-boy
flake8==4.0.1 # via -r requirements/dev.in, flake8-bugbear, flake8-builtins, flake8-comprehensions, flake8-mutable, flake8-print, flake8-tuple
flake8-bugbear==22.8.23 # via -r requirements/dev.in
flake8-builtins==1.5.3 # via -r requirements/dev.in
flake8-comprehensions==3.10.0 # via -r requirements/dev.in
flake8-mutable==1.2.0 # via -r requirements/dev.in
flake8-print==5.0.0 # via -r requirements/dev.in
flake8-tuple==0.4.1 # via -r requirements/dev.in
gunicorn==20.1.0 # via -r requirements/base.txt
honcho==1.1.0 # via -r requirements/dev.in
html5lib==1.1 # via -r requirements/base.txt, wagtail
humanize==4.3.0 # via -r requirements/base.txt
idna==3.3 # via -r requirements/base.txt, requests
inflection==0.5.1 # via -r requirements/base.txt, drf-yasg
isort==5.10.1 # via -r requirements/dev.in
itypes==1.2.0 # via -r requirements/base.txt, coreapi
jinja2==3.1.2 # via -r requirements/base.txt, coreschema
l18n==2021.3 # via -r requirements/base.txt, wagtail
lxml==4.9.1 # via -r requirements/base.txt
markupsafe==2.1.1 # via -r requirements/base.txt, jinja2
mccabe==0.6.1 # via flake8
more-itertools==8.13.0 # via -r requirements/base.txt
mypy==0.971 # via -r requirements/dev.in
mypy-extensions==0.4.3 # via black, mypy
openpyxl==3.0.10 # via -r requirements/base.txt, tablib
packaging==21.3 # via -r requirements/base.txt, build, drf-yasg, redis
parsy==1.1.0 # via curlylint
pathspec==0.9.0 # via black, curlylint
pep517==0.12.0 # via build
pillow==9.2.0 # via -r requirements/base.txt, wagtail
pip-tools==6.8.0 # via -r requirements/dev.in
platformdirs==2.5.2 # via black
psycopg2==2.9.3 # via -r requirements/base.txt
pycodestyle==2.8.0 # via flake8, flake8-print
pyflakes==2.4.0 # via flake8
pygments==2.13.0 # via -r requirements/base.txt
pyparsing==3.0.9 # via -r requirements/base.txt, packaging
python-dateutil==2.8.2 # via faker
pytz==2022.1 # via -r requirements/base.txt, django-modelcluster, djangorestframework, drf-yasg, l18n
qrcode==7.3.1 # via -r requirements/base.txt, wagtail-2fa
redis==4.3.4 # via -r requirements/base.txt, django-redis, django-rq, rq
requests==2.28.1 # via -r requirements/base.txt, coreapi, wagtail, wagtail-generic-chooser
rq==1.10.1 # via -r requirements/base.txt, django-rq
ruamel-yaml==0.17.21 # via -r requirements/base.txt, drf-yasg
ruamel-yaml-clib==0.2.6 # via -r requirements/base.txt, ruamel-yaml
sentry-sdk==1.9.5 # via -r requirements/base.txt
six==1.16.0 # via -r requirements/base.txt, flake8-tuple, html5lib, l18n, python-dateutil, wagtail-2fa
soupsieve==2.3.2.post1 # via -r requirements/base.txt, beautifulsoup4
sqlparse==0.4.2 # via -r requirements/base.txt, django, django-debug-toolbar
tablib[xls,xlsx]==3.2.1 # via -r requirements/base.txt, wagtail
telepath==0.2 # via -r requirements/base.txt, wagtail
toml==0.10.2 # via curlylint
tomli==2.0.1 # via black, build, mypy, pep517
types-requests==2.28.5 # via -r requirements/dev.in
types-urllib3==1.26.17 # via types-requests
typing-extensions==4.3.0 # via mypy
uritemplate==4.1.1 # via -r requirements/base.txt, coreapi, drf-yasg
urllib3==1.26.11 # via -r requirements/base.txt, requests, sentry-sdk
wagtail==3.0.1 # via -r requirements/base.txt, wagtail-2fa, wagtail-autocomplete, wagtail-draftail-snippet, wagtail-factories, wagtail-metadata
wagtail-2fa==1.6.0 # via -r requirements/base.txt
wagtail-autocomplete @ git+https://github.com/wagtail/wagtail-autocomplete@03f46a0c256989690d0a43fc21fe0f37f9ede765 # via -r requirements/base.txt
wagtail-draftail-snippet==0.4.1 # via -r requirements/base.txt
wagtail-factories==3.1.0 # via -r requirements/dev.in
wagtail-favicon==0.2.0 # via -r requirements/base.txt
wagtail-generic-chooser==0.4.1 # via -r requirements/base.txt
wagtail-metadata==4.0.0 # via -r requirements/base.txt
webencodings==0.5.1 # via -r requirements/base.txt, html5lib
wheel==0.37.1 # via pip-tools
whitenoise[brotli]==6.2.0 # via -r requirements/base.txt
willow==1.4.1 # via -r requirements/base.txt, wagtail
wrapt==1.14.1 # via -r requirements/base.txt, deprecated
xlrd==2.0.1 # via -r requirements/base.txt, tablib
xlsxwriter==3.0.3 # via -r requirements/base.txt, wagtail
xlwt==1.3.0 # via -r requirements/base.txt, tablib
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e
cd $(dirname $0)/..
COMMON_ARGS="--quiet --annotation-style=line --resolver=backtracking $@"
set -x
pip-compile $COMMON_ARGS -o requirements/base.txt requirements/base.in
pip-compile $COMMON_ARGS -o requirements/dev.txt requirements/dev.in