Session

Complete Python Toolbox For Modern Developers

Friday,  Mar 26 | 10:00AM - 10:45AM US ET

Level: Beginner

This talk looks at the various tools that simplify the development process for any developer, independent of their skill level. It starts with project creation with dependency management. It then continues on to look at tools used for testing, checking code quality, and type checking. In the end, we’ll look at documenting code.

 Introduction - 5min

I’ll start with the issues most Python developers face:

  1. creating and re-creating virtual environments
  2. installing, uninstalling, and updating dependencies
  3. writing and running tests
  4. following consistent code style
  5. avoiding security vulnerabilities
  6. documenting code
Modern Python Environments (dependency and workspace management) 

First, we’ll take a look at how to manage Python versions with pyenv. Specifically, how to:

  1. list available Python versions
  2. install a specific version
  3. select a specific version for your current project

Next, we’ll take a look at managing dependencies. We’ll look at how to manage dependencies with several different tools:

  1. venv + pip
  2. Poetry
  3. pipenv

For each, we’ll look at how to manage dependencies along with the virtual environment.

We’ll finish this section by comparing the tools (their pros and cons, things they support, etc.) to make it easier to choose the right one based on your specific situation.

Python testing

This section looks at some tools and techniques that help make testing in Python easier.

  1. Testing with pytest - How to install pytest, structure a project, run assertions, and run tests. We’ll also look at the most used plugins.
  2. Mocking - How to mock internal methods within your tests.
  3. Code coverage - We’ll discuss how to measure code coverage, which tool to use, and how to interpret the coverage percentage.
Python Code Quality

This section answers the following questions:

  1. What exactly is code quality?
  2. How do we measure it?
  3. How do we improve code quality and clean up our Python code?

We’ll look at how to improve the quality of your Python code with linters, code formatters, and security vulnerability scanners.

Python Type Checking

This section answers the following questions:

  1. What is type checking?
  2. Why do we need it?
  3. What’s the difference between static and runtime type checking?

This section looks at what type hints are and how they can benefit you. We’ll also dive into how you can use Python’s type system for type checking.

Documenting Python Code

This section answers the following questions:

  1. Why do you need to document your Python code?
  2. What should your project documentation include?
  3. How do you write and generate documentation?

This section looks at why you should document your Python code and how to generate project documentation with Sphinx and OpenAPI.