-
Notifications
You must be signed in to change notification settings - Fork 70
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
cannot import name '__version__' from 'pylode' #119
Comments
@nicholascar may I suggest to use a well-proven pattern to handle the I have it documented here: https://smarie.github.io/python-getversion/#package-versioning-best-practices I used this pattern in 20+ python libs, it works perfectly fine. For example in Note: this patterns adds a single dependency to your project build (setup dependency, not install dependency). This dependency is If you agree I can try to propose a PR |
Hi @smarie thanks for pointing out that versioning pattern. I've tried to implement it myself as I wanted to understand it. Also, the versioning is quite fragile in this package since the version is quoted in package code. This fragility is likely just down to my bad programming... Anyway, I think I've implemented everything so I'd be really thrilled if you could just review the code and see if it's doing what you think it should be now. |
@VladimirAlexiev can you please try v2.8.10 now in PyPI? I think it solves this version issue. |
@nicholascar very fine, I'll check right now ! |
There is one thing that needs explanation : with this parttern the In order for this generation process to work, your In the current version that I see on the master branch, the Let me know if this makes sense ? |
Yeah, I saw that pattern - to exclude I'll try and remove the |
OK, I think it's gone now! Both GitHub and PyPI updated. |
@nicholascar great ! Note: the "ugly" version is perfectly normal. It ensures that all unique code bases have different versions. Therefore until you are "perfectly" on the tag, the version is a "working" version. If you have uncommited file changes locally, there is also an additional string added to denote this. All of this ensures that when the version number is clean, it really corresponds to a clean package built from the git tag without any mod. |
Sure, but I just can't have it shown in the HTML documentation the program generates! I appreciate the use of the git version in dev but just have to fall back on the It's a nice pattern this and I think I have many other Python programs that it's actualyl mroe useful for than this one, so I'll try and roll it out in them! Thanks! @VladimirAlexiev can you confirm this issue is solved? If so, can you please close this Issue? Cheers, Nick |
This issue is long resolved so I'm closing. Please reopen if there are still problems. |
I use windows 10, cygwin, and python 3.7.
It seems I have pylode 2.8.5:
But when I try to print the version, I get this error:
Same happens from cygwin
bash
and windowscmd
The text was updated successfully, but these errors were encountered: