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

pip module - editable now applies to all packages #78039

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

nirmal-j-patel
Copy link

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
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
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 extra_args:
cmd.extend(shlex.split(extra_args))

if name:
cmd.extend(to_native(p) for p in packages)
for p in packages:
Copy link
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.

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
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. 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
5 participants