Strategies for Landing an Oracle DBA Job as a Fresher
Writing a Python C extension
1. Writing a C Python
extension in 2018
Paris.py 2018
2. Jean-Baptiste Aviat
CTO & Co-founder of sqreen.io
Former Hacker at Apple (Red Team)
PyMiniRacer author
jb@sqreen.io
@jbaviat
Who Am I?
3. Someday… we needed to
use V8 from Python.
What we ship:
• is public
• is widely used
• need to have frictionless install
$ pip install sqreen
—> it just works™!
9. What are our goals?
• minimize maintenance
• make setup easy
• make testing easy
• have great performance
• have low memory fingerprint
• dev time is a constraint
We want to: And (obviously)…
11. ctypes
Built into Python
Binary is Python independant:
• can be used on any Python
version
• can be used in other languages!
No tight integration to Python
• not high throughput
capable
• less Pythonic
Complex syntax (C types
wrapped in Python…)
Not for C++
👍 👎
22. manylinux wheels
Python standard:
PEP513 / PEP571
Compatible on most
(real world) Linux
Only in pip >= 8.1
Need build for all Python versions
Binaries need to be built on
🚨🚨CentOS 5🚨🚨
👍 👎
24. Wheels vs compilation
iso builds (crash can
be reproduced)
many packages
need maintenance
one build per user
only one package
harder to install…
25. Best of 2 worlds
We can have:
ctypes: use a Python independant binary
wheels: ship compiled binaries
By combining these…
🥂🍾 ctypes + wheels = ship only one binary