bazel-distribution icon indicating copy to clipboard operation
bazel-distribution copied to clipboard

[assemble-pip] Add python_requires to limit package to python 3 only

Open caseyduquettesc opened this issue 2 years ago • 0 comments

What is the goal of this PR?

Produce pip distributions that aren't available to python 2 users (or any arbitrary python version)

What are the changes implemented in this PR?

Adds a python_requires attribute to assemble_pip passed through to setup.py as defined in https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#python-requires

For example,

assemble_pip(
    ...
    python_requires = ">=3",
)

should produce a setup.py that makes the package unavailable to users of python 2.

Also fixes an error in the assemble script if the package is empty.

caseyduquettesc avatar Jul 15 '22 04:07 caseyduquettesc