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

Issue 3220 add develop flag for add command #3250

Conversation

0scarB
Copy link

@0scarB 0scarB commented Oct 19, 2020

Pull Request Check List

Resolves: #3220

  • Added tests for changed code.
  • Updated documentation for changed code.

Simply adding the develop attribute causes the following issue however - 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.

@@ -50,6 +50,7 @@ class AddCommand(InstallerCommand, InitCommand):
"Output the operations but do not execute anything (implicitly enables --verbose).",
),
option("lock", None, "Do not perform operations (only update the lockfile)."),
option("develop", None, "Add as dependency in editable mode."),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use --editable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should also mention that this is only supported for VCS and path dependnecies.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abn My bad, thought documentation for cli options were automatically generated

@0scarB 0scarB force-pushed the issue-3220-add-develop-flag-for-add-command branch from ec924e5 to 87583c6 Compare October 20, 2020 11:10
@finswimmer
Copy link
Member

Thanks a lot for your contribution @0scarB.

In the meantime this PR is superseded by #3940.

fin swimmer

@finswimmer finswimmer closed this Sep 19, 2021
Copy link

This pull request 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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to toggle dependency 'develop'
3 participants