Skip to content

Python2 support dropped but installation works #1502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonasdlindner opened this issue Jun 29, 2021 · 1 comment · Fixed by #1521
Closed

Python2 support dropped but installation works #1502

jonasdlindner opened this issue Jun 29, 2021 · 1 comment · Fixed by #1521
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jonasdlindner
Copy link
Contributor

jonasdlindner commented Jun 29, 2021

What happened (please include outputs or screenshots):
I have accidentally installed the git-Master-Branch with Python2 with these commands:

git clone --recursive https://github.com/kubernetes-client/python.git
cd python
python setup.py install

Everything works fine, but Python2 support is dropped (#1468)

What you expected to happen:
I expect an error Message like:

  File "setup.py", line 30, in <module>
    raise RuntimeError("kubernetes-client " + CLIENT_VERSION + " requires Python 3.6+")
RuntimeError: kubernetes-client 18.0.0-snapshot requires Python 3.6+

How to reproduce it (as minimally and precisely as possible):
See in "What happened".
You may have to use python2 setup.py install if python --v is not 2

Anything else we need to know?:
A possible fix in setup.py would be

import sys

from setuptools import setup

# Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh.
CLIENT_VERSION = "18.0.0-snapshot"
PACKAGE_NAME = "kubernetes"
DEVELOPMENT_STATUS = "3 - Alpha"

# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

if sys.version_info < (3, 6):
    raise RuntimeError("kubernetesclient " + CLIENT_VERSION + " requires Python 3.6+")

There is also some Python2 compatibility code in the python/ and python-base repo
For example:

Environment:

  • Kubernetes version (kubectl version):
    v1.19.0
  • OS (e.g., MacOS 10.13.6):
    Fedora 29 (Workstation Edition)
  • Python version (python --version)
    Python 2.7.17
  • Python client version (pip list | grep kubernetes)
    18.0.0-snapshot
@jonasdlindner jonasdlindner added the kind/bug Categorizes issue or PR as related to a bug. label Jun 29, 2021
@roycaihw
Copy link
Member

Thanks for reporting. Would you mind opening a PR with the change you suggested? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants