Skip to content

pip module - editable now applies to all packages#78039

Closed
nirmal-j-patel wants to merge 1 commit intoansible:develfrom
nirmal-j-patel:pip_editable_fix
Closed

pip module - editable now applies to all packages#78039
nirmal-j-patel wants to merge 1 commit intoansible:develfrom
nirmal-j-patel:pip_editable_fix

Conversation

@nirmal-j-patel
Copy link
Copy Markdown

SUMMARY

When editable is set to true, -e flag should be passed to all packages. This change passes -e flag before each package name. However, if a requirements file is used, then editable flag raises errors. Therefore, editable and requirements are now mutually exclusive.

Fixes #77755

ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION

While fixing the bug, I noticed that -e flag was being passed when using requirements file with editable options on. This results in an error. To avoid having this error, requirements and editable are now mutually exclusive.

This is the error:

$ pip install -e -r requirements.txt 
ERROR: -r is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.14 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 12, 2022
@nirmal-j-patel nirmal-j-patel marked this pull request as ready for review June 12, 2022 16:38
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels Jun 12, 2022
@bcoca bcoca added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Jun 14, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 22, 2022
When editable is set to true, -e flag should be passed to all packages.
This change passes -e flag before each package name. However, if a
requirements file is used, then editable flag raises errors. Therefore,
editable and requirements are now mutually exclusive.

Fixes ansible#77755

Signed-off-by: Nirmal Patel <nirmal@nirmal.dev>
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 4, 2023
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 12, 2023
Comment on lines +2 to +4
- pip - when editable set to true, '-e' flag is passed before each package.
When requirments file is used, editable flag does not pass '-e' to avoid
errors.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- pip - when editable set to true, '-e' flag is passed before each package.
When requirments file is used, editable flag does not pass '-e' to avoid
errors.
- pip - when editable is set to true, '-e' flag is passed before each package.
When the requirements file is used, the editable flag does not pass '-e' to avoid
errors.

mutually_exclusive=[
['name', 'requirements'],
['executable', 'virtualenv'],
['editable', 'requirements'],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a documentation note about this change.


if name:
cmd.extend(to_native(p) for p in packages)
for p in packages:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please create a changelog fragment. See this fragment as an example. Also, add tests for this change.

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Sep 1, 2023
@ansibot ansibot added the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. label Apr 2, 2024
@webknjaz

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

@ansibot ansibot removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Apr 2, 2024
@webknjaz
Copy link
Copy Markdown
Member

webknjaz commented Apr 4, 2024

This branch needs a rebase.

@webknjaz webknjaz added the ci_verified Changes made in this PR are causing tests to fail. label Apr 4, 2024
@nirmal-j-patel
Copy link
Copy Markdown
Author

Apologies for the delay. I'm the next few days, I will rebase this branch and add a test case. I believe I don't need to add a new change log fragment because I already added one. Please correct me if I am wrong.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 13, 2024
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Jan 28, 2025
@pkingstonxyz
Copy link
Copy Markdown
Contributor

@nirmal-j-patel Any plans to finish polishing this up?

@Akasurde
Copy link
Copy Markdown
Member

superseded by #86732

@Akasurde Akasurde closed this Mar 26, 2026
@ansible ansible locked as resolved and limited conversation to collaborators Apr 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects_2.14 bug This issue/PR relates to a bug. ci_verified Changes made in this PR are causing tests to fail. core_review In order to be merged, this PR must follow the core review workflow. has_issue module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. P3 Priority 3 - Approved, No Time Limitation stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pip editable=true doesn't work with multiple requirement names

6 participants