[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: multiple modules in one source



On 12 December 2014 at 09:48, Ben Finney <ben+debian@benfinney.id.au> wrote:
Just about any non-trivial Python package (and some trivial ones) in
Debian will have many distinct modules.

Possibly I am getting my terminology confused.


You're familiar with ‘python-django’, as just one example. Including django.contrib, django.core, etc.

In the case of Django, everything is under the django module.
 

Do you mean “multiple distinct Python packages”?

Not sure calling it multiple distinct Python packages is correct, currently there is only one setup.py, and hence only one egg file produced.

e.g. package contains


setup.py
module1/__init__.py
module1/something.py
module2/__init__.py
module2/somethingelse.py
debian/rules
debian/control

etc.


As for Python source distributions: the ‘distutils’ library allows
nominating multiple top-level packages to build, and those can be
shipped in a single ‘sdist’ and appear in a single Debian source
package. Once built to a ‘bdist’, the resulting Python packages can be
built to distinct Debian binary packages. Often that makes sense.

Is this possible with dh --buildsystem=pybuild?
 

I guess another possibility would be to have multiple python packages, but commit everything in one git tree, e.g.:

package1/setup.py
package1/module1/__init__.py
package1/module1/something.py
package2/setup.py
package2/module1/__init__.py
package2/module1/something.py
debian/rules
debian/control

Wonder how to do this with dh and pybuild? Would the following be sane?

%:
        dh $@ --with python2,python3 --buildsystem=pybuild --dir=package1
        dh $@ --with python2,python3 --buildsystem=pybuild --dir=package2

(unfortunately the --dir parameter doesn't appear have any effect; lets pretend I worked out the correct command line option to do this)


An example of a single source repository which contains multiple
distinct Python packages is Docutils. The ‘python-docutils’ Debian
source package builds Debian binary packages ‘python-docutils’,
‘python-roman’, and the Python 3 equivalents.

Looking at the wheezy version, it appears debian/rules was written entirely by hand, something I would like to try to avoid if possible. It also uses dh_pysupport which is considered obsolete.

If I understand it correctly, it just grabs the roman.py file installed by ./setup.py and puts it into a package all by itself.

Reply to: