-
Notifications
You must be signed in to change notification settings - Fork 55
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
Set local build version #440
Conversation
The localbuild version is great. For me, I got But the pip-installed version I get is I started digging into how this version gets generated, and apparently python versioning uses a different and mutually incompatible spec from the rest of the world, called Luckily I see that there is an extension for So bottom line, I think the version format is fine. But I will need to change version number parsers. Side note: It appears there is a local My weak opinion is that hard-coding is better, and we already have hard-coded versions in the Cargo.toml files that we need to bump at release time. |
@vsbogd , what do you think about updating a hard-coded version in |
UPDATE: While So, instead, I propose |
I don't object about incrementing the version manually after release. We do it for the Rust package anyway. I am bothered that this PR introduces second version which should be incremented manually, at the same time first version is still tracked by In general if we are using Another option is to set |
Co-authored-by: luketpeterson <[email protected]>
In the current approach, there will be two versions: one is the version of the Python wheel, and the other is the version of the source code. These versions may deviate if not well maintained. And what makes it more confusing is the git tag. |
I also wanted to mention that running |
We need unpublished, "in-development" versions of the package to have valid versions. Conceptually, the source code is the source of all functionality, so the most major part of the version number belongs with the source code, somehow. The build and release components are more minor components. So the question is how to implement that? I believe So it seems to me that we have two options: I don't have an opinion between these two. They both provide a single source of truth for the version. (the .git metadata in 1. and whatever file we choose in 2., probably Reference: https://github.com/pypa/setuptools_scm/tree/main/docs |
Thanks @luketpeterson. I peronally prefer option 1, using the .git metadata as the source of truth for versioning. The reasons are
|
@luketpeterson , I would like to spot that
This PR is to resolve #434 and I think we need to focus on resolving it. @luketpeterson , @wenwei-dev do you see a way to resolve it using one of the options from #440 (comment) ? I don't see it if we don't put a tricky logic which calculates version by content of the |
What I meant was that they are checked into the source repository and maintained along-side the source code. So they are source in the same way Cargo.toml is source. The distinction I'm making is that they are not build artifacts that are generated on-the-fly during the build process.
I don't think the logic needs to be tricky at all. I think it's just a matter of invoking |
Ah ok, I agree with this.
To me calling |
To add one more solution, we could use simple
and replace
It will not automatically get the information from |
I don't have a strong opinion on any of this, but...
that seems like a step backwards to not include automatic build & release info at all, even when it is available. What about using the 3-tuple version from a hard-coded file, and augmenting it with build & release information. I would bet this is a capability of To @wenwei-dev 's points:
The versions are still unique even if the major 3 components come from a file.
True, we'll need to be more discipled. But the Cargo versions are in the same boat.
If the minor versions come from
True. But once again the Cargo versions are in the same boat. |
Looks like it is not a case. |
In my opinion, the only problem with that is you will need to manually update the 3-tuple version and ensure it stays aligned with the git tag. |
@wenwei-dev , what is the solution you like most? |
I'm not sure I understand the motivation for checking the Python version. Since the Python code is coupled with Rust/C code in the same repository, when they are tagged, they will be tagged as the same version. Also, because they are in the same repository, they should always be compatible. However, if we want to decouple it and treat the Python code as a standalone project, the best way is to put it in a separate repository. |
This version isn't to protect HyperonPy against HyperonC / Rust core version mismatch; it's to protect Hyperon clients and extensions against incompatible versions of HyperonPy & HyperonCore. |
Okay, thanks. I'm not sure what the right approach is. Maybe I'm not clear about the use cases. I believe that using pip is the standard method for installing a Python package. In the README, it also suggests using the pip command to install it in edit mode |
I believe three main use-cases for us are:
First two I believe work with providing a version from the package. Last one requires providing some version from the |
Perhaps we should simply return the hardcoded version 0.1.6+local build and
do not over engineer it. This should meet the requirement for the third
case. What do you guys think?
…On Mon, Sep 25, 2023 at 23:15 Vitaly Bogdanov ***@***.***> wrote:
I believe three main use-cases for us are:
- using package installed from PyPi repository
- using package installed locally via python -m pip -e
- using package in a custom environment, with hyperonpy library built
and python part just used by adding the path to the package into a
sys.paths; this is the use-case for the advanced users and this case
specifically is what #434
<#434> was
opened for.
First two I believe work with providing a version from the package. Last
one requires providing some version from the __init__.py.
—
Reply to this email directly, view it on GitHub
<#440 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEET5YZWGJMUHNELUCEVCDX4JXJDANCNFSM6AAAAAA42WCBG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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 are discussing it for 2 weeks already. I suggest merging it and fix it in a next PR if needed.
@luketpeterson , PR is blocked by your request for changes, could you please take a look and approve if you are agree with current state or continue discussion. |
The change was to turn |
Does this meet the requirements for issue #434?