EuroPython 2016 Overview

Sorry, no memes

What? Where?

  • Bilbao, Biscay, Spain
  • 17-24 July 2016 (8 days)
  • 5 parallel speaker sessions each day
  • Something about 150 talks
  • More that 1000 participants
  • Sprints, workshops, collaborating and so on

Keynotes

20 years without a 'proper job'

by Rachel Willmer

A Million Children (and MicroPython)

by Nicholas Tollervey

Inside the Hat: Python @ Walt Disney Animation Studios

by Paul Hildebrandt

Restricted image!

LIGO: The Dawn of Gravitational Wave Astronomy

by Jameson Rollins

Come for the Language, Stay for the Community

by Naomi Ceder

Scientist meets web dev: how Python became the language of data

by Gaël Varoquaux

Buzz Words

Async.IO
PyData
Docker
Testing

My own track goals

  1. Containerization - Docker, Kubernetes, Service Discovery
  2. Testing - Mocks, Profiling, Bottlenecks
  3. Python vs C/C++ - CFFI, CPython API, Cython
  4. Async.IO - cold start
  5. Python in general - py3, cool stuff and so

Containerization

Docker, Kubernetes, Service Discovery

and so :)

Create secure production environment using Docker

  • Avoid using Docker with the --privileged flag

  • Avoid providing access to the Docker user or the Docker group

  • Avoid providing access to the Docker UNIX socket or REST API to potentially untrusted callers or containers

  • Consider using the docker-bench-security tool by Docker

Salting things up in the sysadmin's world

  • With great responsibility comes great power.
  • If configured properly, Salt can allow for full control of an infrastructure.
  • Don’t fear the power; beware of the security risks though.

Using Service Discovery to build dynamic python applications

  • ZooKeeper
  • etcd
  • Consul

Grocker, a Python build chain for Docker

  • Debian packaging was hell (in 2015)
  • Containerized applications are the future!
  • OpenShift/Source-To-Image use source not package

Log all the things!

Centralized logging (and the ELK stack) is proving itself to be a very useful tool in managing a production infrastructure. When combined
with other data sources (application logging, business data, ...) it can provide even more insight.

Testing

Mocks, Profiling, Bottlenecks

Where is bottleneck?

Profiling the unprofilable

  • Tracing profilers
    • cProfile
    • yappi
    • line_profiler
  • Sampling profilers
    • statprof
    • plop
    • vmprof
    • Intel Vtune Amplifier

Effectively test your webapp with Python and Selenium

  • leverage application APIs for fixture setup/teardown
  • add metadata in your application HTML to enable easy element retrieval for tests
  • define test classes and timebox each class (small/ large/ xlarge)

Managing Mocks

  • Creating and manipulating Mock objects
  • Setting up return values and side effects to control test environment
  • Inspecting mocks - different ways to examine a mock object and find out what happened during the test
  • How and where to patch

Testing the untestable: a beginner’s guide to mock objects

  • Write tests
  • Use mocks they are easy and fun patch is a great tool to inject mocks into your code
  • I love sentinels - so should you
  • Function side_effects are an "occasional treat"
  • Never "over mock"

System Testing with pytest and docker-py

by Christie Wilson, Michael Tom-Wing

Async.IO

overview and cold start

The Report of Twisted's Death

Twisted, Tornado, Async.IO overview

Asynchronous network requests in a web application

  • Use what fit your needs, or what needs to fit
  • Tradeoff between speed and concurrency
  • Beware of DNS resolutions

async/await in Python 3.5 and why it is awesome

Another cold start with async.io.

Python vs C/C++

Cython, CPython API, CFFI

Exploring Python Bytecode

What happens when you run Python code?

* with CPython

The Gilectomy

This talk will discuss the history of the GIL, how the GIL helps make CPython fast, how the “gilectomy” removed the GIL, and some ways we might be able to make the “gilectomy” version fast enough to be useful.

CFFI: calling C from Python

  • using CFFI, you call C functions and manipulate C-pointer-like

  • objects directly from Python

  • you do in Python all logic involving Python objects

  • there are no (official) ways around this API to call the CPython C

  • API, and none are needed

Python in general

Some other good talks

Effective Code Review

  • Keep reviewers on the same page

  • Constructive criticism and Praise

  • Be Polite and aware of tone

  • GitHub, Gerrit, Phabricator,

    GitLab, Review Board

Go for Python Programmers

It kind of implies writing/using Go as you would

write Python; which is bad because it leads to

un-idiomatic Go code.

Writing faster Python

  • There are different kinds/levels of optimization
  • Source code optimizations are cheap
  • Don't reinvent a wheel
  • Profile your code and be curious

Ethical hacking with Python tools

  • Introduction Python pentesting
  • Modules (Sockets, Requests, BeautifulSoup, Shodan)
  • Analysis metadata
  • Port scanning & Checking vulnerabilities
  • Advanced tools
  • Pentesting

Documentation-driven development

The returns on Django’s investment have been substantial, but some of them are also surprising. The documentation has clearly been key to the quality of the code itself, but also (less obviously) to the development of Django as a community project, and even the professional development of programmers who adopt Django.

Monkey-patching: a magic trick or a powerful tool?

The Python gives developers a great opportunity to use monkey-patching almost everywhere. But should developers do it? Is it a magic trick or a powerful tool? In this talk we will try to give the answers to these questions and try to figure out pros and cons of using monkey-
patching.

Building beautiful RESTful APIs using Flask

by Michal Karzyński

Coala

coala provides a common command-line interface for linting and fixing all your code, regardless of the programming languages you use.
  • Allows use existing static analysis tools
  • Support 54 programming languages (C/C++, Java, Python, etc.)
  • Easy extend

http://coala-analyzer.org/

Another tools worth mentioning

Bquery - agregation framework

https://github.com/visualfabriq/bquery

uvloop - asynchronous framewor, 2-4x times faster than asyncio

http://magic.io/blog/uvloop-blazing-fast-python-networking/

Ponyorm - framework which translate python into sql

https://ponyorm.com/

Wiremock - mock & testing

http://wiremock.org/

Pretender - fake servers for testing

https://pypi.python.org/pypi/pretenders/1.0.2

Main links

FIN

Radim Špigel

Aleksey Rembish

Seznam.cz, 2016

Made with Slides.com