facebookresearch/fairseq

“python_requires” should be set with “>=3.6”, as fairseq 0.10.2 is not compatible with all Python versions.

Open

#4,245 opened on 2022年3月1日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Python (6,224 forks)batch import
enhancementhelp wantedneeds triage

Repository metrics

Stars
 (29,107 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

Currently, the keyword argument python_requires of setup() is not set, and thus it is assumed that this distribution is compatible with all Python versions. However, I found the following code checking Python compatibility locally in setup.py

if sys.version_info < (3, 6):
    sys.exit("Sorry, Python >= 3.6 is required for fairseq.")

I think it is a better way to declare Python compatibility by using the keyword argument python_requires than checking compatibility locally for some reasons:

  • Descriptions in python_requires will be reflected in the metadata
  • “pip install” can check such metadata on the fly during distribution selection, and prevent from downloading and installing the incompatible package versions.
  • If the user does not specify any version constraint, pip can automatically choose the latest compatible package version for users.

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

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

Thanks for your attention. Best regrads, PyVCEchecker

コントリビューターガイド