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

Fix package versioning when installed from git clone #481

Closed
ssbarnea opened this issue Apr 19, 2023 · 4 comments · Fixed by #494
Closed

Fix package versioning when installed from git clone #481

ssbarnea opened this issue Apr 19, 2023 · 4 comments · Fixed by #494

Comments

@ssbarnea
Copy link
Member

Installing ansible-builder from source does produce a wrong version that is even smaller than the first supported releasem, 1.0.0

$ pip install -e .
Obtaining file:///Users/ssbarnea/c/a/ansible-builder
  Preparing metadata (setup.py) ... done
Requirement already satisfied: PyYAML in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from ansible-builder==1.0.0.0a3.dev110) (6.0)
Requirement already satisfied: requirements-parser in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from ansible-builder==1.0.0.0a3.dev110) (0.5.0)
Requirement already satisfied: bindep in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from ansible-builder==1.0.0.0a3.dev110) (2.11.0)
Requirement already satisfied: Parsley in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from bindep->ansible-builder==1.0.0.0a3.dev110) (1.3)
Requirement already satisfied: pbr>=2.0.0 in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from bindep->ansible-builder==1.0.0.0a3.dev110) (5.11.1)
Requirement already satisfied: distro>=1.7.0 in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from bindep->ansible-builder==1.0.0.0a3.dev110) (1.8.0)
Requirement already satisfied: packaging in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from bindep->ansible-builder==1.0.0.0a3.dev110) (23.1)
Requirement already satisfied: types-setuptools>=57.0.0 in /Users/ssbarnea/.pyenv/versions/3.11.3/lib/python3.11/site-packages (from requirements-parser->ansible-builder==1.0.0.0a3.dev110) (67.6.0.8)
Installing collected packages: ansible-builder
  Attempting uninstall: ansible-builder
    Found existing installation: ansible-builder 1.2.0
    Uninstalling ansible-builder-1.2.0:
      Successfully uninstalled ansible-builder-1.2.0
  Running setup.py develop for ansible-builder
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ansible-navigator 3.0.3.dev5 requires ansible-builder>=1, but you have ansible-builder 1.0.0.0a3.dev110 which is incompatible.
Successfully installed ansible-builder-1.0.0.0a3.dev110
$ git tags
0.2.0
0.2.1
0.2.2
0.3.0
0.3.1
0.4.0
0.4.1
0.4.2
0.5.0
0.5.1
0.6.0
1.0.0
1.0.0a1
1.0.0a2
1.0.0b1
1.0.0rc1
1.0.1
1.1.0
1.2.0

If I am not mistaken, this is caused by a bug in pbr. The correct versions that it should have generated was supposed to be something like 1.2.1.devXXXX or similar.

As @sivel told me that a migration to setuptools-scm is planned, I should mention that that by itself is likely to fix this one too.

This bug is currently blocking ansible/ansible-navigator#1489 which adds testing of devel branch integration with navigator project.

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Apr 19, 2023
@sivel
Copy link
Member

sivel commented Apr 24, 2023

Ultimately just switching to setuptools_scm isn't likely to solve this problem. Since we never tag from the devel branch, the last tag in builder that was made from devel is 1.0.0a2. All of our tags are made from release_X.Y branches, and the commits don't match for various reasons with devel.

As such, all versions made as a result of building from devel produce a version based off of that 1.0.0a2 tag.

@ssbarnea
Copy link
Member Author

Installing ansible core from git source seems to get an ok version number….

@sivel
Copy link
Member

sivel commented Apr 24, 2023

Yeah, core hard codes the version in the code, we don't use any discovery there.

@Shrews Shrews linked a pull request Apr 27, 2023 that will close this issue
@Shrews
Copy link
Contributor

Shrews commented Apr 27, 2023

Closing, fixed by #494

@Shrews Shrews closed this as completed Apr 27, 2023
@Akasurde Akasurde removed the needs_triage New item that needs to be triaged label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants