Skip to content

Commit 5637f7b

Browse files
authored
add dependabot for pyproj (#40)
1 parent b6468d3 commit 5637f7b

File tree

7 files changed

+34
-10
lines changed

7 files changed

+34
-10
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ updates:
1010
schedule:
1111
interval: "daily"
1212

13+
# Configuration for pyproj
14+
- package-ecosystem: "pip"
15+
directory: "/scripts/"
16+
schedule:
17+
interval: "weekly"
18+
19+
# GitHub actions themselves
1320
- package-ecosystem: "github-actions"
1421
directory: "/"
1522
schedule:

scripts/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

scripts/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ENV DEST_DIR=/home/dist
1414
WORKDIR /home/
1515

1616
COPY conf .
17+
COPY .python-version .
1718
RUN /home/install.sh
1819

1920
COPY templates ./templates

scripts/conf/apt-packages.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
gcc
22
git
3-
software-properties-common
4-
python3.10
5-
python3-dev
6-
python3-distutils
7-
python3-venv
8-
python3-apt
3+
python${python_version}
4+
python${python_version}-venv
5+
python${python_version}-dev
96
python3-pip

scripts/conf/install.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,34 @@ set -Eeuo pipefail
44
TZ=Europe/Berlin
55
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
66

7+
if [ -f "/home/.python-version" ]; then
8+
python_version=`cat /home/.python-version`
9+
else
10+
python_version=3
11+
fi
712
# install missing packages
813
PACKAGE_LIST=/home/apt-packages.txt
914
if [ -f "$PACKAGE_LIST" ]; then
1015
apt-get update -qq > /dev/null
16+
apt-get -qq --yes install software-properties-common
17+
add-apt-repository --yes ppa:deadsnakes/ppa # for different python versions
18+
apt-get update -qq > /dev/null
1119

1220
apt-get \
1321
-qq --yes \
14-
--allow-downgrades \
1522
--allow-remove-essential \
1623
--allow-change-held-packages \
24+
--no-install-recommends \
1725
install \
18-
`cat $PACKAGE_LIST` > /dev/null
26+
`cat $PACKAGE_LIST | sed "s/\\${python_version}/${python_version}/p"` > /dev/null
1927
fi
2028

2129
# setup python environment
2230
mkdir -p $VIRTUAL_ENV
23-
python3 -m venv $VIRTUAL_ENV
31+
python${python_version} -m venv $VIRTUAL_ENV
32+
. $VIRTUAL_ENV/bin/activate
33+
34+
python3 --version
2435

2536
# install pyproj
2637
python3 -m pip install -q --upgrade pip

scripts/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# we use requirements.txt to easily trigger dependabot
2+
# but we do not install pyproj directly from pip.
3+
# pyproj is "compiled" for the specific version of PROJ
4+
# the file .python-version is needed to run properly with dependabot
5+
pyproj==3.7.1

scripts/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ test "$(ls -A $DIRNAME/dist/)" && rm -r $DIRNAME/dist/*
1010
PROJ_VERSION=`cat $DIRNAME/Dockerfile | sed -n 's/^FROM .*:\(.*\)$/\1/p'`
1111
echo "PROJ_VERSION=$PROJ_VERSION"
1212

13-
PYPROJ_VERSION=3.7.1
13+
# extract PYPROJ version from requirements.txt
14+
PYPROJ_VERSION=`cat $DIRNAME/requirements.txt | sed -n 's/^pyproj==\(.*\)$/\1/p'`
15+
echo "PYPROJ_VERSION=$PYPROJ_VERSION"
1416

1517
DOCKER_TAG="crs-explorer:$PROJ_VERSION"
1618
STOP_COUNTER="${1:-0}"

0 commit comments

Comments
 (0)