Creating A Modern Python Development Environment

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • pyenv

    Simple Python version management

  • Downloading and installing Python from the official binary limits you to one specific Python version, which isn’t great if you’re working on multiple projects with different Python versions. Therefore, it's better to use pyenv, a tool that lets you easily switch between multiple versions of Python.

  • editorconfig-vim

    EditorConfig plugin for Vim

  • EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and integrated development environments (IDE). It works by reading the .editorconfig configuration file provided at the top level of a project. Most IDEs have built-in support but this is a list of IDEs/editors that require a plugin.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • pyenv-win

    pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

  • If you don’t want to use WSL2 you can install pyenv-win, a less modern approach *and skip to the **Set Python Version with pyenv* section.

  • Poetry

    Python packaging and dependency management made easy

  • Packaging systems and dependency management in Python are rather convoluted and hard to understand for newcomers. Even for seasoned developers, it might be cumbersome at times to create all files needed in a Python project. Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. It automatically creates isolated environments for each project, preventing modifications to dependencies in another project.

  • Visual Studio Code

    Visual Studio Code

  • If your editor is VSCode then you’re in luck because you can integrate the Linux subsystem easily with its remote WSL plugin. Once installed open your WSL terminal and execute code . . This will automatically open the VSCode editor within the Linux subsystem. You can read more about it here.

  • pytest

    The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

  • The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. I prefer pytest over the inbuilt unittest library because it allows for plugins such as pytest-xdist, which enables the execution of multiple tests at once, expediting test runtimes and requires fewer lines of code to produce the same output as unittest. Additionally, pytest-cov is a plugin that automatically produces a test coverage report.

  • Flake8

    flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

  • The wemake.services team describe wemake-python-styleguide as *the strictest and most opinionated Python linter ever*. It's essentially the flake8 package, a linting tool that analyses code for defects, with plugins. Its primary objectives are:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • flakehell

    Flake8 wrapper to make it nice, legacy-friendly, configurable. (by flakehell)

  • For existing projects, you can use the package flakehell with the baseline feature to report new violations since integrating a new linter will likely result in hundreds or even thousands of violations. This guide explains how to integrate flakehell and resolve violations over time.

  • mypy

    Optional static typing for Python

  • Mypy is an optional static type checker that aims to combine the benefits of dynamic (or “duck”) typing and static typing. The benefits of statically typed code are increased readability and maintainability. For an existing code base here's a guide on how to implement Mypy.

  • safety

    Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected.

  • A 2021 security report by Snyk, states 47% of Python projects contain known vulnerabilities. On the bright hand side, almost 87% of known vulnerabilities can be resolved by upgrading the vulnerable package. Safety checks your installed dependencies for known security vulnerabilities.

  • pre-commit

    A framework for managing and maintaining multi-language pre-commit hooks.

  • pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. For example, a hook that runs pytest must succeed before code can be committed to the repository, preventing code defects. The following pre-commit configuration file is what I use in my Python projects. It ensures that tests, coverage, stating type checking and vulnerability scanning all pass before code is committed.

  • nitpick

    Enforce the same settings on multiple projects

  • It can become tedious maintaining configurations across projects, especially since EditorConfig, pytest-cov, flake8, Mypy and pre-commit all require configuration files. Nitpick is a tool and flake8 plugin that enforces the same configurations across multiple language-independent projects, automating this tedious configuration.

  • cookiecutter

    A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects.

  • If you’re any way like me, then you must automate a task when you find yourself doing it more than once. I’ve automated the creation and configuration of a modern Python project using cookiecutter. You will need to set up your environment first. Also, nitpick uses my own take on the wemake-services configuration, you can view the repository here.

  • python-project-template

    Automated creation of Python projects with enforced coding standards. (by ShaneNolan)

  • If you’re any way like me, then you must automate a task when you find yourself doing it more than once. I’ve automated the creation and configuration of a modern Python project using cookiecutter. You will need to set up your environment first. Also, nitpick uses my own take on the wemake-services configuration, you can view the repository here.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts