-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
If user declares their requirements.txt in Puppet, don't skip pip installation in python::requirements #619
If user declares their requirements.txt in Puppet, don't skip pip installation in python::requirements #619
Conversation
Ah. I feel like I encountered this at some point, but I was not able to reproduce my failing test after refactoring so assumed I added a missing dependency somewhere… I would have expected these changes to break tests where multiple venv share the same requirements.txt file but maybe we do not test this case in CI. Yet, I do not feel this is the right fix since we want to trigger a new install if the requirements file is changed and not managed by Puppet (e.g. it is part of a repo managed by vcsrepo). I think we now fail here (and it seems not to not have a corresponding test). Can you add a (failing) unit test that demonstrate the problem you want to fix so that I have a way to reproduce this and think about it? |
Add unit test for verifying requirements installation to declared venv
I've added a unit test for this issue, and confirmed that it's failing when my fix is not applied:(acullenn#2) But it succeeds when the subscription changes are in place. Interestingly though, The Puppet + Ruby 2.6/2.7 test fail when the fix exists, but succeed when it isn't. I'd be interested to know why. This is my first Ruby +/ Puppet unit test, so if I've made a mistake or style flub please let me know!
My understanding of the codebase is incomplete - what about the logic for requirements installation would make you expect this? |
Dear @acullenhms, thanks for the PR! This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
@smortex showed a valid reason, why But: this setup won't trigger any installation, as long as There's a
seems to work, but it fails, if there's a mismatch within the package name.
Looks like, as if pip does some magic on the package names ( |
Is there any way to get this patch going again? |
Hello, I used Puppet to manage my requirement.txt. This module won't subscribe to the requirement.txt. I have a similar fix that I would like to apply. Is there anything I can do to help get this going? |
Add # frozen_string_literal: true required by rubocop check
4edb99f
to
fa9cbc4
Compare
@smortex
Pull Request (PR) description
Fixes issue wherein the
python::requirements
class does not correctly install a requirements.txt file declared in Puppet to the declared venv, e.g.This appears to be due to the logic for setting the local resource subscription - it checks if the requirements file is
not
declared before setting the local subscription which ultimately gates the pip installation. This behavior runs contrary to the provided Example(s), in whichrequirements.txt
must exist or be declared in advance of invoking the class:https://forge.puppet.com/modules/puppet/python/reference#pythonrequirements
Changes
python::requirements
, which is used to trigger the pip installation.This Pull Request (PR) fixes the following issues
Fixes #613