5 Matching Annotations
  1. Sep 2022
    1. So which should you use, pip or Conda? For general Python computing, pip and PyPI are usually fine, and the surrounding tooling tends to be better. For data science or scientific computing, however, Conda’s ability to package third-party libraries, and the centralized infrastructure provided by Conda-Forge, means setup of complex packages will often be easier.

      From my experience, I would use Mambaforge or pyenv and Poetry.

  2. May 2022
    1. Pyenv works by adding a special directory called shims in front of your PATH environment variable

      How pyenv works

    2. If you are on Linux, you can simply download it from GitHub but the most convenient way is to use the pyenv-installer that is a simple script that will install it automatically on your distro, whatever it is, in the easiest possible way.

      Installing pyenv on Linux

  3. Jul 2021
    1. The goal of this tutorial is to describe Python development ecosystem.

      tl;dr:

      INSTALLATION:

      1. Install Python through pyenv (don't use python.org)
      2. Install dependencies with Poetry (miniconda3 is also fine for some cases)

      TESTING:

      1. Write tests with pytest (default testing framework for Poetry)
      2. Check test coverage with pytest-cov plugin
      3. Use pre-commit for automatic checks before git commiting (for example, for automatic code refactoring)

      REFACTORING:

      1. Lint your code with flake8 to easily find bugs (it is not as strict as pylint)
      2. Format your code with Black so that it looks the same in every project (is consistent)
      3. Sort imports with isort (so that they are nicely organised: standard library, third party, local)
    2. For Windows, there is pyenv for Windows - https://github.com/pyenv-win/pyenv-win. But you’d probably better off with Windows Subsystem for Linux (WSL), then installing it the Linux way.

      You can install pyenv for Windows, but maybe it's better to go the WSL way