Closed yhkee0404 closed 6 months ago
Hi @yhkee0404!
I'm happy to hear that you liked my videos! 😄
I usually don't do any development work in the projects folder, and in general only build artifacts from it (i.e. wheels and/or sdists). The recommended way for Polylith is to create a virtual environment at the root (the development project) when developing and testing code and do all of the work there, having all bases and all components available.
The development
folder is part of the development project, and I usually run code from the REPL with the development venv activated. You can do that from a separate shell, or in a more REPL Driven Development way from the code editor. I use Emacs, and have an "auto discover .venv" plugin/package. I have written about the setup here that covers Emacs, VS Code (and PyCharm, details in the comments section), I hope it will be useful for you!
https://davidvujic.blogspot.com/2022/08/joyful-python-with-repl.html
Hi Vujic!
I learnt a lot especially from your dad jokes. 😆
Then I think I may avoid creating another virtual environment per project and reuse the project root one by creating a poetry.toml
per project and specifying virtualenvs.path
.
For my question on development
folder, I realized there was no problem at all because I can always import the top namespaced package in the same way like from example
, no matter where the current directory is the project root or any of its descendants. Awesome!
The article was exactly what I was looking for. Thank you!
Today I introduced your great work to my colleagues. I wish they please break the ice soon and feel free to exploit the fun of building the company's artifacts with blue and green bricks at office!
Have a wonderful weekend! 💖
Glad to hear that, and that you have introduced it to your colleagues! 👏 If you and/or your team have questions or feedback, don't hesitate to reach out. I will happily help out if you have anything Polylith related 😄
According to your talk, it seems good to have a single virtualenv for the entire workspace, or monorepo. However, when I go inside the project directory to build an artifact it seems to create another virtualenv at the path of
{cache-dir}/virtualenvs
without reusing the.venv
one at the project root directory. Is that OK?Besides, I also wonder whether you would run the codes in the
development
directory inside it or at the project root directory. How have you set your IDE or IPython environment to organize path problems and achieve REPL-driven development? I hope there is another video about it like your current decent ones. Thanks!Below is a zsh history that shows the former issue about
Creating virtualenv
.