-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use poetry when developing a package #3979
Comments
To try to make things work, I stumbled across this discussion #3962 and thought this might be the solution. I created a new virtual environment with poetry poetry env use python and spawned a new shell poetry shell Then I installed my package in this new environment : poetry install which installed the dependencies and the package itself. I tested with import my_package and it works. It also automatically takes the updates I make to the package online. All this without putting the following line in my toml file : [tool.poetry.dependencies]
my_package = {path = "../../my_package", develop = true} I don't understand why it works. But it works. |
You found the solution. You can now generate the |
Hey thanks for the reply. But do you understand why it works without this line? That’s why I am bit puzzled :) |
Hello @FenryrMKIII, when you run
Step 4 is the reasons why you have no problem to import your packages modules if you are in the activated environment. fin swimmer |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am currently developing a package with poetry. My package uses a structure such as this one :
I have well understood the use of Poetry I think. I also succeeded in installing the package in a test environment. In my
.toml
file I have the following lines to handle my particular hierarchy:What I struggle with is how to use Poetry during development for my case.
Indeed, in my case, I have a
bin
directory.This directory contains launch scripts that needs to import my_package to call specific functions/methods. The idea is to provide the user with examples.
I would like to be able to test my_package "online" along with the launch scripts without the need to use commands such as
poetry build/poetry install
in a separate test environments.And I don't see a clean way of making this work with poetry unless I modify the
sys.path
variable during development to include thesrc
directory.Does anyone have a clean way of handling such a use case ? Or am I missing something ?
The text was updated successfully, but these errors were encountered: