[Distutils] Static metadata using setup.cfg

Tarek Ziadé ziade.tarek at gmail.com
Mon Sep 7 17:41:40 CEST 2009


On Mon, Sep 7, 2009 at 2:15 PM, Chris Withers<chris at simplistix.co.uk> wrote:
>> For example being able to express:
>>
>> "if the target python is version 2.6 the dependencies are ..."
>>
>> The goal is to be able to run that part on a vanilla Python. without
>> having to rely on the distribution's setup.py
>
> Seems like a bad goal to me.

Why ?

>
> I'd prefer setup.cfg to be totally static. If there are complicated
> if/then/else's needed, they should be in setup.py.

The template engine will be restricted to "if", and the expression
will be able to ^may only 3 values:

- the python version
- sys.platform
- os.name

>
> As soon as this file becomes dynamic, we're back in the situation where you
> can't tell what a package requires without installing it, which is something
> I'd really like to not have to do.
>

setup.cfg stays static. We're talking about the ability to add a
setup.cfg.in file,
that generates the setup.cfg file ***without having to run any third
party code***.

So again, this will not require any installation to run since transforming
a "setup.cfg.in" into a "setup.cfg" will just require a vanilla Python

to synthetize =

if exists(setup.cfg.in):
  setup.cfg = distutils.some_func(setup.cfg.in)
else:
  nothing

That's the whole point ! ;)

It means that people will be able to read the .cfg file, and if needed
to rebuild for their platform
without any installation required.

Eventually, PyPI can provide both (.cfg and .cfg.in) as metadata that a tool can
grab to see what's required for installation, *without installing the package*

Regards
Tarek

-- 
Tarek Ziadé | http://ziade.org | オープンソースの岩!


More information about the Distutils-SIG mailing list