Skip to content

Commit

Permalink
Update py-deps for version clause matching.
Browse files Browse the repository at this point in the history
Updating with additional steps to (optionally) ensure that an explicit
version clause, if provided on both sides, matches between .env and
requirements.txt.
  • Loading branch information
robertbartel committed Sep 7, 2023
1 parent f029a9b commit 798bba2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker/py-sources/py-deps.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ARG SHAPELY_VERSION_CLAUSE
ARG PANDAS_VERSION_CLAUSE
ARG SKLEARN_VERSION_CLAUSE
ARG OVERRIDE_PROJ_VERSION_CLAUSES
ARG MATCH_EXPLICIT_PROJ_VERSION_CLAUSES

# Copy what we built so far in those other (hopefully cached) stages
COPY --from=build_pandas_dep /DIST/ /DIST/
Expand Down Expand Up @@ -105,6 +106,11 @@ RUN for pair in numpy:${NUMPY_VERSION_CLAUSE} \
if [ -n "${ver:-}" ]; then \
if [ -n "${OVERRIDE_PROJ_VERSION_CLAUSES:-}" ]; then \
cat /dmod/requirements.txt | sed "s/^${pack}.*/${pack}${ver}/" > /dmod/req_up.txt ; \
elif [ -n "${MATCH_EXPLICIT_PROJ_VERSION_CLAUSES:-}" ]; then \
proj_ver=$(cat /dmod/requirements.txt | grep -e "^${pack}" | sed "s/${pack}//") ; \
if [ "${ver}" != "${proj_ver}" ]; then \
echo "Error: configured version ${ver} of package ${pack} does not match ${proj_ver} from project requirements" 2> ; \
fi ; \
else \
cat /dmod/requirements.txt | sed "s/^${pack}$/${pack}${ver}/" > /dmod/req_up.txt ; \
fi ; \
Expand Down

0 comments on commit 798bba2

Please sign in to comment.