[Distutils] PBR/distutils2 with pep517 Support Was: Conditionless setup.py
Chris Barker
chris.barker at noaa.gov
Mon Aug 28 12:43:04 EDT 2017
I've thought for ages that we could transition to a more sane system by
convention:
"your setup.py, after being imported, will have a "setup_params" attribute
that is a dict that can be passed to setup()."
So tools that want metadata, etc. without actually running an install could
do;
import setup
name = setup.setup_params['name']
requirements = setup.setup_params['install_requires']
etc...
i.e -- it does need to run the code in setup.py, but it does NOT need to
run setup install, or build, or whatever else.
A typical simple setup.py with static meta-data would be:
from setuptools import setup
setup_params = {name:'sample',
version:'1.2.0',
description:'A sample Python project',
url:'https://github.com/pypa/sampleproject',
author:'The Python Packaging Authority',
license:'MIT',
packages:['the_package'],
install_requires=['peppercorn'],
...
}
setup(**setup_params)
But a setup.py could still have arbitrary code to build up the dict of
parameters if need be.
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170828/db1a0620/attachment.html>
More information about the Distutils-SIG
mailing list