Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created March 19, 2014 14:50
Show Gist options
  • Select an option

  • Save dstufft/9643283 to your computer and use it in GitHub Desktop.

Select an option

Save dstufft/9643283 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
mkdir -p foo/bar
mkdir -p foo/win
touch foo/bar/PKG-INFO
touch foo/win/a.py
tree foo
python3 -c "import compileall; compileall.compile_dir('foo', force=True)"
tree foo
rm -rf foo
mkdir -p foo/bar
mkdir -p foo/win
touch foo/bar/PKG-INFO
touch foo/win/a.py
tree foo
pypy -c "import compileall; compileall.compile_dir('foo', force=True)"
tree foo
+ mkdir -p foo/bar
+ mkdir -p foo/win
+ touch foo/bar/PKG-INFO
+ touch foo/win/a.py
+ tree foo
foo
├── bar
│   └── PKG-INFO
└── win
└── a.py
2 directories, 2 files
+ python3 -c 'import compileall; compileall.compile_dir('\''foo'\'', force=True)'
Listing 'foo'...
Listing 'foo/bar'...
Listing 'foo/win'...
Compiling 'foo/win/a.py'...
+ tree foo
foo
├── bar
│   └── PKG-INFO
└── win
├── a.py
└── __pycache__
└── a.cpython-33.pyc
3 directories, 3 files
+ rm -rf foo
+ mkdir -p foo/bar
+ mkdir -p foo/win
+ touch foo/bar/PKG-INFO
+ touch foo/win/a.py
+ tree foo
foo
├── bar
│   └── PKG-INFO
└── win
└── a.py
2 directories, 2 files
+ pypy -c 'import compileall; compileall.compile_dir('\''foo'\'', force=True)'
Listing foo ...
Listing foo/bar ...
Listing foo/win ...
Compiling foo/win/a.py ...
+ tree foo
foo
├── bar
│   ├── PKG-INFO
│   └── __pycache__
└── win
├── a.py
└── __pycache__
└── a.pypy-22.pyc
4 directories, 3 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment