Skip to content

Commit

Permalink
fix version string generated in docker builds (#2566)
Browse files Browse the repository at this point in the history
Dockerhub changes the executable bit on `hooks/build`, which leads to
the repository being dirty during the build which messes with the
version string created by setuptools-scm. This commit changes the
executable bit so that the docker build does not make the repo dirty.

It also adds a `git reset --hard` to ensure the repo is clean even if
the build process dirties the repo in a different way in the future.
  • Loading branch information
charles-cooper authored Dec 14, 2021
1 parent 654b21d commit c843b68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ ADD . /code

WORKDIR /code

# force repository to be clean so the version string is right
RUN git reset --hard

# Using "test" optional to include test dependencies in built docker-image
RUN pip install .[test] && \
apt-get purge -y --auto-remove apt-utils gcc libc6-dev libc-dev libssl-dev
Expand Down
Empty file modified hooks/build
100644 → 100755
Empty file.

0 comments on commit c843b68

Please sign in to comment.