Thanks! I've been recently acquainted with your blog and I have to say I enjoy doing the reads and learn a lot. Many thanks Bite Code! Just one question if I may. I read in another article of yours not to install anything outside a virtual environment, does that rule apply to Nox? I've read that it is supposed to be installed globally, so I just wonder if it could work just fine inside a virtual environment or if there is any advantage by installing it globally. Thanks in advance!
Yes, it applies to nox. Nox will run Python code, and at some point, someone will assume it runs the same Python version and env than your project, including syntax, deps, etc.
If you install it globally, it will use the syntax and deps of the global interpreter you used the day you installed it. One day, something will break.
It will also make collaboration easier, since installing/updating it is part of the regular dep setup for everyone in the team.
Besides, if you ever use CI, you will have to install it anyway.
Not to mention if you wan to ever run it programmatically.
A nice alternative to doit is pre-commit (https://pre-commit.com). Its predicated on using Git to version control your project since it uses a pre-commit hook, but there are a vast array of hooks available for pre-commit for pylint, ruff, isort, nbstrip (to remove executed cells from Jupyter Notebooks that are under version control) and many, many more.
Tiny suggestion(s): better to mention "what you get by default when you use visual studio CODE" because Visual Studio is also a product from Microsoft, which is totally unrelated to VSCode.
Also VSCode uses Pylance (which is not open source and is proprietary), but Pywright is open-source
Thanks! I've been recently acquainted with your blog and I have to say I enjoy doing the reads and learn a lot. Many thanks Bite Code! Just one question if I may. I read in another article of yours not to install anything outside a virtual environment, does that rule apply to Nox? I've read that it is supposed to be installed globally, so I just wonder if it could work just fine inside a virtual environment or if there is any advantage by installing it globally. Thanks in advance!
Yes, it applies to nox. Nox will run Python code, and at some point, someone will assume it runs the same Python version and env than your project, including syntax, deps, etc.
If you install it globally, it will use the syntax and deps of the global interpreter you used the day you installed it. One day, something will break.
It will also make collaboration easier, since installing/updating it is part of the regular dep setup for everyone in the team.
Besides, if you ever use CI, you will have to install it anyway.
Not to mention if you wan to ever run it programmatically.
Nox doubles-up as a great task runner.
A nice alternative to doit is pre-commit (https://pre-commit.com). Its predicated on using Git to version control your project since it uses a pre-commit hook, but there are a vast array of hooks available for pre-commit for pylint, ruff, isort, nbstrip (to remove executed cells from Jupyter Notebooks that are under version control) and many, many more.
Its super useful. I've written about it https://ns-rse.github.io/posts/pre-commit/
Tiny suggestion(s): better to mention "what you get by default when you use visual studio CODE" because Visual Studio is also a product from Microsoft, which is totally unrelated to VSCode.
Also VSCode uses Pylance (which is not open source and is proprietary), but Pywright is open-source
Yep, I'm going to add "code".
However, pylance uses pywright under the hood.
Prefer yapf over black; the latter has an obnoxious design philosophy.
Nope
My bad!