-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Include _version.py if building wheel #56378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let use the existing helper instead.
Since you also patch the environ, the existing helper functionality could be extended to support that too.
In order to get .1 out faster I'm cool with switching my review but we should do the right thing then after the .1 release.
tests/support/virtualenv.py
Outdated
@@ -0,0 +1,77 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this helper.
tests/support/virtualenv.py
Outdated
except AttributeError: | ||
# We're running off of the system python | ||
kwargs = {} | ||
self.run_function('virtualenv.create', [path], **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_function
requires a master and minion running, last time I checked.
The existing virtualenv helper does not because it uses the sminion
approach.
Also, great job finding out the real reason behind the empty string version minor issue. |
setup.py
Outdated
@@ -1224,6 +1229,9 @@ def parse_command_line(self): | |||
if not self.ssh_packaging and PACKAGED_FOR_SALT_SSH: | |||
self.ssh_packaging = 1 | |||
|
|||
if 'bdist_wheel' in sys.argv: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking sys.argv
also looks fragile but not to the point of holding up the release.
Let's merge when ready and then ping me and we'll talk on a possible better solution.
Again, this should work perfectly fine for the time being.
What does this PR do?
Ensures the
_version.py
file is included when building the bdist_wheel package. While writing tests and running tests for this found a couple more issues that this PR cleans up:before:
after:
_version.py
it usesfull_info
and then instantiates another instance of SaltStackVersion in that file using full_info. The problem with this isfull_info
will not return the bugfix, mbugfix or minor if it doesn't exist with the new versioning scheme. This leads to the pre_type, pre_num, noc, or sha then becoming the bufix version for example. This change adds a new property methodfull_info_all_versions
which returns the old versioning scheme so when we instantiate a new object we return the correct major,minor,etc.To display this:
before:
as you can see above, full_info changed what we were expecting because full_info should only return the new versioning scheme. But this causes problems when we use this
full_info
to instantiate another SaltStackVersion. So i created another propertymethod for this use case:fyi @s0undt3ch thats why you were seeing this: #56358
this should also fix it so we dont get
''
as the minor type. we are now usingfull_info_all_versions
during setup.py when creating_version.py
What issues does this PR fix or reference?
#56377
Previous Behavior
New Behavior
Tests written?
Yes
Commits signed with GPG?
Yes