On Tue, 18 Aug 2009 06:06:29 +0300, Alex Grönholm
<alex.gronh...@nextday.fi> wrote:
   
> That scheme does not allow me to say "This dependency is required unless 
> platform is X". A practical example of this is Beaker, where pycryptopp 
> is required for cookie encryption, but works without external 
> dependencies on Jython.

Yes, I follow..

That's why I'm so keen on having a pre_setup() and a post_setup()
user routine, where the environment and dependencies can be exposed.

I can't see any easy way to do conditional logic in a config file.

imho it just has to go in code.. and it is as simple as that - haha

for example (demonstration code - not runnable):

"""
from distutils.core import setup

def pre_setup():
    if sys.platform() == "linux2":
        self.dependencies.append("pycryptopp")
    return

setup()
"""

So, one could modify the dependencies dynamically based
on the underlying platform.

Dependencies is a list of packages within the setup class. So
the user can add or remove items before the actual setup() is
done.

> Also, how do I define that this package has a minimum (or maximum) 
> required Python version?

[Python_versions]
minimum_supported=2.3
maximum_supported=2.7

We can't tell a user it won't work - only that it isn't supported.

> Or that the distribution is only applicable to a certain platform (say, 
> win32 or java)?

[Platforms]
supported1=linux2
supported2=mac
supported3=win32,win64

I think we can let the developer specify what *is* supported, and if it
doesn't 
match then give the user the choice to proceed or not. (At their own risk)

David

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to