Slide 1

Slide 1 text

PyClean PyClean Clean up your Python bytecode & more. PyCon X, Firenze 2019 PyCon X, Firenze 2019 pip install pyclean

Slide 2

Slide 2 text

PyClean PyClean installed on Debian via python-minimal pyclean py3clean pypyclean

Slide 3

Slide 3 text

Bytecode Bytecode def foo(bar): print(bar) foo.__code__.co_code \x00\x00\x83\x01 \x01\x00\x00\x00 pip3 install pyclean

Slide 4

Slide 4 text

Don't want this in my (Debian) package. pip3 install pyclean __pycache__/foo.pyc __pycache__/foo.pyc

Slide 5

Slide 5 text

pip3 install pyclean python-defaults/pyclean (salsa.debian.org) python3-defaults/py3clean (salsa.debian.org) debian/scripts/pypyclean (salsa.debian.org) ⤋ github.com/bittner/pyclean Debian, mother of things Debian, mother of things

Slide 6

Slide 6 text

pip3 install pyclean python-defaults/pyclean (salsa.debian.org) python3-defaults/py3clean (salsa.debian.org) debian/scripts/pypyclean (salsa.debian.org) ⤋ github.com/bittner/pyclean Debian, mother of things Debian, mother of things

Slide 7

Slide 7 text

pip3 install pyclean python-defaults/pyclean (salsa.debian.org) python3-defaults/py3clean (salsa.debian.org) debian/scripts/pypyclean (salsa.debian.org) ⤋ github.com/bittner/pyclean Debian, mother of things Debian, mother of things

Slide 8

Slide 8 text

Clean Code, Clean Pkg Clean Code, Clean Pkg $ py3clean ­v . pip3 install pyclean

Slide 9

Slide 9 text

pip3 install pyclean Code duplication Debian only + dependencies No PyPy3 No tests Limited benefit What's broken? What's broken?

Slide 10

Slide 10 text

How could we use it? How could we use it? tox # runs tests and cleans up afterwards # tox.ini [testenv:clean] commands = py3clean {toxinidir} find . ­name foo ­delete rm ­rf .pytest_cache/ .tox/ *.egg­info whitelist_externals = py3clean find rm

Slide 11

Slide 11 text

How could we use it? How could we use it? tox # runs tests and cleans up afterwards # tox.ini [testenv:clean] commands = py3clean {toxinidir} find . ­name foo ­delete rm ­rf .pytest_cache/ .tox/ *.egg­info whitelist_externals = py3clean find rm # tox.ini [tox] envlist = py27,py37,clean [testenv] ... [testenv:clean] deps = pyclean commands = pyclean {toxinidir} ­­debris tox

Slide 12

Slide 12 text

git clone https://github.com/bittner/pyclean Contributors wanted! Contributors wanted!

Slide 13

Slide 13 text

Thank you! Thank you! for your precious time for your precious time Painless Software Painless Software Less pain, more fun.