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 创建于 2022年3月1日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Python (6,224 fork)batch import
enhancementhelp wantedneeds triage

仓库指标

Star
 (29,107 star)
PR 合并指标
 (30 天内没有已合并 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

贡献者指南