Maintaining a Python Project When It’s Not Your Job

Maintaining a Python Project When It’s Not Your Job

PyPI is a gold mine of great packages but those packages have to be written first. More often than not, projects that millions of people depend on are written and maintained by only one person. If you’re unlucky, that person is you! This talk tries to lighten the burden by giving you useful tools and approaches.

174e7b0ff60963f821d0b9a4f1a3ef52?s=128

Hynek Schlawack

May 03, 2019
Tweet

Transcript

  1. Maintaining a Python Project When It’s Not Your Job Hynek

    Schlawack
  2. None
  3. None
  4. Twisted cryptography CPython pyOpenSSL

  5. pem doc2dash argon2-cffi prometheus-async environ-config first Twisted cryptography CPython pyOpenSSL

  6. Remove Friction

  7. From Idea to PyPI: A Play in 3 Acts

  8. Act 1: Development

  9. None
  10. None
  11. None
  12. None
  13. .github/CONTRIBUTING.rst

  14. .github/CONTRIBUTING.rst .github/CODE_OF_CONDUCT.rst

  15. None
  16. 1.$ pip install -e .[dev]

  17. 1.$ pip install -e .[dev]

  18. 1.$ pip install -e .[dev]

  19. 1.$ pip install -e .[dev] 2.$ pytest

  20. 1.$ pip install -e .[dev] 2.$ pytest 3.$ cd docs;

    make html
  21. Problems

  22. Problems 1. remember how

  23. Problems 1. remember how 2. only 1 Python version

  24. None
  25. [tox] envlist = py27,py37,pypy,pypy3 tox.ini

  26. [tox] envlist = py27,py37,pypy,pypy3 [testenv] tox.ini

  27. [tox] envlist = py27,py37,pypy,pypy3 [testenv] extras = tests tox.ini

  28. [tox] envlist = py27,py37,pypy,pypy3 [testenv] extras = tests commands =

    pytest {posargs} tox.ini
  29. [tox] envlist = py27,py37,pypy,pypy3 [testenv] extras = tests commands =

    pytest {posargs} tox.ini
  30. [tox] envlist = py27,py37,pypy,pypy3 [testenv] extras = tests commands =

    pytest {posargs} # tox -e py27 -- -x tox.ini
  31. Linting

  32. flake8

  33. None
  34. None
  35. None
  36. None
  37. None
  38. None
  39. .pre-commit-config.yaml

  40. .pre-commit-config.yaml repos: - repo: https://gitlab.com/pycqa/flake8

  41. .pre-commit-config.yaml repos: - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.7

  42. .pre-commit-config.yaml repos: - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.7 hooks: - id:

    flake8
  43. .pre-commit-config.yaml repos: - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.7 hooks: - id:

    flake8 language_version: python3.7
  44. tox.ini

  45. [testenv:lint] tox.ini

  46. [testenv:lint] deps = pre-commit tox.ini

  47. [testenv:lint] deps = pre-commit skip_install = true tox.ini

  48. [testenv:lint] deps = pre-commit skip_install = true commands = pre-commit

    run --all-files tox.ini
  49. tox.ini [testenv:docs] basepython = python3.7 extras = docs commands =

  50. tox.ini [testenv:docs] basepython = python3.7 extras = docs commands =

    sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
  51. tox.ini [testenv:docs] basepython = python3.7 extras = docs commands =

    sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
  52. tox.ini [testenv:docs] basepython = python3.7 extras = docs commands =

    sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html python -m doctest README.rst
  53. Act 2: Pull Request

  54. .github/PULL_REQUEST_TEMPLATE.md

  55. None
  56. None
  57. None
  58. #travisAlumns

  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. Act 3: Release

  67. None
  68. None
  69. __init__.py __version__ = "19.2.0.dev0" __title__ = "attrs" __description__ = "Classes

    Without Boilerplate" __url__ = "https://www.attrs.org/" __doc__ = __description__ + " <" + __uri__ + ">" __author__ = "Hynek Schlawack" __email__ = "hs@ox.cx" __license__ = "MIT" __copyright__ = "Copyright (c) 2015 Hynek Schlawack"
  70. __init__.py __version__ = "19.2.0.dev0" __title__ = "attrs" __description__ = "Classes

    Without Boilerplate" __url__ = "https://www.attrs.org/" __doc__ = __description__ + " <" + __uri__ + ">" __author__ = "Hynek Schlawack" __email__ = "hs@ox.cx" __license__ = "MIT" __copyright__ = "Copyright (c) 2015 Hynek Schlawack"
  71. ISO 8601: 1986-03-19

  72. None
  73. Release

  74. None
  75. None
  76. None
  77. None
  78. None
  79. ox.cx/oss @hynek vrmd.de