Skip to content

Use setup.cfg rather than setup.py.#96

Closed
Steap wants to merge 1 commit into
pypa:mainfrom
Steap:use-setup-cfg
Closed

Use setup.cfg rather than setup.py.#96
Steap wants to merge 1 commit into
pypa:mainfrom
Steap:use-setup-cfg

Conversation

@Steap
Copy link
Copy Markdown

@Steap Steap commented Jun 9, 2019

A setup.cfg is cleaner, is easy to parse, and does not require running
any Python code. Its usage should be showcased.

A setup.cfg is cleaner, is easy to parse, and does not require running
any Python code. Its usage should be showcased.
@Steap
Copy link
Copy Markdown
Author

Steap commented Jun 9, 2019

So, setuptools >= 40.5.0 is required to use the "options.data_files" section. I wonder why it fails with the 3.5 image, and not the 2.7, 3.4 and 3.6 images. Any idea?

@dmtucker
Copy link
Copy Markdown
Contributor

dmtucker commented Jun 9, 2019

@Steap Maybe because 3.5 is the only version not using pip-9.0.1?

@Steap
Copy link
Copy Markdown
Author

Steap commented Jun 10, 2019

@dmtucker Hm, setuptools 41.0.1 seems to be installed anyway. Why would not using pip-9.0.1 be an issue?

@4383
Copy link
Copy Markdown

4383 commented Jun 14, 2019

Duplicated with #57 maybe we can find a way to introduce these changes together by merging delta between your changes and mine.

I've propose these changes too early.

@Gadgetoid
Copy link
Copy Markdown

Gadgetoid commented Jul 4, 2019

If you were to build a wheel from project such as this from source, with an older version of setuptools installed then it would quietly, and happily output UNKNOWN-0.0.0-py2-none-any.whl

Since there are releases of Raspbian on the Pi that ship very old setuptools packages, I'm adopting a pattern like the below to catch that edge case. I wonder if it fits here too?

from setuptools import setup, __version__
from pkg_resources import parse_version

minimum_version = parse_version('30.4.0')

if parse_version(__version__) < minimum_version:
    raise RuntimeError("Package setuptools must be at least version {}".format(minimum_version))

setup(
    install_requires=['setuptools>={}'.format(minimum_version)]
)

Note - updated code snippet with tweaks/fix from pimoroni/boilerplate-python@0060d76

@jaraco
Copy link
Copy Markdown
Member

jaraco commented Jul 5, 2019

You definitely don't want install_requires declared there. In fact, that might interfere with install_requires declared in setup.cfg. I do think it may be worthwhile to fail fast when setuptools 30.4 isn't present.

Base automatically changed from master to main January 21, 2021 18:40
@pfmoore pfmoore closed this in #166 Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants