wilfredinni/comments_merken

Python projects with Poetry and VSCode. Part 1 - Python Cheatsheet

Opened this issue ยท 7 comments

Python projects with Poetry and VSCode. Part 1 - Python Cheatsheet

We'll use Poetry to start a simple project, manage dependencies and publish it on PyPI. We'll also integrate Pytest, Black, and Flake8 into VSCode directly from a Virtual Environment.

https://www.pythoncheatsheet.org/blog/python-projects-with-poetry-and-vscode-part-1

Nice Tutorial.

Things I noticed. On a fresh vscode (vscodium) install, the pyproject.toml file does not highlight.
To do that, I had to add:

"files.associations": {
        "*.toml": "ini",
    },

to vscodes settings.json file

I ran into this issue where poetry was stuck on Python 2, on Mac OS. This alias fixed it: alias poetry="python3 $HOME/.poetry/bin/poetry", as mentioned by bdoms in the linked thread.

You should probably add an instruction to switch into the project directory before running poetry install otherwise you will get an erron

How do you carry out the curl install on Windows?

How do you carry out the curl install on Windows?

Install curl for windows, Then run the curl command from your command prompt.

usta commented

Dont forget to install a toml extension for vscode/vscodium like :
bungcip.better-toml

@vaMuchenje that's a silly suggestion ...

If you look at the Poetry installation instructions there are Windows steps that use Invoke-WebRequest on PowerShell.

https://python-poetry.org/docs/#windows-powershell-install-instructions