-
Notifications
You must be signed in to change notification settings - Fork 17
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
The right way to get latest version of a package #18
Comments
Note that a repository could have a different name to the main nimble file. For example, take my repository I believe that the eventual plan was for the nimble directory to actually be the package source, rather than a large JSON file stored on GitHub. In that cause, authors would be submitting packages and we could probably ask them to provide the path to the |
Note that .nimble files are not declarative, so extracting the version from them is not that simple. See e.g nimbles .nimble file, where the version number is imported from another module. |
@euantorano Ok, but which purpose for naming like so? And by the way, your repo has no releases yet. |
Yes, right. But I suggest a solution (in example) for cases where there is no real release (only tagged automatic release). |
@coocheenin Yes, because Nimble doesn't actuallly use GitHub releases when it does version resolution itself - it always looks at the Regarding why I have a different name for the repository and the project, most of my Nim projects have a name ending in |
@euantorano I've understand. The only open question: Does it make sense to add code, typed above, to |
Yes, it definitely needs improving in some way. I’m not sure what the best option is personally.
… On 28 Mar 2019, at 17:42, Konstantin Kuchinin ***@***.***> wrote:
@euantorano I've understand. The only open question: Does it make sense to add code, typed above, to fetch_github_versions as I've described in issue's [UPDATE] section.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@euantorano Can I make a PR then? With additional check whether the target a number is (to avoid situation described by @GULPF). |
I did it in async style, with additional
|
GitHub's API does not provide the latest version anymore and it was also providing it based on date rather than a semantic on version numbers. |
Hi,
I have notice the "new" version badge. I have looked into the code. What's magic!
I mean this request. According github APIv3 docs it's the only way to get the latest release version, BUT...
In real life the most packages don't have release version. Each time a repo is tagged, a new source code bundle will automatically show up on the github "Release" page. However, these automatic "releases" will not appear via the API. It's because I wrote about magic...
I think it's more correct from a holistic point of view to get the package version from a
.nimble
file. What do you think about?For example, the following code can be placed in a
except
section:Maybe I'm wrong.
[UPDATE]: Yes, partially wrong. Just now I found another function, which is involved with getting package version:
proc fetch_github_versions(pkg: Pkg, owner_repo_name: string)
frompackage_directory.nim
file, notgithub.nim
that I've mentioned before. It checkstags
too!So the right place for code typed above is here, instead
pkg["github_latest_version"] = newJString "none"
assignment. The latest attempt to get version. Better thennone
.The text was updated successfully, but these errors were encountered: