Hatch

Managing Hatch Dependencies in VS Code

Managing Hatch Dependencies in vs Code

I recently started using hatch for python projects, and even though hatch will manage and install dependencies for you (just modify the pyproject.toml file), I noticed the import statements could not find the dependencies. This has to do with how Python and Hatch create virtual environments.

To fix this:

CMD + Shift + P
Python: Select Interpreter
Find the Python Environment that matches the Hatch environment.

Hatch - a great python project management tool

Hatch - A Great Python Project Management Tool

Hatch is a python packaging tool. Useful for building python projects. Out of the box it supports testing, building, managing dependencies, and linting/formatting support.

https://wwww.hatch.pypa.io/latest.intro

New Project

hatch new “Hatch Demo”

Adding to Existing Project

hatch new –init

Build a project

hatch build

Test a project with coverage

hatch test –cover

Running static analysis

hatch fmt

Open a shell in the project to run scripts

hatch shell

Create a python virtual env

python3 -m venv /tmp/hatch_demo/