[Distutils] Alternate static metadata PEP submission...

David Lyon david.lyon at preisshare.net
Fri Oct 16 06:35:07 CEST 2009

On Fri, 16 Oct 2009 12:22:20 +0900, David Cournapeau wrote:
> The problem is a bit more complicated, because it cannot be handled in
> one single section.

I really appreciate you sharing this challenge with me.

I'm really convinced that I can "tweak" something to make it work. And
now is a really good time for me to examine it because I'm coding now.

Let me post how the code is looking:

    def main():
        # -- Return Code
        rc = 0
        # -- Check for our config file
        if not os.path.exists(setupconfigname):
            logger.error("No %s file found. Installation is unable to
proceed" % setupconfigname)

            # -- See what our platform is
            # -- Work out where to copy files to
            # -- Load basic install information
            # -- Process python package dependencies

            # -- Build a list of all the files that need to be copied
            # -- Check that all the files in the copy list exist and are
ready for copying
            # -- Run preinstall scripts

            # -- Copy files to the local system
            # -- Adjust the python configuration

            # -- Update platform links/shortcuts

            # -- Run postinstall scripts
            rc = 1
        return rc

So let's just take what you wrote step by step..

> You need to detect cython (configuration stage)

cython is a type of python interpretor? like jython or ironpython

Assuming yes, 

> you need to modify the extensions sources depending on this, and you need
> install different files depending on this:

scripts = artisticflairgui.py

[Application cython]
scripts = artisticflairguicython.py

That's a different file being installed if we detect we are using cython
and not python.

Since we are copying files "out", like we used to do, we can include
all the files that we need in our package. Only the files needed for
the local platform end up getting copied.

> it touches at least config,
> build_ext and install commands to use the distutils terminology.

scripts = buildit.py

[postinstall cython]
scripts = builtitspecialforcython.py

[postinstall jython]
scripts = builtitspecialforjython.py

[postinstall ironpython]
scripts = killvistaupgradetowin7.py

> This is similar to my main complain about distutils: you can't easily
> share data between commands. AFAIK, the only way to do it is to use the
> Distribute class instance, which is problematic as that's what most
> tools on top of distutils need to monkey-patch.

It seems to be a really unusual (for me) problem. But I don't dispute
that its a real problem. I don't follow all the python spin offs
but I agree that they need to be. Hence, they need bits (constants).

I just hope I'm understanding the problem the right way.

Maybe next week I might even have something that can be tried to see
if it will work. I'm busy coding now, so you asked at a good time.


More information about the Distutils-SIG mailing list