Skip to content

Commit

Permalink
Dropped Python 2.7 and 3.5 support; Removed licenses from dep files
Browse files Browse the repository at this point in the history
Details:

* Dropped support for Python 2.7 and 3.5.

* Removed the dependency on the 'six' package from the code and moved
  the dependency to the development requirements file because it is
  still used by other packages (including zhmcclient).

* Removed ignored safety issues that apply only to Python 2.7 and 3.5
  from the .safety-policy.yml file.

* Removed Python 2.7 and 3.5 specific processing from the Makefile.

* Removed the mentioning of licenses in the requirements files.

* Removed the comments about the setuptools, pip, wheel packages
  from the requirements files.

Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed Oct 22, 2023
1 parent 0e064c6 commit a5fb3d6
Show file tree
Hide file tree
Showing 15 changed files with 133 additions and 495 deletions.
61 changes: 3 additions & 58 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,9 @@ jobs:
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.head_ref }}" =~ ^release_ ]]; then \
echo "matrix={ \
\"os\": [ \"ubuntu-latest\", \"macos-latest\", \"windows-latest\" ], \
\"python-version\": [ \"3.5\", \"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\" ], \
\"python-version\": [ \"3.6\", \"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\" ], \
\"package_level\": [ \"minimum\", \"latest\" ], \
\"exclude\": [ \
{ \
\"os\": \"ubuntu-latest\", \
\"python-version\": \"3.5\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"ubuntu-latest\", \
\"python-version\": \"3.5\", \
\"package_level\": \"latest\" \
}, \
{ \
\"os\": \"ubuntu-latest\", \
\"python-version\": \"3.6\", \
Expand All @@ -60,28 +50,6 @@ jobs:
} \
], \
\"include\": [ \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"2.7\", \
\"package_level\": \"minimum\", \
\"container\": {\"image\": \"python:2.7.18-buster\"} \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"2.7\", \
\"package_level\": \"latest\", \
\"container\": {\"image\": \"python:2.7.18-buster\"} \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.5\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.5\", \
\"package_level\": \"latest\" \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.6\", \
Expand All @@ -100,36 +68,14 @@ jobs:
\"python-version\": [ \"3.11\" ], \
\"package_level\": [ \"minimum\", \"latest\" ], \
\"include\": [ \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"2.7\", \
\"package_level\": \"minimum\", \
\"container\": {\"image\": \"python:2.7.18-buster\"} \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"2.7\", \
\"package_level\": \"latest\", \
\"container\": {\"image\": \"python:2.7.18-buster\"} \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.5\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.5\", \
\"package_level\": \"latest\" \
}, \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.6\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"macos-latest\", \
\"python-version\": \"3.5\", \
\"python-version\": \"3.6\", \
\"package_level\": \"latest\" \
}, \
{ \
Expand All @@ -139,7 +85,7 @@ jobs:
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.5\", \
\"python-version\": \"3.6\", \
\"package_level\": \"latest\" \
}, \
{ \
Expand Down Expand Up @@ -175,7 +121,6 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
if: ${{ ! ( matrix.python-version == '2.7' ) }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ ignore-patterns=^\.#
# on the module ignore list. For details, see
# https://bitbucket.org/logilab/pylint/issues/223/ignored-modules-should-turn-no-name-in
ignored-modules=distutils,
six,
builtins,
urllib,
lxml,
Expand Down Expand Up @@ -347,7 +346,7 @@ init-import=no

# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
redefining-builtins-modules=past.builtins,future.builtins,builtins,io


[FORMAT]
Expand Down
30 changes: 1 addition & 29 deletions .safety-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,16 @@ security:
# reason: {text} # optional: Reason for ignoring it. Will be reported in the Safety reports
# expires: {date} # optional: Date when this ignore will expire
ignore-vulnerabilities:
37504:
reason: Fixed Twine version requires Python>=3.6 and is used there
38330:
reason: Fixed Sphinx version requires Python>=3.5 and is used there
39611:
reason: PyYAML full_load method or FullLoader is not used
39621:
reason: Fixed Pylint version requires Python>=3.6 and is used there
40291:
reason: Fixed Pip version requires Python>=3.6 and is used there
42559:
reason: Fixed Pip version requires Python>=3.6 and is used there; Pip is not shipped with this package
reason: Fixed PyYAML versions 5.4 to 6.0.0 do not work with Cython 3, and the full_load method or FullLoader is not used
43975:
reason: Fixed Urllib3 versions are excluded by requests
45185:
reason: Fixed Pylint version requires Python>=3.6.2 and is used there
45775:
reason: Fixed Sphinx version requires Python>=3.5 and is used there
47833:
reason: Fixed Click version requires Python>=3.6 and is used there
50885:
reason: Fixed Pygments version requires Python>=3.5 and is used there
50886:
reason: Fixed Pygments version requires Python>=3.5 and is used there
51457:
reason: Py package will no longer be fixed (latest version 1.11.0)
51499:
reason: Fixed Wheel version requires Python>=3.7 and is used there; Risk is on Pypi side
52322:
reason: Fixed GitPython version requires Python>=3.7 and is used there
52365:
reason: Fixed Certifi version requires Python>=3.6 and is used there
52495:
reason: Fixed Setuptools version requires Python>=3.7 and is used there; Risk is on Pypi side
52518:
Expand All @@ -60,12 +38,6 @@ security:
reason: Fixed requests version 2.31.0 requires Python>=3.7 and is used there
58910:
reason: Fixed pygments version 2.15.0 requires Python>=3.7 and is used there
59956:
reason: Fixed certifi version 2023.07.22 requires Python>=3.6 and is used there
59910:
reason: Fixed sphinx version 3.3.0 requires Python>=3.5 and is used there
59925:
reason: Fixed sphinx version 3.3.0 requires Python>=3.5 and is used there
60350:
reason: Fixed GitPython version 3.1.32 requires Python>=3.7 and is used there
60789:
Expand Down
30 changes: 6 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
# One of these OS platforms:
# Windows with CygWin
# Linux (any)
# OS-X
# macOS (OS-X)
# These commands on all OS platforms:
# make (GNU make)
# bash
# rm, mv, find, tee, which
# These commands on all OS platforms in the active Python environment:
# python (or python3 on OS-X)
# pip (or pip3 on OS-X)
# python
# pip
# twine
# These commands on Linux and OS-X:
# These commands on Linux and macOS:
# uname
# Environment variables:
# PYTHON_CMD: Python command to use (OS-X needs to distinguish Python 2/3)
# PIP_CMD: Pip command to use (OS-X needs to distinguish Python 2/3)
# PYTHON_CMD: Python command to use
# PIP_CMD: Pip command to use
# PACKAGE_LEVEL: minimum/latest - Level of Python dependent packages to use
# Additional prerequisites for running this Makefile are installed by running:
# make develop
Expand Down Expand Up @@ -110,8 +110,6 @@ package_version := $(shell $(PYTHON_CMD) setup.py --version)
# Python versions
python_version := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('{v[0]}.{v[1]}.{v[2]}'.format(v=sys.version_info))")
pymn := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('py{v[0]}{v[1]}'.format(v=sys.version_info))")
python_m_version := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('{v[0]}'.format(v=sys.version_info))")
python_mn_version := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('{v[0]}.{v[1]}'.format(v=sys.version_info))")

# Directory for the generated distribution files
dist_dir := dist
Expand Down Expand Up @@ -441,30 +439,18 @@ $(bdist_file) $(sdist_file): _check_version Makefile MANIFEST.in $(dist_included

# TODO: Once PyLint has no more errors, remove the dash "-"
pylint_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(pylint_rc_file) $(check_py_files)
ifeq ($(python_m_version),2)
@echo "Makefile: Warning: Skipping Pylint on Python $(python_version)" >&2
else
@echo "Makefile: Running Pylint"
-$(call RM_FUNC,$@)
pylint $(pylint_opts) --rcfile=$(pylint_rc_file) --output-format=text $(check_py_files)
echo "done" >$@
@echo "Makefile: Done running Pylint"
endif

safety_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(safety_policy_file) minimum-constraints.txt
ifeq ($(python_m_version),2)
@echo "Makefile: Warning: Skipping Safety on Python $(python_version)" >&2
else
ifeq ($(python_mn_version),3.5)
@echo "Makefile: Warning: Skipping Safety on Python $(python_version)" >&2
else
@echo "Makefile: Running Safety"
-$(call RM_FUNC,$@)
safety check --policy-file $(safety_policy_file) -r minimum-constraints.txt --full-report
echo "done" >$@
@echo "Makefile: Done running Safety"
endif
endif

flake8_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Makefile $(flake8_rc_file) $(check_py_files)
-$(call RM_FUNC,$@)
Expand All @@ -473,9 +459,6 @@ flake8_$(pymn)_$(PACKAGE_LEVEL).done: develop_$(pymn)_$(PACKAGE_LEVEL).done Make

.PHONY: check_reqs
check_reqs: develop_$(pymn)_$(PACKAGE_LEVEL).done minimum-constraints.txt requirements.txt
ifeq ($(python_m_version),2)
@echo "Makefile: Warning: Skipping the checking of missing dependencies on Python $(python_version)" >&2
else
@echo "Makefile: Checking missing dependencies of this package"
pip-missing-reqs $(package_name) --requirements-file=requirements.txt
pip-missing-reqs $(package_name) --requirements-file=minimum-constraints.txt
Expand All @@ -487,7 +470,6 @@ else
@echo "Makefile: Checking missing dependencies of some development packages in our minimum versions"
@rc=0; for pkg in $(check_reqs_packages); do dir=$$($(PYTHON_CMD) -c "import $${pkg} as m,os; dm=os.path.dirname(m.__file__); d=dm if not dm.endswith('site-packages') else m.__file__; print(d)"); cmd="pip-missing-reqs $${dir} --requirements-file=minimum-constraints.txt"; echo $${cmd}; $${cmd}; rc=$$(expr $${rc} + $${?}); done; exit $${rc}
@echo "Makefile: Done checking missing dependencies of some development packages in our minimum versions"
endif
endif
@echo "Makefile: $@ done."

Expand Down
7 changes: 3 additions & 4 deletions base-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

# Base dependencies (must be consistent with minimum-constraints.txt)

pip>=10.0.1; python_version <= '3.5'
pip>=21.2.4; python_version >= '3.6'
setuptools>=39.0.1; python_version <= '3.6'
pip>=21.2.4
setuptools>=39.0.1; python_version == '3.6'
setuptools>=40.6.0; python_version == '3.7'
setuptools>=41.5.0; python_version >= '3.8' and python_version <= '3.9'
setuptools>=49.0.0; python_version >= '3.10'
wheel>=0.30.0; python_version <= '3.6'
wheel>=0.30.0; python_version == '3.6'
wheel>=0.32.0; python_version == '3.7'
wheel>=0.33.5; python_version >= '3.8'
Loading

0 comments on commit a5fb3d6

Please sign in to comment.