Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PyClean

 PyClean

Bytecode is opcodes for the Python Virtual Machine. The *.pyc files and __pycache__ folders in your directory tree. On Debian there's pyclean to clean it all up when developing. We need to make this available on all platforms.

See the original presentation at https://slides.com/bittner/pyconx-pyclean/

Peter Bittner

May 04, 2019
Tweet

More Decks by Peter Bittner

Other Decks in Programming

Transcript

  1. PyClean PyClean Clean up your Python bytecode & more. PyCon

    X, Firenze 2019 PyCon X, Firenze 2019 pip install pyclean
  2. Don't want this in my (Debian) package. pip3 install pyclean

    __pycache__/foo.pyc __pycache__/foo.pyc
  3. pip3 install pyclean Code duplication Debian only + dependencies No

    PyPy3 No tests Limited benefit What's broken? What's broken?
  4. 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
  5. 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
  6. Thank you! Thank you! for your precious time for your

    precious time Painless Software Painless Software Less pain, more fun.