introspecting package data
Hi All, I hope this is a silly question and I'm just missing something, but how do I introspect information from setup.py when I'm not using setuptools? (ie: pkg_resources for those who refuse to drink the setuptools koolaid?) cheers, Chris
On Tue, Jun 30, 2009 at 1:59 PM, Chris Withers<chris@simplistix.co.uk> wrote:
What do you want to do exactly ? And do you do it with setuptools ? If it's about setup.py I'm guesssing it's done on a distribution source, not an installed source ?
-- Tarek Ziadé | http://ziade.org
2009/6/30 Chris Withers <chris@simplistix.co.uk>:
Yes, as long as the metadata are in a python file, you're in trouble to automate anything like you are mentioning. But a static metadata system needs to provide a registery mechanism, so we can call some arbitrary code when some metadata are generated at installation time for instance. In any case, one of the goal we have is to move to a static-based metadata solution. This work has been initiated at Pycon by Tres and Matthias, see the notes here http://wiki.python.org/moin/Distutils/StaticMetadata if you guys want to start filling your ideas in this page, below Tres's notes, this would be helpfull This is the "next" big topic I guess, after PEP 376, PEP 386, and PEP 345 extension. Tarek
Tarek Ziadé wrote:
I don't follow this at all. Why is arbitrary code needed? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Mon, 06 Jul 2009 19:52:38 +0100, Chris Withers <chris@simplistix.co.uk> wrote:
I think what he means is that he doesn't like the way it is at the moment and thinks that the version numbers and other metadata should sit in a config file somewhere. Then the setup.py can be generated from the metadata.. David
David Lyon wrote:
No, that's not what Tarek said at all, perhaps he can comment on why a static metadata system needs to provide a registry mechanism so that arbitrary code can be called? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers <chris@simplistix.co.uk> writes:
ohpleaseohpleaseohpleaseohplease -- \ “My business is to teach my aspirations to conform themselves | `\ to fact, not to try and make facts harmonise with my | _o__) aspirations.“ —Thomas Henry Huxley, 1860-09-23 | Ben Finney
On Tue, 30 Jun 2009 14:24:30 +0100, Chris Withers <chris@simplistix.co.uk> wrote:
It's such a good point... Maybe I have it wrong and don't know something... but I take it you're talking about the information we already have to put in the setup.py..... --setup.py---------------------------- #!/usr/bin/env python from distutils.core import setup setup(name='myproject', version='0.11', description='myPetProject', author='James Smith', author_email='smith@nowhere.net', url='http://www.yahoo.net/pet', scripts=['petproject.py'], data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), ('config', ['cfg/data.cfg']), ('/etc/init.d', ['init-script'])] classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: End Users/Desktop', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Python Software Foundation License', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: Communications :: Email', 'Topic :: Office/Business', 'Topic :: Software Development :: Bug Tracking', ], ) -------------------------------------- Yes, it would be cool to be able to read this out and autoupdate the build/version numbers..... Regards David
On Tue, 30 Jun 2009 15:45:56 +0100, Chris Withers wrote:
Well, there could be many reasons for that.... I'd say that writing the code to accomplish what you want is trivial. We could just write a script that: - reads the setup.py, - takes out the "from distutils.core.." - replace it with something else... - use the metadata (already in memory) to - update whatever it is in sphinx (?conf.py) - write that file as an 'updatesphinx.py' or whatever - run it and bingo Surely at some point, integrating sphinx into distutils has got to get on the roadmap.... (???) What project doesn't need better documentation? What better python tool is there than sphinx? How good would it be if all projects had sphinx based documentation. So it leaves me with the question - why not? (maybe nobody is listening - haha) David
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Withers wrote:
This package might help: http://pypi.python.org/pypi/pkginfo It uses the PKG-INFO files in "develop eggs," built distributions and / or installed packages (Python 2.6+), rather than setup.py. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKSl3a+gerLs4ltQ4RApYTAKDJfZ/vtwQZ8lF0MvXopYDMFMHAFQCfbBkh 1UqiyOMKyMRpqLWXSijJHYo= =Ywzx -----END PGP SIGNATURE-----
participants (6)
-
Ben Finney
-
Chris Withers
-
David Lyon
-
Jim Fulton
-
Tarek Ziadé
-
Tres Seaver