ucfopen / canvasapi

Python API wrapper for Instructure's Canvas LMS. Easily manage courses, users, gradebooks, and more.
https://pypi.python.org/pypi/canvasapi
MIT License
561 stars 175 forks source link

setting “python_requires” with ">=3.7" is a better way to declare Python compatibility #570

Open PyVCEchecker opened 2 years ago

PyVCEchecker commented 2 years ago

Hello!

I noticed the code snippet in setup.py

# Get the PyPI package info from the readme
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
    long_description = f.read()

setup.py used a Python3-specific keyword argument encoding for the function open, which lead to installation failure of Inject in Python 2. And there is such a declaration.

  classifiers=[
      ...
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        ...
    ]

I guess you want to set python>=3.7. And I think it is a better way to declare Python compatibility by using the keyword argument python_requires

Way to improve: modify setup() in setup.py, add python_requires keyword argument:

setup(…
     python_requires=">=3.7",
     …)

Thanks for your attention. Best regrads, PyVCEchecker