Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2010-12-03 06:27:32
Size: 2482
Editor: 185
Comment: Create
Revision 12 as of 2011-06-09 12:43:59
Size: 2177
Editor: 193
Comment: Update workflow to account for packaging merge
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Distutils/Fixing Bugs
Line 3: Line 4:
To implement new features without breaking third-party tools that rely on undocumented internals, distutils has been forked under the name distutils2 and developed outside of Python’s standard library, until it is complete enough to be merged back. To implement new features without breaking third-party tools that rely on undocumented internals, distutils has been forked under the name distutils2 and developed outside of Python’s standard library, until it was complete enough to be merged back.  In Python 3.3, distutils2 has been reintegrated, under the name packaging.
Line 5: Line 6:
While the fork lasts, bugs need to be fixed both in distutils (Python py3k, 3.1 and 2.7) and distutils2 (one branch only, but compatible with 2.4 up to 2.7). This page documents the workflow to follow for fixing bugs. Bugs that are found in distutils or packaging have to be checked in the other codebase. Distutils should be considered a maintenance branch of packaging; unless a bug is found only in distutils, it is recommended to fix bugs in packaging and let the maintainers backport if needed.
Line 10: Line 11:
Reports are filed in Python’s tracker, under two keywords: [[http://bugs.python.org/issue?@columns=title,id,activity,status&@sort=activity&@group=priority&@filter=components,status&@pagesize=150&@startwith=0&status=1&components=3&@dispname=distutils|distutils]] and [[http://bugs.python.org/issue?@columns=title,id,activity,status&@sort=activity&@group=priority&@filter=components,status&@pagesize=50&@startwith=0&status=1&components=25&@dispname=distutils2|distutils2]].  They will soon be all listed under distutils2 to make things easier. Reports are filed in Python’s tracker, under two keywords: [[http://bugs.python.org/issue?@columns=title,id,activity,status&@sort=activity&@group=priority&@filter=components,status&@pagesize=150&@startwith=0&status=1&components=3&@dispname=distutils|distutils]] and [[http://bugs.python.org/issue?@columns=title,id,activity,status&@sort=activity&@group=priority&@filter=components,status&@pagesize=50&@startwith=0&status=1&components=25&@dispname=distutils2|distutils2]].
Line 13: Line 14:
== Set up distutils2 == == Set up a developer enviromnent ==
Line 15: Line 16:
1) Install [[http://mercurial.selenic.com/|Mercurial]].

2) Get distutils2: hg clone http://bitbucket.org/tarek/distutils2

3) Optional: install [[http://www.python.org/download/releases/|older Pythons]] for testing.

4) Install unittest2 (pip install unittest2, hg clone http://hg.python.org/unittest2 + unittest2.pth file, wget + python setup.py install, whatever way you prefer)
Packaging is being developed in the main CPython repository. The [[http://docs.python.org/devguide|CPython Developers Guide]] contains all relevant information to set up Mercurial, clone CPython and run tests.
Line 28: Line 23:
Usual guidelines apply:

* http://www.python.org/dev/workflow/
* http://www.python.org/dev/faq/#how-to-test-a-patch
* http://www.python.org/dev/patches/ (minus the parted related to Subversion)
Line 37: Line 26:
Use one of those two possible ways:

a) Produce a diff with “hg diff -r <your last revision> -r <main repo last revision> > fix-something.diff”. Attach it to the bug report.

b) If you have one clean changeset, you can post a link to a public repository on the bug report.
You can produce a patch manually with hg diff or hg export, or use the [[http://docs.python.org/devguide/triaging#mercurial-repository|automated patch generation]] provided by the bug tracker.
Line 46: Line 31:
Reply to feedback about the changes, update your patch, ping the maintainers (bug tracker user names tarek and eric.araujo) as needed. Reply to feedback about the changes, update your patch, ping the maintainers (automatically subscribed to distutils and distutils2 bugs) as needed.
Line 51: Line 36:
Tarek or Éric will make sure the test suite passes with all supported version, push to the main repository, and backport to distutils. Tarek or Éric will make sure the test suite passes with all supported Python versions, push to the main repository, and backport to distutils if needed.

How to fix bugs in Distutils

To implement new features without breaking third-party tools that rely on undocumented internals, distutils has been forked under the name distutils2 and developed outside of Python’s standard library, until it was complete enough to be merged back. In Python 3.3, distutils2 has been reintegrated, under the name packaging.

Bugs that are found in distutils or packaging have to be checked in the other codebase. Distutils should be considered a maintenance branch of packaging; unless a bug is found only in distutils, it is recommended to fix bugs in packaging and let the maintainers backport if needed.

Find a bug

Reports are filed in Python’s tracker, under two keywords: distutils and distutils2.

Set up a developer enviromnent

Packaging is being developed in the main CPython repository. The CPython Developers Guide contains all relevant information to set up Mercurial, clone CPython and run tests.

Fix the bug

Ideally, the first step is to write a test that fails, thus demonstrating the bug, and then change the code to make the test pass.

Share the fix

You can produce a patch manually with hg diff or hg export, or use the automated patch generation provided by the bug tracker.

Iterate

Reply to feedback about the changes, update your patch, ping the maintainers (automatically subscribed to distutils and distutils2 bugs) as needed.

Profit

Tarek or Éric will make sure the test suite passes with all supported Python versions, push to the main repository, and backport to distutils if needed.

Distutils/FixingBugs (last edited 2011-07-04 15:21:33 by 193)

Unable to edit the page? See the FrontPage for instructions.