Skip to content

Commit

Permalink
build(deps): Drop support Python 3.7 and older (#1438)
Browse files Browse the repository at this point in the history
Close: #1358
  • Loading branch information
buhtz committed May 16, 2023
1 parent e1326a2 commit b144d30
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 44 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ addons:
ssh_known_hosts: localhost

python:
- "3.6"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -30,16 +30,8 @@ before_install:
- sudo apt-get install -y sshfs screen util-linux
jobs:
exclude:
- arch: ppc64le
python: "3.6"
- arch: ppc64le
python: "3.10"
- arch: ppc64le
python: "3.11"
- arch: amd64
python: "3.9"
- arch: amd64
python: "3.11"
- python: "3.9"
- python: "3.10"

install:
- pip install coveralls pyfakefs
Expand Down
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Version 1.3.4-dev (development of upcoming release)
* Project: Renamed branch "master" to "main" and started "gitflow" branching model.
* Fix bug: Add support for ChainerBackend class as keyring which iterates over all supported keyring backends (#1410)
# Fix bug: Unit test fails on some machines due to warning "Ignoring XDG_SESSION_TYPE=wayland on Gnome..." (#1429)
* Breaking change: Minimal Python version 3.8 required (#1358).
* Feature: Exclude /swapfile by default (#1053)
* Documentation: Removed outdated docbook (#1345).

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ replaced with PyPi packages.

* Runtime dependencies

- `python3` (>= 3.6)
- `python3` (>= 3.8)
- `rsync`
- `cron-daemon`
- `openssh-client`
Expand Down
60 changes: 32 additions & 28 deletions common/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#clean up
if [ -e Makefile ]; then
rm Makefile;
rm Makefile;
fi

#tmp files
Expand Down Expand Up @@ -118,23 +118,23 @@ onTravis () {
#get commandline arguments
unknown_args=""
for arg in $*; do
case $arg in
--python | --python3) PYTHON=$arg;;
--fuse-group | --no-fuse-group) FUSE_GROUP=$arg;;
--help | -h) usage; exit 0;;
*) unknown_args="$unknown_args $arg";;
esac
case $arg in
--python | --python3) PYTHON=$arg;;
--fuse-group | --no-fuse-group) FUSE_GROUP=$arg;;
--help | -h) usage; exit 0;;
*) unknown_args="$unknown_args $arg";;
esac
done

if [ -n "$unknown_args" ]; then
echo "Unknown Arguments: $unknown_args"
echo "Unknown Arguments: $unknown_args"
fi

#patch python command
#use 'python' or 'python3' to start Python Version 3.x
case $PYTHON in
--python) PYVERSION="" ;;
--python3) PYVERSION="3";;
--python) PYVERSION="" ;;
--python3) PYVERSION="3";;
esac
sed -e "s/^python3\? /python${PYVERSION} /g" \
-e "s/^ssh-agent python3\? /ssh-agent python${PYVERSION} /g" \
Expand All @@ -143,8 +143,8 @@ sed -e "s/^python3\? /python${PYVERSION} /g" \
#patch check for 'fuse' group
#Some distributions require user to be in group 'fuse' to use sshfs and encfs
case $FUSE_GROUP in
--fuse-group) CHECKFUSE="True" ;;
--no-fuse-group) CHECKFUSE="False";;
--fuse-group) CHECKFUSE="True" ;;
--no-fuse-group) CHECKFUSE="False";;
esac
sed -e "s/CHECK_FUSE_GROUP = \(True\|False\)/CHECK_FUSE_GROUP = ${CHECKFUSE}/" \
-i $FUSE_FILES
Expand All @@ -153,9 +153,9 @@ sed -e "s/CHECK_FUSE_GROUP = \(True\|False\)/CHECK_FUSE_GROUP = ${CHECKFUSE}/" \
mos=""
langs=""
for langfile in `ls po/*.po`; do
lang=`echo $langfile | cut -d/ -f2 | cut -d. -f1`
mos="po/$lang.mo $mos"
langs="$lang $langs"
lang=`echo $langfile | cut -d/ -f2 | cut -d. -f1`
mos="po/$lang.mo $mos"
langs="$lang $langs"
done

#start Makefile
Expand Down Expand Up @@ -254,17 +254,17 @@ printf "\tgzip -n --best -c config-example-ssh > config-example-ssh.gz\n\n" >> $
printf "translate:\t$mos\n\n" >> ${MAKEFILE}

for lang in $langs; do
printf "po/$lang.mo: po/$lang.po\n" >> ${MAKEFILE}
printf "\tmsgfmt -o po/$lang.mo po/$lang.po\n\n" >> ${MAKEFILE}
printf "po/$lang.mo: po/$lang.po\n" >> ${MAKEFILE}
printf "\tmsgfmt -o po/$lang.mo po/$lang.po\n\n" >> ${MAKEFILE}
done

#common langs
printf "install_translations:\n" >> ${MAKEFILE}
addComment "translations"
for lang in $langs; do
addInstallDir "/share/locale/$lang/LC_MESSAGES"
addInstallFileRename "po/$lang.mo" "/share/locale/$lang/LC_MESSAGES/backintime.mo"
addUninstallDir "/share/locale/$lang"
addInstallDir "/share/locale/$lang/LC_MESSAGES"
addInstallFileRename "po/$lang.mo" "/share/locale/$lang/LC_MESSAGES/backintime.mo"
addUninstallDir "/share/locale/$lang"
done
addUninstallDir "/share/locale"
addUninstallDir "/share"
Expand All @@ -279,7 +279,7 @@ printf "uninstall_dirs:\n" >> ${MAKEFILE}
cat ${UNINSTALL_DIRS} >> ${MAKEFILE}

#test
for i in "py.test-3" "py.test-3.6" "py.test-3.5" "py.test-3.4"; do
for i in "pytest" "py.test-3" "py.test-3.6" "py.test-3.5" "py.test-3.4"; do
PYTEST=$(which $i 2>/dev/null)
if [ -n "${PYTEST}" ]; then
break
Expand All @@ -303,9 +303,9 @@ for v in "" "-v"; do
if onTravis || [ -z "${PYTEST}" ]; then
#if running on travis-ci.org or if py.test-3 is not available
#call every test/test_*.py with $CMD from above
for i in $(ls -1 test/test_*.py); do
printf "\t${CMD} -m unittest ${v} -b $i\n" >> ${MAKEFILE}
done
for i in $(ls -1 test/test_*.py); do
printf "\t${CMD} -m unittest ${v} -b $i\n" >> ${MAKEFILE}
done
else
#else just call py.test-3 which will find test/test_*.py by itself
#py.test-3 has a nicer output so this is preferred over simple python3
Expand Down Expand Up @@ -338,10 +338,14 @@ for i in "${UNINSTALL_FILES}" "${UNINSTALL_DIRS}"; do
fi
done

#check python version
if [ $(python${PYVERSION} --version 2>&1 | grep -c "^Python 3") -ne 1 ]; then
printf "Warning: Wrong Python version.\n"
printf "Please make sure Python 3.x is used by adding '--python' or '--python3'.\n"
# check python version
PYTHON_VERSION_REQUIRED="3.8"
PYTHON_VERSION_CURRENT=$(python${PYVERSION} --version | tr --delete 'Python ')

# Credits: https://unix.stackexchange.com/a/285928/136851
if [ "$(printf '%s\n' "$PYTHON_VERSION_REQUIRED" "$PYTHON_VERSION_CURRENT" | sort -V | head -n1)" != "$PYTHON_VERSION_REQUIRED" ]; then
printf "Error: Wrong Python version ${PYTHON_VERSION_CURRENT}. "
printf "But minimal version ${PYTHON_VERSION_REQUIRED} required.\n"
exit 1
fi

Expand Down
12 changes: 8 additions & 4 deletions qt/configure
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ for i in "${UNINSTALL_FILES}" "${UNINSTALL_DIRS}"; do
fi
done

#check python version
if [ $(python${PYVERSION} --version 2>&1 | grep -c "^Python 3") -ne 1 ]; then
printf "Wrong Python version.\n"
printf "Please make sure Python 3.x is used by adding '--python' or '--python3'.\n"
# check python version
PYTHON_VERSION_REQUIRED="3.8"
PYTHON_VERSION_CURRENT=$(python${PYVERSION} --version | tr --delete 'Python ')

# Credits: https://unix.stackexchange.com/a/285928/136851
if [ "$(printf '%s\n' "$PYTHON_VERSION_REQUIRED" "$PYTHON_VERSION_CURRENT" | sort -V | head -n1)" != "$PYTHON_VERSION_REQUIRED" ]; then
printf "Error: Wrong Python version ${PYTHON_VERSION_CURRENT}. "
printf "But minimal version ${PYTHON_VERSION_REQUIRED} required.\n"
exit 1
fi

Expand Down

0 comments on commit b144d30

Please sign in to comment.