From 71f4e515e23f99d5e8e84d4f9d7822483e3d64ca Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: May 28 2024 17:50:03 +0000 Subject: 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 --- diff --git a/Jenkinsfile b/Jenkinsfile index 4603a84..b4eaa28 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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" diff --git a/MANIFEST.in b/MANIFEST.in index edd6760..c45a14b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include requirements.txt -include requirements-py2.txt include tests-requirements.txt global-exclude *.pyc diff --git a/Makefile b/Makefile index 4668b9a..a935264 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.rst b/README.rst index 33df8ca..cf00db5 100644 --- a/README.rst +++ b/README.rst @@ -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``. diff --git a/jenkins_test_py2.dockerfile b/jenkins_test_py2.dockerfile deleted file mode 100644 index 75c2e22..0000000 --- a/jenkins_test_py2.dockerfile +++ /dev/null @@ -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"] diff --git a/requirements-py2.txt b/requirements-py2.txt deleted file mode 100644 index de6c73a..0000000 --- a/requirements-py2.txt +++ /dev/null @@ -1,6 +0,0 @@ -argcomplete -openidc-client -python-bugzilla < 3.0.0 -python-fedora -rpkg -six diff --git a/tox.ini b/tox.ini index 1f5b36e..cafff3b 100644 --- a/tox.ini +++ b/tox.ini @@ -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 =