Skip to content
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

Add ability to toggle dependency 'develop' #3220

Closed
2 tasks done
Seanny123 opened this issue Oct 16, 2020 · 11 comments
Closed
2 tasks done

Add ability to toggle dependency 'develop' #3220

Seanny123 opened this issue Oct 16, 2020 · 11 comments
Labels
kind/feature Feature requests/implementations

Comments

@Seanny123
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Path-dependencies in Poetry can be optionally marked as 'develop' = True. However, there's no way to mark it as such via the poetry add command.

It would be nice to set the 'develop' = True when adding a path. For example:

poetry add ./my-package/ --develop

Or

poetry add ./my-package/ --editable

I think I can implement this myself if the core devs consider this feature to be beneficial.

@Seanny123 Seanny123 added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 16, 2020
@finswimmer
Copy link
Member

Hello @Seanny123,

yes this is something really useful 👍

@abn listed this also in his suggestion in #3004.

fin swimmer

@finswimmer finswimmer removed the status/triage This issue needs to be triaged label Oct 16, 2020
@abn
Copy link
Member

abn commented Oct 16, 2020

I think this can happen independent of #3004. If this happens first, we just update the key it operates on when #3004 lands.

@0scarB
Copy link

0scarB commented Oct 19, 2020

@python-poetry/triage Hi, really like the project. Have used it for a couple of personal projects. Mind if I take on the issue

@finswimmer
Copy link
Member

Hello @0scarB,

I don't know if @Seanny123 already started to work on it? Otherwise we really appreciate any contribution 👍

fin swimmer

@Seanny123
Copy link
Author

Have no started yet. Go for it @0scarB

@0scarB
Copy link

0scarB commented Oct 19, 2020

@Seanny123 thx, I will :)

@0scarB
Copy link

0scarB commented Oct 19, 2020

Only directory and vcs dependencies support the develop attribute.

If we add develop = true without checking the source_type first then the follow unintuitive error message is raised for dependencies that do not support it

RuntimeError

  The Poetry configuration is invalid:
    - [dependencies.<dependency>] {'version': '<version>', 'develop': True} is not valid under any of the given schemas

It would be better to raise an explicit error such as The develop flag is not supported for dependencies of type <source_type>
Unfortunately I don't see an elegant way of doing this without changing how poetry-core dependencies handle the develop parameter.
Thoughts?

@finswimmer
Copy link
Member

Hello @0scarB,

the error message poetry raises are in general very technical and it is not always obvious to the end-user, but are very useful for debugging. That's a general topic we can improve. I guess there was already somewhere a ticket about this 🤔 .

fin swimmer

@0scarB
Copy link

0scarB commented Oct 25, 2020

@finswimmer Thanks for the feedback, I totally agree. After working on #3004 I think that the dependency classes need to be refactored to have the json_schema as a single source of true, inheriting from superclasses/interfaces for common options such as optional, extras and editable/develop. I'll try and find the issue or create a new one and write up a more detailed proposal.

@finswimmer
Copy link
Member

This is now possible in the current preview release 1.2.0a2 by:

-e, --editable           Add vcs/path dependencies as editable.

@Seanny123 Seanny123 changed the title Add ability to togglle dependency 'develop' Add ability to toggle dependency 'develop' Jan 7, 2022
Copy link

github-actions bot commented Mar 2, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants