Remove Python 2.7 support

Currently, the only supported release that uses Python 2.7 is epel7
which is ending by the end of June. Therefore I removing the support
for this old Python version. Code will stay as it is for now, only
modifying scripts and configurations for testing and other Python 2
mentions. This also means that future code changes can break
Python 2 compatibility.

JIRA: RHELCMP-13775

Signed-off-by: Ondřej Nosek <onosek@redhat.com>
This commit is contained in:
Ondrej Nosek 2024-05-28 15:49:21 +02:00
commit 71f4e515e2
7 changed files with 5 additions and 57 deletions

2
Jenkinsfile vendored
View file

@ -54,8 +54,6 @@ git clone https://pagure.io/rpkg.git
# docker image will contain ENV: PYTHONPATH=./rpkg
podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test:latest tox -e py36,py39,py312,flake8,bandit --workdir /tmp/tox ${TOX_POSARGS}
podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2:latest python2.7 -m pytest test/
podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2:latest flake8 fedpkg/ test/
"""
sh "cat job.sh"
sh "ssh -o StrictHostKeyChecking=no root@$hostname mkdir $remote_dir"

View file

@ -1,5 +1,4 @@
include requirements.txt
include requirements-py2.txt
include tests-requirements.txt
global-exclude *.pyc

View file

@ -5,5 +5,5 @@ test: $(default_targets)
tox:
@python3 -m venv .env
@.env/bin/pip install tox
@.env/bin/tox -e py27,py36,py39,py312,flake8,flake8python2 --parallel=auto ${TOX_POSARGS}
@.env/bin/tox -e py36,py39,py312,flake --parallel=auto ${TOX_POSARGS}
.PHONY: tox

View file

@ -3,7 +3,7 @@ Introduction
This is the fedpkg project, which mostly is a subclass of the rpkg project.
rpkg works with Python 2.7, 3.6, 3.9, 3.10 and 3.11.
fedpkg works with Python 3.6, 3.9, 3.10, 3.11, 3.12
License
=======
@ -35,7 +35,7 @@ Contribution
============
You are welcome to write patches to fix or improve rpkg. All code should work
with Python 2.7 and 3. Before you create a PR to propose your changes,
with Python 3. Before you create a PR to propose your changes,
make sure
Sign-off commit
@ -54,7 +54,7 @@ Before make a pull request, ensure local changes pass all test cases.
Before run tests, install these packages::
sudo dnf install python27 python36 python37 git make gcc rpm-build \
sudo dnf install python36 python37 git make gcc rpm-build \
libcurl-devel krb5-devel openssl-devel
To run tests simply, ``make test``.

View file

@ -1,32 +0,0 @@
FROM centos:7
LABEL \
name="fedpkg test for Python 2" \
description="Run tests using tox with Python 2" \
vendor="fedpkg developers" \
license="MIT"
RUN yum -y update && yum install -y epel-release
RUN yum -y install \
pytest \
python2-six \
python2-mock \
git \
GitPython \
python-requests \
PyYAML \
python2-cccolutils \
python2-koji \
python2-bugzilla \
python2-freezegun \
bodhi-client \
python-flake8 \
python2-fedora \
python2-distro \
rpm-build
RUN yum clean all
WORKDIR /src
ENV PYTHONPATH "${PYTHONPATH}:./rpkg"
CMD ["python", "-m", "pytest" ,"test"]

View file

@ -1,6 +0,0 @@
argcomplete
openidc-client
python-bugzilla < 3.0.0
python-fedora
rpkg
six

13
tox.ini
View file

@ -1,17 +1,15 @@
[tox]
envlist = py27,py36,py39,py310,py311,py312,flake8,doc,bandit
envlist = py36,py39,py310,py311,py312,flake8,doc,bandit
[testenv]
sitepackages=false
basepython=
py27: {env:TOXPYTHON:python2.7}
py36: {env:TOXPYTHON:python3.6}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
py312: {env:TOXPYTHON:python3.12}
flake8: {env:TOXPYTHON:python3.6}
flake8python2: {env:TOXPYTHON:python2.7}
doc: {env:TOXPYTHON:python3}
bandit: {env:TOXPYTHON:python3}
@ -24,19 +22,10 @@ commands =
setenv=
PYCURL_SSL_LIBRARY=openssl
[testenv:py27]
deps =
-r{toxinidir}/requirements-py2.txt
-r{toxinidir}/tests-requirements.txt
[testenv:flake8]
deps = flake8
commands = python -m flake8 fedpkg/ test/
[testenv:flake8python2]
deps = flake8
commands = python -m flake8 fedpkg/ test/
[testenv:doc]
skip_install = True
deps =