Maintainer Notes¶
Checkout from git (see Installing) and submit pull requests.
Committers can just push as desired: since all semantic development takes place in cPython, the backport process is as lightweight as we can make it.
mock is CI tested using Travis-CI on Python versions 2.6, 2.7, 3.3, 3.4, 3.5, nightly Python 3 builds, pypy, pypy3. Jython support is desired, if someone could contribute a patch to .travis.yml to support it that would be excellent.
NB: please use semver. Bump the major component on API breaks, minor on all non-bugfix changes, patch on bugfix only changes.
- tag -s, push –tags origin master
- setup.py sdist bdist_wheel upload -s
isinstance checks in cPython to type need to check ClassTypes. Code calling obj.isidentifier needs to change to _isidentifier(obj).
Patch your git am with my patch.
Install the applypatch-transform hook from tools/ to your .git hooks dir.
Configure a pre-applypatch hook to test at least all the cPython versions we support on each patch that is applied. I use containers, and a sample script is in tools/pre-applypatch.
Pull down the cPython git mirror: https://github.com/python/cpython.git
Export the new revisions since the Last sync at the top of this document:
revs=${lastsync} rm migrate-export git log --pretty="format:%H " $revs.. -- Lib/unittest/mock.py \ Lib/unittest/test/testmock/ > migrate-revs tac migrate-revs > migrate-sorted-revs for rev in $(< migrate-sorted-revs); do git format-patch -1 $rev -k --stdout >> migrate-export; done echo NEW SYNC POINT: $(git rev-parse HEAD)
Import into mock:
git am -k --reject $path-to-cpython/migrate-export
This will transform the patches automatically. Currently it will error on every NEWS change as I haven’t gotten around to making those patches automatic. Fixup any errors that occur. When the patch is ready, do a git add -u to update the index and then git am --continue to move onto the next patch. If the patch is inappropriate e.g. the patch removing __ne__ which would break older pythons, then either do git reset --hard; git am --skip to discard any partially applied changes and skip over it, or, if it has a NEWS entry thats worth preserving, edit it down to just that, with a note such as we have for the __ne__ patch, and continue on from there.
The goal is that every patch work at all times.
After the import is complete, update this document with the new sync point.
Push to a personal branch and propose a PR to the main repo. This will make Travis-CI test it. If it works, push to the main repo.