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

Remove requirements_git comments in output file #15316

Closed
wants to merge 2 commits into from

Conversation

AlanCoding
Copy link
Member

SUMMARY

I was reminded of this looking at #15314

Elevator pitch:

We consider requirements_git.txt in resolution of dependencies (so that we get dependencies of git requirements) but we remove the direct git requirements from the resultant requirements.txt file... but that was implemented before pip-tools changed their format. At the time it was implemented, it was fully correct because the lines it operated on looked like:

git+foo.invalid  # via -r requirements_git.txt

But then pip-tools changed format to be like

git+foo
    # via -r requirements_git.txt

So the prior logic would remove the git+ lines. After the format change, it started leaving around the comment lines.

I believe people have been leaving these comments lines around, mis-interpreting them as the source for the requirement above git+foo, which it is not.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

@AlanCoding
Copy link
Member Author

AlanCoding commented Jul 1, 2024

I have discovered this is not correct for:

certifi @ git+https://github.com/ansible/system-certifi.git@devel
    # via
    #   -r /awx_devel/requirements/requirements_git.txt
    #   kubernetes
    #   msrest
    #   requests

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jul 1, 2024
@AlanCoding
Copy link
Member Author

My solution is that I'm taking the certifi case out of scope of this. By matching on a longer string (including "via") we avoid removing any comments related to that requirement. We still have incorrect comments from that, and I'm just going to leave those.

@AlanCoding AlanCoding marked this pull request as ready for review July 1, 2024 15:49
@AlanCoding
Copy link
Member Author

Tossing out an alternative proposal:

Instead of removing the git+ lines, we turn them into comments, so that we can track dependencies.

@AlanCoding
Copy link
Member Author

Thanks for looking at this, but I've become really strongly convinced that #15317 is a vastly better solution. This wouldn't really fix anything.

@AlanCoding AlanCoding closed this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants