[Distutils] One package for both python and jython
P.J. Eby
pje at telecommunity.com
Fri Nov 20 03:36:34 CET 2009
At 04:40 PM 11/19/2009 +0100, Fabrizio Pollastri wrote:
>the source structure is the following.
>
> my_package_source_dir/
> common_files
> files_for_python
> files_for_jython
>
>It will be a maximum, if distutils let me to reach the following goals.
>
>1. python/jython setup.py sdist command has to build the
>distribution tar my_package.tar.gz containing all files required by
>python and by jython.
>
>2. python setup.py install command has to install in the python package tree
>
> my_package_source_dir/
> common_files
> files_for_python
>
>3. jython setup.py install command has to install in the jython package tree
>
> my_package_source_dir/
> common_files
> files_for_jython
>
>It is possible to implement this behavior with the setup function of
>distutils?
As long as the Python and Jython files are distinct packages or
distinct top-level modules, you can simply pass different parameters
to setup(), based on which platform you're on. (Specifically,
changing the 'packages' and 'py_modules' parameters.)
(If you have to have different versions of the *same* packages or
modules, it's a bit more difficult and the directory layout is more
complex, but it can still be done.)
More information about the Distutils-SIG
mailing list