From 194aa172ca5e9bbfe9596ccb365d8043576af233 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Apr 28 2021 08:56:46 +0000 Subject: Drop Python 2.6 support Removed Python 2.6 dependencies and mentions mostly from metadata and help files. Signed-off-by: Ondrej Nosek --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7e2a03..ee574a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,7 @@ For bigger or controversial changes, consider first discussing it via issue or any other method with the maintainers of this repository. Otherwise there's a risk they might disagree with it and you could spend time on it in vain. Or you can just open a Pull Request and keep the discussion there. -All code should work well with Python 3 and also be compatible with Python 2.6 -and 2.7. +All code should work well with Python 3 and also be compatible with Python 2.7. ## Sign Off diff --git a/README.rst b/README.rst index e98cadd..e09137a 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ This is the rpkg project, which mostly is a python library for dealing with rpm packaging in a git source control. pyrpkg is the base library that sites can subclass to create useful tools. -rpkg works with Python 2.6, 2.7, 3.6 and 3.9. +rpkg works with Python 2.7, 3.6 and 3.9. License ======= @@ -19,14 +19,14 @@ Install from distribution packages ---------------------------------- rpkg is available in Fedora and EPEL repositories. It can be installed with -package manager command. There is Python 3 package for Fedora and Python 2 -package in EPEL6/7 and Python 3 package for EPEL8. +package manager command. There is Python 3 package for Fedora and EPEL8; +and Python 2 package in EPEL7. Install in a Fedora system:: sudo dnf install python3-rpkg -Install in EPEL6 or EPEL7:: +Install in EPEL7:: sudo yum install python2-rpkg @@ -40,8 +40,8 @@ Install in a Python virtual environment Both Python 2 and 3 packages are published in PyPI. Install rpkg in a Python 3 virtual environment in these steps:: - python3 -m venv env - source env/bin/activate + python3 -m venv .env + source .env/bin/activate pip install rpkg rpm-py-installer You are free to create a virtual environment with option ``--system-site-packages``. @@ -61,7 +61,7 @@ Contribution ============ You are welcome to write patches to fix or improve rpkg. All code should work -with Python 2.6, 2.7, and 3. Before you create a PR to propose your changes, +with Python 2.7, and 3. Before you create a PR to propose your changes, make sure Sign-off commit diff --git a/requirements/pypi.txt b/requirements/pypi.txt index 6aeaee2..5f2fd2c 100644 --- a/requirements/pypi.txt +++ b/requirements/pypi.txt @@ -1,6 +1,4 @@ # List of Python packages that can be installed from PyPI. -# There are dependent packages for running with Python 2.6, and those will be -# handled in setup.py. cccolutils >= 1.4 GitPython diff --git a/setup.py b/setup.py index b74e044..deacfb9 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/python import os -import sys from setuptools import find_packages, setup @@ -35,15 +34,6 @@ install_requires, dep_links = read_requirements(pypi_txt) tests_require, test_dep_links = read_requirements(test_pypi_txt) dep_links += test_dep_links -ver = sys.version_info -if ver[0] <= 2 and ver[1] < 7: - install_requires += [ - 'argparse', - ] - tests_require += [ - 'unittest2' - ] - readme_rst = os.path.join(setup_py_path, 'README.rst') with open(readme_rst, 'r') as readme: long_description = readme.read().rstrip() @@ -61,14 +51,6 @@ setup( packages=find_packages(), setup_requires=['setuptools_scm', 'pytest-runner'], install_requires=install_requires, - extras_require={ - ':python_version=="2.6"': [ - 'PyYAML<=3.13', - ], - ':python_version>"2.6"': [ - 'PyYAML', - ], - }, tests_require=tests_require, dependency_links=dep_links, classifiers=[ @@ -79,7 +61,6 @@ setup( 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2 :: Only', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', diff --git a/tests/commands/__init__.py b/tests/commands/__init__.py index dcc0562..b5cff9e 100644 --- a/tests/commands/__init__.py +++ b/tests/commands/__init__.py @@ -4,7 +4,7 @@ import subprocess import sys import tempfile -# For running tests with Python 2.6 +# For running tests with Python 2 try: import unittest2 as unittest except ImportError: diff --git a/tests/test_retire.py b/tests/test_retire.py index 4d36680..d621ec4 100644 --- a/tests/test_retire.py +++ b/tests/test_retire.py @@ -11,7 +11,7 @@ from six.moves import configparser import pyrpkg.cli from pyrpkg.errors import rpkgError -# For running tests with Python 2.6 +# For running tests with Python 2 try: import unittest2 as unittest except ImportError: diff --git a/tests/utils.py b/tests/utils.py index b0934e0..0875cf3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -10,7 +10,7 @@ import six from pyrpkg import Commands -# For running tests with Python 2.6 +# For running tests with Python 2 try: import unittest2 as unittest except ImportError: