Skip to content

Commit

Permalink
Dropped support for Python 3.5
Browse files Browse the repository at this point in the history
Details:

* Dropped support for Python 3.5. (Python 2.7 was never supported).

* 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 3.5
  from the .safety-policy.yml file.

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

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

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Oct 22, 2023
1 parent dab720f commit e416bf1
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 194 deletions.
37 changes: 6 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,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 @@ -62,16 +52,6 @@ jobs:
} \
], \
\"include\": [ \
{ \
\"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 @@ -92,22 +72,17 @@ jobs:
\"include\": [ \
{ \
\"os\": \"ubuntu-20.04\", \
\"python-version\": \"3.5\", \
\"python-version\": \"3.6\", \
\"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\" \
\"package_level\": \"latest\" \
}, \
{ \
\"os\": \"macos-latest\", \
\"python-version\": \"3.5\", \
\"python-version\": \"3.6\", \
\"package_level\": \"latest\" \
}, \
{ \
Expand All @@ -117,7 +92,7 @@ jobs:
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.5\", \
\"python-version\": \"3.6\", \
\"package_level\": \"latest\" \
}, \
{ \
Expand Down Expand Up @@ -240,7 +215,7 @@ jobs:
COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}"
COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}"
run: |
if ! [[ ${{ matrix.python-version }} =~ (3.4) ]]; then coveralls; fi
coveralls
- name: Run check_reqs
env:
PACKAGE_LEVEL: ${{ matrix.package_level }}
Expand Down
18 changes: 1 addition & 17 deletions .safety-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +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
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
47833:
reason: Fixed Click version requires Python>=3.6 and is used there
51457:
reason: Py package is no longer being 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 @@ -52,8 +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
60350:
reason: Fixed GitPython version 3.1.32 requires Python>=3.7 and is used there
60789:
Expand Down
20 changes: 3 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Supported OS platforms:
# Windows (native)
# Linux (any)
# macOS/OS-X
# macOS (OS-X)
#
# OS-level commands used by this Makefile (to be provided manually):
# On native Windows:
Expand All @@ -19,8 +19,8 @@
# rm, find, cp, env, sort, which, 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

# No built-in rules needed:
Expand Down Expand Up @@ -95,8 +95,6 @@ docker_registry := zhmcexporter

python_version := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('{}.{}'.format(sys.version_info[0], sys.version_info[1]))")
pymn := $(shell $(PYTHON_CMD) -c "import sys; sys.stdout.write('py{}{}'.format(sys.version_info[0], sys.version_info[1]))")
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))")

package_dir := $(package_name)
package_py_files := \
Expand Down Expand Up @@ -235,9 +233,6 @@ safety: safety_$(pymn).done

.PHONY: check_reqs
check_reqs: develop_$(pymn).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 @@ -249,24 +244,15 @@ 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."

safety_$(pymn).done: develop_$(pymn).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

.PHONY: test
test: develop_$(pymn).done $(pytest_cov_files)
Expand Down
51 changes: 15 additions & 36 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@ build>=0.5.0
pep517>=0.9.1

# Safety CI by pyup.io
# Safety is run only on Python >=3.6
safety>=2.2.0; python_version >= '3.6'
dparse>=0.6.2; python_version >= '3.6'
safety>=2.2.0
dparse>=0.6.2

# Unit test (imports into testcases):
# pytest 4.3.1 solves an issue on Python 3 with minimum package levels
pytest>=4.3.1; python_version <= '3.6'
pytest>=4.3.1; python_version == '3.6'
pytest>=4.4.0; python_version >= '3.7' and python_version <= '3.9'
pytest>=6.2.5; python_version >= '3.10'
importlib-metadata>=0.12,<5.0.0; python_version <= '3.7'
importlib-metadata>=1.1.0; python_version >= '3.8'

# packaging is used by pytest, pip-check-reqs, sphinx
# packaging>=20.5 is needed by pip-check-reqs 2.4.3 but it requires only packaging>=16.0
# packaging 21.0 removed support for Python <3.6
packaging>=20.5; python_version <= '3.5'
packaging>=21.0; python_version >= '3.6'
packaging>=21.0

# Virtualenv
# build requires virtualenv.cli_run which was added in 20.1
Expand All @@ -52,77 +49,59 @@ pyflakes>=2.4.0; python_version >= '3.10'
entrypoints>=0.3.0

# PyLint (no imports, invoked via pylint script)
# Pylint is not run on py27 anymore
# Pylint requires astroid
# Pylint 1.x / astroid 1.x supports py27 and py34/35/36
# Pylint 2.0 / astroid 2.0 removed py27, added py37
# Pylint 2.4 / astroid 2.3 removed py34
# Issue #2673: Pinning Pylint to <2.7.0 is a circumvention for Pylint issue
# https://github.com/PyCQA/pylint/issues/4120 that appears in Pylint 2.7.0.
# Pylint 2.10 has fixed the issue.
# Pylint 2.7.0 fixes safety issue 39621
# Pylint 2.13.0 fixes safety issue 45185
pylint>=2.5.2,<2.7.0; python_version == '3.5'
pylint>=2.13.0,<2.14.0; python_version == '3.6'
pylint>=2.13.0; python_version >= '3.7' and python_version <= '3.10'
pylint>=2.15.0; python_version >= '3.11'
astroid>=2.4.0,<2.6.0; python_version == '3.5'
astroid>=2.11.0; python_version >= '3.6' and python_version <= '3.10'
astroid>=2.11.0; python_version <= '3.10'
astroid>=2.12.4; python_version >= '3.11'
typed-ast>=1.4.0,<1.5.0; python_version >= '3.6' and python_version < '3.8' and implementation_name=='cpython'
typed-ast>=1.4.0,<1.5.0; python_version <= '3.7' and implementation_name=='cpython'
# lazy-object-proxy is used by astroid
lazy-object-proxy>=1.4.3; python_version >= '3.5'
wrapt>=1.11.2; python_version >= '3.5' and python_version <= '3.10'
lazy-object-proxy>=1.4.3
wrapt>=1.11.2; python_version <= '3.10'
wrapt>=1.14; python_version >= '3.11'
# platformdirs is used by pylint starting with its 2.10
platformdirs>=2.2.0; python_version >= '3.6'
# isort 5.0.0 removed support for py27,py35
platformdirs>=2.2.0
# isort 4.2.8 fixes a pylint issue with false positive on import order of ssl on Windows
# isort 4.3.8 fixes an issue with py310 and works on py310 (Note that isort 5.10.0 has official support for py310)
isort>=4.3.8
# Pylint 2.14 uses tomlkit>=0.10.1 and requires py>=3.7
tomlkit>=0.10.1; python_version >= '3.7'
# dill is used by pylint >=2.13
dill>=0.2; python_version >= '3.6' and python_version <= '3.10'
dill>=0.2; python_version <= '3.10'
dill>=0.3.6; python_version >= '3.11'

# Sphinx (no imports, invoked via sphinx-build script):
# Keep in sync with rtd-requirements.txt
# Sphinx 4.0.0 breaks autodocsumm and needs to be excluded
# Sphinx <4.3.0 requires docutils <0.18 due to an incompatibility
# Sphinx 3.0.4 fixes safety issues 45775,38330
Sphinx>=3.5.4,!=4.0.0,<4.3.0; python_version <= '3.9'
Sphinx>=4.2.0; python_version >= '3.10'
docutils>=0.13.1,<0.17; python_version >= '3.5' and python_version <= '3.9'
docutils>=0.13.1,<0.17; python_version <= '3.9'
docutils>=0.14,<0.17; python_version == '3.10'
docutils>=0.16,<0.17; python_version >= '3.11'
sphinx-git>=10.1.1
# GitPython 3.1.30 fixes safety issues 52322,52518
GitPython>=2.1.1; python_version <= '3.6'
GitPython>=2.1.1; python_version == '3.6'
GitPython>=3.1.37; python_version >= '3.7'
sphinxcontrib-fulltoc>=1.2.0
sphinxcontrib-websupport>=1.1.2
# Pygments 2.7.4 fixes safety issues 50885,50886
Pygments>=2.7.4; python_version <= '3.6'
Pygments>=2.7.4; python_version == '3.6'
Pygments>=2.15.0; python_version >= '3.7'
sphinx-rtd-theme>=1.0.0
# Babel 2.7.0 fixes an ImportError for MutableMapping which starts failing on Python 3.10
# Babel 2.9.1 fixes safety issue 42203
Babel>=2.9.1

# Twine (no imports, invoked via twine script):
twine>=1.15.0; python_version == '3.5'
twine>=3.0.0; python_version >= '3.6'
twine>=3.0.0
# readme-renderer (used by twine, uses Pygments)
# readme-renderer 25.0 or higher is needed to address issue on Windows with py39
readme-renderer>=25.0

# Package dependency management tools (not used by any make rules)
pipdeptree>=2.2.0
# pip-check-reqs is not used on Python 2.7
# pip-check-reqs 2.3.2 is needed to have proper support for pip<21.3.
# pip-check-reqs 2.4.0 requires Python>=3.8.
# pip-check-reqs 2.4.3 fixes a speed issue on Python 3.11 and requires pip>=21.2.4
# pip-check-reqs 2.5.0 has issue https://github.com/r1chardj0n3s/pip-check-reqs/issues/143
pip-check-reqs>=2.3.2; python_version >= '3.5' and python_version <= '3.7'
pip-check-reqs>=2.3.2; python_version <= '3.7'
pip-check-reqs>=2.4.3,!=2.5.0; python_version >= '3.8'
2 changes: 1 addition & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Supported environments
----------------------

* Operating systems: Linux, macOS, Windows
* Python versions: 3.5 and higher
* Python versions: 3.6 and higher
* HMC versions: 2.11.1 and higher

Quickstart
Expand Down

0 comments on commit e416bf1

Please sign in to comment.