Skip to content

Commit

Permalink
Split a function for copying sources.
Browse files Browse the repository at this point in the history
Avoid copying in .git and other unecessary files by specifying source
files explicitly.

To make this slightly less unfun factor it into a function.
  • Loading branch information
nuclearsandwich committed Nov 13, 2024
1 parent bd733ba commit 1c52e88
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build.earth
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
VERSION 0.8


SRC:
FUNCTION
COPY --dir scripts stdeb test_data \
test*.sh *.txt *.py *.cfg *.toml *.rst \
MANIFEST.in \
/src/stdeb
WORKDIR /src/stdeb

BUILD:
FUNCTION
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -10,8 +19,7 @@ BUILD:
# Test deps
RUN apt-get update; apt-get install -y libpq-dev python3-all-dev

COPY . /src/stdeb
WORKDIR /src/stdeb
DO +SRC
RUN python3 setup.py --command-packages=stdeb.command bdist_deb
RUN for f in deb_dist/*.deb; do echo; echo $f; dpkg --contents $f; done

Expand All @@ -22,8 +30,7 @@ INSTALL:

lint:
FROM docker.io/library/python:3.10-alpine
COPY . /src/stdeb
WORKDIR /src/stdeb
DO +SRC
RUN python3 -m pip install -r requirements.txt
RUN ruff format --check || true
RUN ruff check || true
Expand Down

0 comments on commit 1c52e88

Please sign in to comment.