Setuptools Confusion
Rob Gaddi
rgaddi at technologyhighland.invalid
Mon Mar 30 14:11:21 EDT 2015
I'm having two issues trying to make setuptools do what I want to package
up an application. Well, actually I'm having many issues, but I'll start
with the two that are foremost right now.
First, I've got documentation in RestructuredText format that I want to
cook down to HTML to include in with the application. I've got a
make_docs.py that I can run to do that. I want to make sure that
make_docs is run prior to building the sdist package so that the docs in
the package are always up to date. I have no idea how to do that.
Secondly, I'm using QSettings to manage my application data, and would
like to create an .INI file (complete with comments and whatnot) in the
correct system-dependent location. Once again, I've got a function
already written that does this. I tried the only thing I could find on
StackOverflow, which was to overwrite the install method with:
from setuptools.command.install import install as _install
# Post-install hook
class post_install(_install):
def run(self):
_install.run(self)
from V120B.configuration import writeini
writeini()
setup(
...
# Use the post-install hook to provide the default .INI file.
cmdclass={
'install' : post_install
},
)
But I don't see the file getting created. Also, does this mean I'd also
have to hook develop separately?
I feel like both my questions come down to the same root; how do I hook
setuptools to do additional tasks at appropriate times? Is it really as
complicated as all this, or is there something trivial and stupid that
I'm just missing?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
More information about the Python-list
mailing list