$30 off During Our Annual Pro Sale. View Details »

Python loves your contributions

Python loves your contributions

For PyCon Ukraine 2018, I made this talk, where I explain how to contribute to Python and how to contribute with the community and for the community.

Stéphane Wirtel

April 28, 2018
Tweet

More Decks by Stéphane Wirtel

Other Decks in Programming

Transcript

  1. Python loves your contributions
    by Stéphane Wirtel
    PyCon Ukraine 2018 - Kharkiv - 04/28/2018
    @matrixise - 1 / 103

    View Slide

  2. PythonFOSDEM
    CPython contributor
    #fellow member of @ThePSF
    member of EuroPython Society
    I live in Belgium
    Hi PyCon!
    I am Stéphane
    @matrixise - 2 / 103

    View Slide

  3. Contributing?
    @matrixise - 3 / 103

    View Slide

  4. Chapter 1: The Code
    @matrixise - 4 / 103

    View Slide

  5. Once upon a time...
    @matrixise - 5 / 103

    View Slide

  6. a bunch of happy developers,
    @matrixise - 6 / 103

    View Slide

  7. have developed a new language
    @matrixise - 7 / 103

    View Slide

  8. Python
    @matrixise - 8 / 103

    View Slide

  9. Nice!!!
    we are here only for this language ;-)
    @matrixise - 9 / 103

    View Slide

  10. for them, the main tool for the management,
    for the issues, and the contributions
    was
    the issue tracker!
    @matrixise - 10 / 103

    View Slide

  11. The Issue Tracker
    bugs.python.org aka b.p.o
    @matrixise - 11 / 103

    View Slide

  12. The Issue Tracker
    could only handle the contributions
    as patches
    @matrixise - 12 / 103

    View Slide

  13. one or many patch(es)
    @matrixise - 13 / 103

    View Slide

  14. one or many patch(es)
    For the same issue
    @matrixise - 14 / 103

    View Slide

  15. Rietveld for the reviews :-/
    @matrixise - 15 / 103

    View Slide

  16. Rietveld
    @matrixise - 16 / 103

    View Slide

  17. Rietveld
    @matrixise - 17 / 103

    View Slide

  18. Rietveld
    was
    Custom fork of the official Rietveld
    Maintained by one person
    Not really sexy
    No hightligted diff
    Not perfectly integrated with the Bug Tracker
    @matrixise - 18 / 103

    View Slide

  19. Rietveld
    was
    Custom fork of the official Rietveld
    Maintained by one person
    Not really sexy
    No hightligted diff
    Not perfectly integrated with the Bug Tracker
    @matrixise - 19 / 103

    View Slide

  20. Typical Work ow
    @matrixise - 20 / 103

    View Slide

  21. Typical Work ow
    As a contributor
    Open an issue
    Checkout the CPython source code from hg.python.org
    Make the fix
    Upload a patch
    Have a review with Rietveld
    @matrixise - 21 / 103

    View Slide

  22. Typical Work ow
    As a core dev
    Download the patch
    Make sure it still applies cleanly
    Fix the conflicts or ask a new patch to the contributor
    Run test suite manually (10-15 min)
    Commit the change manually
    Write the commit message
    Commit in the maintenance branches first and then merged in the default
    branch
    Run the test suite manually again
    Commit the merge
    Push the changes
    @matrixise - 22 / 103

    View Slide

  23. Typical Work ow
    About the patch
    Is there a conflict?
    Who is the author?
    Is there a description?
    Where is the reference of revision?
    diff --git a/Misc/python.man b/Misc/python.man
    --- a/Misc/python.man
    +++ b/Misc/python.man
    @matrixise - 23 / 103

    View Slide

  24. Typical Work ow
    About the continuous integration
    Check the buildbots (between 1h & 1d... if we are lucky)
    Frequent bugs on Windows
    the developers are on Linux or OSX
    or just too lazy
    If green, port to several branches
    can introduce new bugs in the other branches
    risk of conflicts
    tests executed by Buildbot
    @matrixise - 24 / 103

    View Slide

  25. Typical Work ow
    About the continuous integration
    Check the buildbots (between 1h & 1d... if we are lucky)
    Frequent bugs on Windows
    the developers are on Linux or OSX
    or just too lazy
    If green, port to several branches
    can introduce new bugs in the other branches
    risk of conflicts
    tests executed by Buildbot
    CI: Only on the stable branches (2.7, 3.4+)
    @matrixise - 25 / 103

    View Slide

  26. Typical Work ow
    Status
    Download the sources from https://hg.python.org
    Use Patches
    Store them on bugs.python.org
    Use a custom version of Rietveld
    Complex Workflow
    @matrixise - 26 / 103

    View Slide

  27. Di culty for the contribution
    @matrixise - 27 / 103

    View Slide

  28. I am God!
    I want to contribute, change the work ow!
    @matrixise - 28 / 103

    View Slide

  29. How?
    @matrixise - 29 / 103

    View Slide

  30. Too simple ;-)
    @matrixise - 30 / 103

    View Slide

  31. We have just switched to Git/GitHub!
    Read for more information:
    PEP 512: Migration from hg.python.org to Git/GitHub
    @matrixise - 31 / 103

    View Slide

  32. The Open Hub
    48% for SVN
    37% for Git
    2% for Mercurial
    PyPI
    62% for Git
    22% for Mercurial
    13% for the rest
    Why Git?
    Git is 3 times more popupar as
    Mercurial for the top 100 projects on
    PyPI.
    @matrixise - 32 / 103

    View Slide

  33. Why GitHub?
    GitHub is popular and familiar
    Primary place if you want to contribute to a project
    Avoid a custom infrastructure
    Concept of Pull Requests
    are easier to review
    have nice syntax hightligted diffs
    can be commented
    Web API ( REST & GraphQL )
    @matrixise - 33 / 103

    View Slide

  34. GitHub - Dashboards
    @matrixise - 34 / 103

    View Slide

  35. GitHub - Web interface
    @matrixise - 35 / 103

    View Slide

  36. GitHub - Reviews
    Integrated review
    Comment the code and ask for changes
    @matrixise - 36 / 103

    View Slide

  37. GitHub - Reviews - Ready to merge
    @matrixise - 37 / 103

    View Slide

  38. Migrations to GitHub
    15th January 2016: PEPs
    22nd July 2016: DevGuide
    11st February 2017: CPython (2 years)
    @matrixise - 38 / 103

    View Slide

  39. Automation
    @matrixise - 39 / 103

    View Slide

  40. Run the test suite and the performance tests
    Run the code coverage
    Compile the documentation
    Execute for master and the stable branches (2.7, 3.6)
    Execute on the branches from the contributors
    Automation
    @matrixise - 40 / 103

    View Slide

  41. The BOTS...
    @matrixise - 41 / 103

    View Slide

  42. Job
    checks if the the commiter has signed the Contributor
    Agreement aka CLA
    The knights who say ni!
    https://github.com/python/the-knights-who-say-ni
    CLA: https://www.python.org/psf/contrib/contrib-form/
    @matrixise - 42 / 103

    View Slide

  43. Job
    checks the title of the PR with bedevere/issue-number
    has a Misc/NEWS.d/next entry with bedevere/news
    play with the labels awaiting review, awaiting merge,
    awaiting core review
    Bedevere!
    https://github.com/python/bedevere
    @matrixise - 43 / 103

    View Slide

  44. Job
    based on needs backport to X.Y
    backports a Pull Request to an other branch
    merges a complete backport
    Miss Islington!
    https://github.com/python/miss-islington
    @matrixise - 44 / 103

    View Slide

  45. BOTS + Automations =
    @matrixise - 45 / 103

    View Slide

  46. BOTS + Automations =
    @matrixise - 46 / 103

    View Slide

  47. BOTS + Automations =
    @matrixise - 47 / 103

    View Slide

  48. as you can see
    BOTS are really useful for the core-devs
    @matrixise - 48 / 103

    View Slide

  49. Status about the Work ow
    @matrixise - 49 / 103

    View Slide

  50. Before
    Contributor
    Open an issue
    Clone
    Upload a patch
    Core Dev
    Wait a review of a Core Dev
    Download the patch
    Fix the conflicts
    Run the tests manually
    Run the code coverage
    manually
    Commit manually
    Write the commit message
    Merge into the branches
    Run the test suite manually
    Commit the merge
    Push the changes
    etc...
    process is long & manual & error
    prone @matrixise - 50 / 103

    View Slide

  51. Before
    Contributor
    Open an issue
    Clone
    Upload a patch
    Core Dev
    Wait a review of a Core Dev
    Download the patch
    Fix the conflicts
    Run the tests manually
    Run the code coverage
    manually
    Commit manually
    Write the commit message
    Merge into the branches
    Run the test suite manually
    Commit the merge
    Push the changes
    etc...
    process is long & manual & error
    prone @matrixise - 51 / 103

    View Slide

  52. After
    Contributor
    Open an issue
    Clone
    Create a Pull Request
    Core Dev
    Review from contributors or
    core-dev
    Wait the feedback of the BOTS
    + Automation
    Wait the signal
    Mark the PR as needs
    backport to X.Y
    process is short & automatic
    @matrixise - 52 / 103

    View Slide

  53. After
    Contributor
    Open an issue
    Clone
    Create a Pull Request
    Core Dev
    Review from contributors or
    core-dev
    Wait the feedback of the BOTS
    + Automation
    Wait the signal
    Mark the PR as needs
    backport to X.Y
    process is short & automatic
    @matrixise - 53 / 103

    View Slide

  54. Statistics
    from Feb 2017 to Apr 2018
    April is not yet nished
    @matrixise - 54 / 103

    View Slide

  55. Pull Requests: 6542
    @matrixise - 55 / 103

    View Slide

  56. Merged Pull Requests: 4966
    @matrixise - 56 / 103

    View Slide

  57. Top Merge Time
    @matrixise - 57 / 103

    View Slide

  58. Core-Devs & Contributors / Numbers
    @matrixise - 58 / 103

    View Slide

  59. Core-Devs & Contributors / Pull Requests
    @matrixise - 59 / 103

    View Slide

  60. Code
    @matrixise - 60 / 103

    View Slide

  61. Documentation
    There is the PEP 545 for that!!!
    @matrixise - 61 / 103

    View Slide

  62. Yeah!
    CPython loves your Pull Requests
    @matrixise - 62 / 103

    View Slide

  63. Yeah!
    CPython loves your Pull Requests
    and
    @matrixise - 63 / 103

    View Slide

  64. Your rst contribution could be
    the Ukrainian/Russian translation
    of the documentation.
    @matrixise - 64 / 103

    View Slide

  65. Your rst contribution could be
    the Ukrainian/Russian translation
    of the documentation.
    Read PEP 545
    @matrixise - 65 / 103

    View Slide

  66. @matrixise - 66 / 103

    View Slide

  67. Communication
    We have several channels:
    Mailing lists
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    IRC (irc://irc.freennode.net/#python-dev)
    @matrixise - 67 / 103

    View Slide

  68. Communication
    ZulipChat
    @matrixise - 68 / 103

    View Slide

  69. Then
    @matrixise - 69 / 103

    View Slide

  70. We are ready for the future!
    @matrixise - 70 / 103

    View Slide

  71. Chapter 2: The Community
    @matrixise - 71 / 103

    View Slide

  72.  -> Language and Community 
    Brett Cannon, PyCon US 2014
    @matrixise - 72 / 103

    View Slide

  73. The Python Community
    is
    respectful, safe and open!
    Code of Conduct
    @matrixise - 73 / 103

    View Slide

  74. Contributions
    @matrixise - 74 / 103

    View Slide

  75. Contributions
    Mailing lists
    IRC / slack channels / ZulipChat
    Meetups
    PyLadies
    DjangoGirls (Kiev, Kharkov?)
    Sprints
    PyCons
    @matrixise - 75 / 103

    View Slide

  76. Who organise?
    @matrixise - 76 / 103

    View Slide

  77. Who organise?
    you!
    @matrixise - 77 / 103

    View Slide

  78. Who organise?
    you!
    me!
    @matrixise - 78 / 103

    View Slide

  79. Who organise?
    you!
    me!
    all of us!
    @matrixise - 79 / 103

    View Slide

  80. Conferences
    PyCon Ukraine 2018
    PyCon US in Cleveland (USA)
    EuroPython 2018 (Edinburgh / UK)
    @matrixise - 80 / 103

    View Slide

  81. Conferences
    PyCon Ukraine 2018
    PyCon US in Cleveland (USA)
    EuroPython 2018 (Edinburgh / UK)
    but also a lot of conferences
    DjangoCon Europe
    PyCon CZ 2018 (Prague / Czech Republic)
    PyCon PL 2018 (Ossa / Poland)
    ...
    https://python.org/events
    @matrixise - 81 / 103

    View Slide

  82. Conferences
    PyCon Ukraine 2018
    PyCon US in Cleveland (USA)
    EuroPython 2018 (Edinburgh / UK)
    but also a lot of conferences
    DjangoCon Europe
    PyCon CZ 2018 (Prague / Czech Republic)
    PyCon PL 2018 (Ossa / Poland)
    ...
    https://python.org/events
    You could also create a new conference
    PyConWeb
    PyData
    @matrixise - 82 / 103

    View Slide

  83. DjangoGirls &| PyLadies
    @matrixise - 83 / 103

    View Slide

  84. PyLadies
    http://www.pyladies.com/
    @matrixise - 84 / 103

    View Slide

  85. DjangoGirls
    https://djangogirls.org/kharkiv/
    @matrixise - 85 / 103

    View Slide

  86. How to become a good contributor
    Is there a recipe?
    @matrixise - 86 / 103

    View Slide

  87. No!
    @matrixise - 87 / 103

    View Slide

  88. No!
    maybe you will fail, but at least, you tried an initiative!
    @matrixise - 88 / 103

    View Slide

  89. Chapter 3
    @matrixise - 89 / 103

    View Slide

  90. PSF Mission
    "The mission of the Python Software Foundation is to promote, protect, and
    advance the Python programming language, and to support and facilitate the
    growth of a diverse and international community of Python programmers".
    @matrixise - 90 / 103

    View Slide

  91. Python Software Foundation
    Intellectual Property
    Members
    Money
    @matrixise - 91 / 103

    View Slide

  92. Intellectual Property
    Software Licenses
    Trademarks
    @matrixise - 92 / 103

    View Slide

  93. Members
    Basic (non-voting)
    Supporting
    Contributing/Managing
    Fellows
    @matrixise - 93 / 103

    View Slide

  94. Money comes from...
    Donations
    Sponsorships
    PyCon US
    @matrixise - 94 / 103

    View Slide

  95. Money goes to...
    Other PyCons
    Workshops
    Meetups fees
    Software projects
    Infrastructure
    Employees
    ...
    @matrixise - 95 / 103

    View Slide

  96. The PSF is NOT the Python Community,
    you are a member of this awesome
    Community
    @matrixise - 96 / 103

    View Slide

  97. Think globally;
    act locally
    Join the PSF (it's free)
    Engage with a community (or start one)
    Contribute - organise/mentor/code
    @matrixise - 97 / 103

    View Slide

  98. What Can I Do for Python ?
    @matrixise - 98 / 103

    View Slide

  99. What Can I Do for Python ?
    now, you know!
    @matrixise - 99 / 103

    View Slide

  100. The contribution is for...
    @matrixise - 100 / 103

    View Slide

  101. @matrixise - 101 / 103

    View Slide

  102. Thank you!
    Дякую
    @matrixise
    [email protected]
    @matrixise - 102 / 103

    View Slide

  103. @matrixise - 102 / 103

    View Slide

  104. Credits
    Talks
    Naomi Ceder for her presentation "Stay for the community"
    Brett Cannon for his sentence "Came for the language, stayed for the
    community"
    Images
    http://www.pierre-leautey.fr/lagence-de-communication-et-marketing-ds-
    consulting-de-pierrette-sicot/
    @matrixise - 103 / 103

    View Slide