From b3603c04c54d67eb9e8d81737fc940c476d0101b Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Sun, 5 Jun 2022 14:49:21 -0700 Subject: [PATCH] Add pylint to bw-dev Because pylint requires the app to be fully parseable with all its dependencies, we run it in the web container, and add pylint as a dev dependency. --- Dockerfile | 6 +++++- bw-dev | 5 +++++ requirements.dev.txt | 7 +++++++ requirements.txt | 8 -------- 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 requirements.dev.txt diff --git a/Dockerfile b/Dockerfile index 349dd82b1..99a25768b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,10 @@ RUN mkdir /app /app/static /app/images WORKDIR /app +RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean + COPY requirements.txt /app/ RUN pip install -r requirements.txt --no-cache-dir -RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean + +COPY requirements.dev.txt /app/ +RUN pip install -r requirements.dev.txt --no-cache-dir diff --git a/bw-dev b/bw-dev index 058f2639b..4dd543c0a 100755 --- a/bw-dev +++ b/bw-dev @@ -140,6 +140,10 @@ case "$CMD" in black) docker-compose run --rm dev-tools black celerywyrm bookwyrm ;; + pylint) + # pylint depends on having the app dependencies in place, so we run it in the web container + runweb pylint bookwyrm/ + ;; prettier) docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js ;; @@ -149,6 +153,7 @@ case "$CMD" in --config dev-tools/.stylelintrc.js ;; formatters) + runweb pylint bookwyrm/ docker-compose run --rm dev-tools black celerywyrm bookwyrm docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js docker-compose run --rm dev-tools npx stylelint \ diff --git a/requirements.dev.txt b/requirements.dev.txt new file mode 100644 index 000000000..d731ca92e --- /dev/null +++ b/requirements.dev.txt @@ -0,0 +1,7 @@ +pytest-django==4.1.0 +pytest==6.1.2 +pytest-cov==2.10.1 +pytest-env==0.6.2 +pytest-xdist==2.3.0 +pytidylib==0.3.2 +pylint==2.14.0 diff --git a/requirements.txt b/requirements.txt index 7614dc421..f1ece86db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,11 +26,3 @@ opentelemetry-sdk==1.8.0 opentelemetry-exporter-otlp-proto-grpc==1.8.0 opentelemetry-instrumentation-django==0.27b0 opentelemetry-instrumentation-celery==0.27b0 - -# Dev -pytest-django==4.1.0 -pytest==6.1.2 -pytest-cov==2.10.1 -pytest-env==0.6.2 -pytest-xdist==2.3.0 -pytidylib==0.3.2