installing both packages and (sometimes) modules
For the spambayes project, I have a distutils setup that installs the 'spambayes' package. I also (for 2.2) want it to install copies of 'sets.py' and 'heapq.py' modules into site-packages. Unfortunately distutils will let me have a 'packages' line, or a 'py_modules' line, but not both. Is there an easy way to do this that doesn't involve subclassing a distutils command? Anthony -- Anthony Baxter <anthony@interlink.com.au> It's never too late to have a happy childhood.
Anthony Baxter <anthony@interlink.com.au> writes:
For the spambayes project, I have a distutils setup that installs the 'spambayes' package. I also (for 2.2) want it to install copies of 'sets.py' and 'heapq.py' modules into site-packages. Unfortunately distutils will let me have a 'packages' line, or a 'py_modules' line, but not both. Is there an easy way to do this that doesn't involve subclassing a distutils command?
Not that I know of, but why not use a sublass: ---------- from distutils.command import build_py class my_build_py(build_py.build_py): def run (self): if not self.py_modules and not self.packages: return if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.byte_compile(self.get_outputs(include_bytecode=0)) # run () if __name__ == '__main__': setup(... cmdclass = {"build_py": my_build_py}, ...) ---------- Thomas
Anthony Baxter wrote:
For the spambayes project, I have a distutils setup that installs the 'spambayes' package. I also (for 2.2) want it to install copies of 'sets.py' and 'heapq.py' modules into site-packages. Unfortunately distutils will let me have a 'packages' line, or a 'py_modules' line, but not both. Is there an easy way to do this that doesn't involve subclassing a distutils command?
I managed to do something like that by doing this: packages = <list of packages> package_dir = <dict of package dirs> if <need to install extra stuff>: packages.append('') package_dir[''] = 'DirContainingExtraTopLevelModules' setup( ... packages = packages, package_dir = package_dir, ) It's still a kludge, as you can only have one such directory. Just
participants (3)
-
Anthony Baxter
-
Just van Rossum
-
Thomas Heller