Automagic Python Build System

Registered by Rick Spencer on 2009-04-16

One of Python's native and very popular build systems is "distutils" which comes shipped with Python itself. It is fairly limited, though, and requires the user to learn a lot about build systems. python-distutils-extra adds some functionality for i18n, but there are still some standard use cases missing.

In this blueprint we propose extending python-distutils-extra by a "do what I mean" mode where it automatically chooses the right destination path and action for various known file types such as Python modules, exectuable scripts, icons, desktop files, etc. The goal is that the typical setup.py only has to contain meta information like description, version, and author.

We also discuss Debian package generation.

Blueprint information

Status:
Complete
Approver:
Rick Spencer
Priority:
High
Drafter:
Martin Pitt
Direction:
Needs approval
Assignee:
Martin Pitt
Definition:
Approved
Series goal:
Accepted for karmic
Implementation:
Implemented
Milestone target:
None
Started by
Martin Pitt on 2009-05-27
Completed by
Martin Pitt on 2009-10-23

Related branches

Sprints

Whiteboard

Status:
implementation complete, just upstream proposition left (not bound by Ubuntu release cycle)

Work items:
add support for pykdeuic4 to p-distutils-extra: DONE
auto core code, collect files which are source: DONE
auto cmdclass: DONE
auto "packages": DONE
auto D-Bus configuration/service: DONE
auto PolicyKit: DONE
auto .notifyrc: DONE
auto supplementary data: DONE
auto cmdclass: DONE
auto scripts: DONE
auto POTFILES.in: DONE
automatic test cases for everything above (1): DONE
auto modules: DONE
auto manpages: DONE
auto requires: DONE
auto provides: DONE
auto MANIFEST.in: DONE
automatic test cases for everything above (2): DONE
evaluate van.pydeb: DONE
creation of debian/: DONE
upload to Debian/Ubuntu: DONE
send description and proposal to Python devel ML:
if above gets positive feedback from upstream, write PEP for distutils-extra file types to upstream distutils:
write release note and test plan: DONE

pitti, 2009-06-03: incorporated UDS session notes into wiki spec, ready for review now

doko, 2009-06-03: the spec doesn't address any of the concerns raised by foundation team members and barryw during the session

pitti, 2009-06-03: the main two concerns were: (1) get support for new file types upstream (spec mentions that), and (2) automatic values are incompatible with the python mantra; I appreciate that, but that's what we want for this "quickly" use case; I'm not going to urge upstream to take the automatic part. Were there any others?

rickspencer3 2009-06-04: I didn't see the use case of automagically creating a ppa called out in the spec, was that implicit, did I miss it? Also, is the only convention to create an appropriate setup.py file, or will certain directory structures, file names, etc... need to be assumed in order to make this work?

pitti 2009-06-04: PPA creation is outside of the scope of this blueprint (I just added a "Scope" section); first, it doesn't fit into the idea of an upstream build system, and second PPA management for Debian source package is not limited to packages created by Python distutils. Since these are orthogonal jobs, they should be handled by different tools. As for the conventions, the spec points out that most files are identified by extension/content, with the only exception being executable scripts (where the convention is to put them into ./bin/).

doko, 2009-06-04: (1) requires a pep, which should be part of the spec. it doesn't have to be approved but should be submitted.

pitti, 2009-06-04: added ".. as a PEP" to spec.

pitti, 2009-06-25: python-distutils-extra 2.0 with full upstream automatic build system uploaded to sid and Karmic. debian package generation still outstanding (see work items).

pitti, 2009-07-01: python-distutils-extra 2.3 with initial working python-mkdebian script uploaded to sid and Karmic. Testing and bug reports appreciated.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.