Skip to content

[master] Write hardcoded salt version before building when running "setup.py --with-salt-version=xxxx"#65238

Merged
dwoz merged 1 commit intosaltstack:masterfrom
meaksh:master-fix-build-with-salt-version
Jan 28, 2026
Merged

[master] Write hardcoded salt version before building when running "setup.py --with-salt-version=xxxx"#65238
dwoz merged 1 commit intosaltstack:masterfrom
meaksh:master-fix-build-with-salt-version

Conversation

@meaksh
Copy link
Contributor

@meaksh meaksh commented Sep 20, 2023

What does this PR do?

This PR fixes an issue we detected when building Salt with setup.py script and making use of --with-salt-version parameter to hardcode an specific Salt version:

# python3 setup.py --with-salt-version=9999 build
# python3 setup.py --with-salt-version=9999 install

After running the above commands, the generated "egg-info" metadata for the built package is not reflecting the specified version but instead it is calculating it without respecting what it was provided via --with-salt-version parameter:

# cat salt.egg-info/PKG-INFO | grep ^Version
Version: 3006.2+1103.g2cc6113338

Previous Behavior

As mentioned, I got a different version than the specified:

# python3 setup.py --with-salt-version=9999 build
...
# python3 setup.py --with-salt-version=9999 install
...
Finished processing dependencies for salt==3006.2+1103.g2cc6113338
# cat salt.egg-info/PKG-INFO | grep ^Version
Version: 3006.2+1103.g2cc6113338

New Behavior

After this PR, I get the expected version in the generated egg-info:

# python3 setup.py --with-salt-version=9999 build
...
# python3 setup.py --with-salt-version=9999 install
...
Finished processing dependencies for salt==9999.0
# cat salt.egg-info/PKG-INFO | grep ^Version
Version: 9999.0

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@meaksh meaksh requested a review from a team as a code owner September 20, 2023 10:01
@meaksh meaksh requested review from garethgreenaway and removed request for a team September 20, 2023 10:01
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Write hardcoded salt version before building when running "setup.py --with-salt-version=xxxx" [master] Write hardcoded salt version before building when running "setup.py --with-salt-version=xxxx" Sep 20, 2023
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:18 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:18 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:18 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:18 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:36 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 10:45 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:27 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:27 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:27 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:27 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:28 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:28 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci September 20, 2023 15:52 — with GitHub Actions Inactive
@s0undt3ch
Copy link
Contributor

Be advised that we want to move away from setup.py and all of customizations we did there for Salt.
No exact date or release for that but an fyi, to try and divert from using it.

@meaksh
Copy link
Contributor Author

meaksh commented Sep 21, 2023

Be advised that we want to move away from setup.py and all of customizations we did there for Salt. No exact date or release for that but an fyi, to try and divert from using it.

Thanks for the note! 👍

@dwoz dwoz added this to the Argon v3008.0 milestone Dec 18, 2023
agraul pushed a commit to agraul/salt that referenced this pull request Jan 27, 2025
@dwoz dwoz requested a review from a team as a code owner March 16, 2025 22:09
@twangboy twangboy force-pushed the master-fix-build-with-salt-version branch from 2cc6113 to ca5b37b Compare April 4, 2025 17:19
@dwoz
Copy link
Contributor

dwoz commented Jun 25, 2025

@meaksh You can set the salt version by creating salt/_version.txt which is what we do in our official builds of Salt. Is there some reason that will not work for you?

@meaksh
Copy link
Contributor Author

meaksh commented Jun 27, 2025

@meaksh You can set the salt version by creating salt/_version.txt which is what we do in our official builds of Salt. Is there some reason that will not work for you?

Hey @dwoz, manually creating salt/_version.txt would work as well, but IIUC the usage of --with-salt-version parameter on setup.py should create the salt/_version.txt automatically (if not existing) with the given version passed as argument.

@dwoz dwoz merged commit b7edec5 into saltstack:master Jan 28, 2026
2209 of 2229 checks passed
@meaksh meaksh deleted the master-fix-build-with-salt-version branch January 29, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants