Hello, I am trying to upgrade a pure python package distribution based on distutils in such a way that it will work with both python and jython. Since my package depends on some part of python library when run by python and on some other part of jython library when run by jython, 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? There are other ways (please, no package split)? Any suggestion is welcome. Thank you in advance. Fabrizio Pollastri
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.)
participants (2)
-
Fabrizio Pollastri
-
P.J. Eby