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

[Bug]: pyrevit releases CLI command and handle naming variations #2215

Open
3 tasks
jmcouffin opened this issue Apr 22, 2024 · 5 comments
Open
3 tasks

[Bug]: pyrevit releases CLI command and handle naming variations #2215

jmcouffin opened this issue Apr 22, 2024 · 5 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Command Line Utility (CLI) Issues related to pyRevit CLI tool [subsystem]

Comments

@jmcouffin
Copy link
Contributor

jmcouffin commented Apr 22, 2024

🐞 Describe the bug

In reference to #2214 - Thanks @acco-jpitts

  • Handle string formatting for the download URL
  • Fix --pre and --notes flags
  • Check why: " I had to change these two lines from False to True in Common.csproj and pyRevitCLI.csproj in order to build successfully."
<Reference Include="pyRevitLabs.Json" HintPath="$(PyRevitDevLibsDir)\pyRevitLabs.Json.dll" Private="True" />
<Reference Include="pyRevitLabs.NLog" HintPath="$(PyRevitDevLibsDir)\pyRevitLabs.NLog.dll" Private="True" />
@jmcouffin jmcouffin added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Apr 22, 2024
@jmcouffin jmcouffin pinned this issue Apr 22, 2024
@jmcouffin
Copy link
Contributor Author

pre and notes seem to work fine.
Do you mind checking again @acco-jpitts ?
In which cases the --pre and --notes does not work for you?

there is no pre-release in general on the repo, so it output the latest one or the one invoked

@acco-jpitts
Copy link
Contributor

for the --pre, I meant to say its always working. pyrevit releases is the same output as pyrevit releases --pre

After installing to WIP installer and trying on a different computer I see it is working. As is latest for some commands, but not for downloads.

I was previously testing on a different machine calling the exe directly from the folder I built it in. So maybe there is something different about the Github built assembly vs local build? I did have to edit those 2 csproj files to get it to work.

So "latest" works for pyrevit releases latest --notes but not for pyrevit releases download installer latest

That probably means it simple fix for the downloads. I'll give it another stab tonight maybe.

I forgot to mention I had to strip out what I think was supposed to be a progress bar. I'll try and fix that too, but no idea how it supposed to work.

@jmcouffin
Copy link
Contributor Author

@acco-jpitts thanks for taking a stab.
Your help is welcomed.

@sanzoghenzo sanzoghenzo added the Command Line Utility (CLI) Issues related to pyRevit CLI tool [subsystem] label Aug 27, 2024
@sanzoghenzo
Copy link
Contributor

I think that the download url has to be handled here instead of using the string replace chain:

https://github.com/pyRevitLabs/pyRevit/blob/develop/dev/pyRevitLabs/pyRevitLabs.Common/Github.cs#L64-L72

but then, if we want the user to be able to choose between admin and regular installer, we need to do some bigger changes by exposing (all) the assets to a higher level instead of a single download URL.

@sanzoghenzo
Copy link
Contributor

sanzoghenzo commented Aug 27, 2024

Also, I believe that the thing is broken since the extended revision version was introduced;
the ExtractVersion extension method uses System.Version that only supports a string of type "X.Y.Z.W"

Nevermind, the extended version is exactly 4 numbers, so it should be parsed correctly.

public static Version ExtractVersion(this string version) {
try {
return new Version(version);
}
catch {
var m = Regex.Match(version, "(?<version>[0-9.]+)");
if (m.Success) {
var vernumber = m.Groups["version"].Value;
try {
return new Version(vernumber);
}
catch {
try {
return new Version(vernumber + ".0");
}
catch {
// don't know what else to check
}
}
}
// otherwise return default version
return new Version();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Command Line Utility (CLI) Issues related to pyRevit CLI tool [subsystem]
Projects
None yet
Development

No branches or pull requests

3 participants