Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Capsule migration documentation to "cporting" #57262

Closed
larryhastings opened this issue Sep 28, 2011 · 14 comments
Closed

Add Capsule migration documentation to "cporting" #57262

larryhastings opened this issue Sep 28, 2011 · 14 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@larryhastings
Copy link
Contributor

BPO 13053
Nosy @rhettinger, @ncoghlan, @larryhastings, @ezio-melotti, @encukou
Files
  • larry.cporting.capsules.r1.diff
  • larry.cporting.capsules.r2.diff: revision 2 of my patch
  • larry.cporting.capsules.r3.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/larryhastings'
    closed_at = <Date 2012-02-29.00:31:58.740>
    created_at = <Date 2011-09-28.15:37:27.908>
    labels = ['type-feature', 'docs']
    title = 'Add Capsule migration documentation to "cporting"'
    updated_at = <Date 2015-09-08.11:26:48.461>
    user = 'https://github.com/larryhastings'

    bugs.python.org fields:

    activity = <Date 2015-09-08.11:26:48.461>
    actor = 'petr.viktorin'
    assignee = 'larry'
    closed = True
    closed_date = <Date 2012-02-29.00:31:58.740>
    closer = 'larry'
    components = ['Documentation']
    creation = <Date 2011-09-28.15:37:27.908>
    creator = 'larry'
    dependencies = []
    files = ['23282', '23301', '23315']
    hgrepos = []
    issue_num = 13053
    keywords = ['patch']
    message_count = 14.0
    messages = ['144567', '144581', '144724', '144725', '144786', '144793', '144794', '144928', '145253', '154411', '154584', '154586', '154587', '250183']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'ncoghlan', 'larry', 'ezio.melotti', 'petr.viktorin', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue13053'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @larryhastings
    Copy link
    Contributor Author

    After the great Capsule flame wars of 2011, it became clear that we need documentation on migrating from CObject to Capsules, as CObject is gone as of 3.2. Nick made me promise to write the documentation, and Raymond steered me in the direction of "cporting.rst" (Porting Extension Modules To Python 3.0).

    I already have a patch in reasonable shape. However, I understand we're doing "forward-porting" (what Monotone calls "daggy fixes"). I think this would be valuable information for 2.7 users. It includes no code changes (though it does include some sample code). Would checking it in to the 2.7 head be appropriate? Once we decide where the checkin should go, I'll produce a patch against that head that will hopefully garner your approval.

    @larryhastings larryhastings self-assigned this Sep 28, 2011
    @larryhastings larryhastings added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Sep 28, 2011
    @ezio-melotti
    Copy link
    Member

    I think it's fine to include it in 2.7.

    @larryhastings
    Copy link
    Contributor Author

    Attached is a patch against trunk branch "2.7" (rev dec00ae64ca8) adding documentation on how to migrate CObjects to Capsules. Delta the inevitable formatting bikeshedding, this should be ready to go. I've smoke-tested the "capsulethunk.h" locally and it works fine.

    When accepted, I'll check this in to the 2.7 branch, then merge into the 3.1, 3.2, and trunk branches.

    @larryhastings
    Copy link
    Contributor Author

    Whoops, forgot to attach. *Here's* the patch.

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Oct 2, 2011

    Mostly looks good - couple of minor comments in Reitveld.

    As far as the patch flow goes, the 2.x and 3.x branches are actually handled independently (they're too divergent for merging to make sense).

    So 2.7 and 3.2 will be independent commits, then the changes will be merged into default from the 3.2 branch.

    @larryhastings
    Copy link
    Contributor Author

    Attached is r2 of the patch, incorporating Nick's suggestions. Base revision hasn't changed.

    @larryhastings
    Copy link
    Contributor Author

    In case you're curious, here's how I tested "capsulethunk.h". I added the file to Python 2.7 (hg head), 3.0.0 (tarball), and 3.1.0 (tarball). For 2.7 ad 3.0.0 I quickly hacked four files to use the Capsule API instead of CObjects:

    While developing capsulethunk.h, I had a more thorough test suite; sadly that's on a laptop that is shut off, and I'm on vacation across the Atlantic and can't get at it. But everything was working fine last I checked ;-)

    @larryhastings
    Copy link
    Contributor Author

    New patch based on comments from Ezio Melotti--thanks, Ezio!

    • capsulethunk.h is now its own file in Doc/includes.
    • Various minor formatting touchups.
    • I added some rationale behind the thunked PyCapsule_SetName behavior.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 9, 2011

    New changeset d0af22b65889 by Larry Hastings in branch '2.7':
    Issue bpo-13053: Added section on migrating from CObject to Capsule
    http://hg.python.org/cpython/rev/d0af22b65889

    @larryhastings
    Copy link
    Contributor Author

    I have some more changes for cporting.rst (see bpo-13086). Once those are in, I'll manually merge the edits over to 3.2, then forward-port to trunk. Does anyone want to see those as patches before I commit them? (Your silence will be interpreted as "go ahead and commit, no patches necessary".)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 29, 2012

    New changeset 28849d00a41e by Larry Hastings in branch '3.2':
    Propagate changes for issues bpo-13053 and bpo-13086 from 2.7 to 3.2. (Doc only.)
    http://hg.python.org/cpython/rev/28849d00a41e

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 29, 2012

    New changeset c316e8a4a5e2 by Larry Hastings in branch 'default':
    Merge: Propagate changes for issues bpo-13053 and bpo-13086 from 2.7 to 3.2.
    http://hg.python.org/cpython/rev/c316e8a4a5e2

    @larryhastings
    Copy link
    Contributor Author

    Now checked in to 2.7, 3.2, and default. Thanks everyone!

    @encukou
    Copy link
    Member

    encukou commented Sep 8, 2015

    As capsulethunk.h is only needed for Python 2.6 and below, which are no longer maintained, in bpo-24937 we are discussing moving the header to an external project.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants