Description
"Complete Python Toolbox For Modern Developers" by: Jan Giacomelli 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: - creating and re-creating virtual environments - installing, uninstalling, and updating dependencies - writing and running tests - following consistent code style - avoiding security vulnerabilities - 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: - list available Python versions - install a specific version - 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: - venv + pip - Poetry - 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. - Testing with pytest: How to install pytest, structure a project, run assertions, and run tests. We’ll also look at the most used plugins. - Mocking: How to mock internal methods within your tests. - 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? How do we measure it? 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.
Recorded at the 2021 Python Web Conference (https://2021.pythonwebconf.com)