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

Is version_handler necessary? #5

Open
clausjuhl opened this issue Mar 20, 2023 · 2 comments
Open

Is version_handler necessary? #5

clausjuhl opened this issue Mar 20, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@clausjuhl
Copy link
Member

We successfully used importlib.metadata.version in avid-cli to extract version from pyproject.toml? I don't know why it works now, but it does. Should we gradually try it out in the repos that use acautils.version_handler() or just leave it?

@clausjuhl clausjuhl added the question Further information is requested label Mar 20, 2023
@Magniler
Copy link
Contributor

Magniler commented Mar 23, 2023

acautils.version_handler() is not working as intented right now, and it has proven a hard challenge to make a generel version handler for our (few) tools. I have tried to find out how importlib.metadata.version finds the version info (docu for importlib & realpython walkthrough), but i have not been able to find any detailed explanation.

I have talked with Mads about it and it appears that if you use poetry to make a tool, poetry conforms to the standards of the importlib and importlib.metadata.version is able to find the version info.

I think it is a good idea to try it out and hope that most of our tools are simple enough for the metadata.version call to work. I can't see why it shouldn't work, and i think it would be a good idea to try to implement it on some of our tools and then stop our own version handler project.

@clausjuhl
Copy link
Member Author

We have tried before with importlib.metadata.version, but I think the reason we made our own version_handler is that importlib.metadata.version wasn't implemented before version 3.8, and the "version"-key was hidden under the [poetry.tool]-table in pyproject.toml! This might work today bacause we only (?) use 3.8 above and/or poetry has since made sure, that it exposes the version-metadata even though it requires it to be hidden under [poetry.tool] instead of the recommendation of the spec, which is under [project]. In short, let's go with importlib.metadata.version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants