Chocolatey-coreteampackages: (graphviz) Graphviz 2.46.0 for Windows 10 (64-bit)

Created on 25 Jan 2021  路  6Comments  路  Source: chocolatey-community/chocolatey-coreteampackages

Expected Behavior


https://chocolatey.org/packages/Graphviz should have graphviz cmake 2.46.0

Current Behavior


https://chocolatey.org/packages/Graphviz has graphviz cmake (development) 2.44.2-development

Possible Solution


I don't use Windows or chocolatey so sorry if I am confused. But I noticed that in automatic/graphviz/update.ps1 there is:

<...>
$GraphvizURL = "https://www2.graphviz.org/Packages/<branch>/windows/10/<build>/Release/Win32/"
<...>
  $release_url = $release -replace("<build>", $build) -replace("<branch>", $branch )
<...>

But if you go to https://www2.graphviz.org/Packages/ the page reads

The Graphviz packages have moved to https://gitlab.com/graphviz/graphviz/-/releases. 

My understanding is that https://www2.graphviz.org/Packages/stable/windows/10/cmake/Release/Win32/
will always contain graphviz-install-2.44.1-win32.exe and will never be updated.

The current stable release (2.46.0) can be found on https://gitlab.com/graphviz/graphviz/-/releases.

I am a core developer of PyGraphviz (https://github.com/pygraphviz/pygraphviz) and NetworkX (https://github.com/networkx/networkx). PyGraphviz is a Python interface to Graphviz used by NetworkX and other projects. Unfortunately, our Windows users can't use graphviz-install-2.44.1-win32.exe because it was missing too many things. However, the Graphviz developers did a lot of work to improve the Windows installer and now there is the equivalent of a graphviz-install-2.46.0-win64.exe binary installer that passes all our CI testing.

According to https://forum.graphviz.org/t/new-simplified-installation-procedure-on-windows/224
the 64-bit Windows 10 cmake build is the recommended installer for Windows now. We have tested it on the PyGraphviz and NetworkX CI system and are recommending it to our Windows users. I would like to be able to instruct our chocolatey users to install Graphviz using

choco install graphviz

rather than something like

PS C:\> Invoke-WebRequest -Uri "https://gitlab.com/graphviz/graphviz/-/package_files/6164164/download" -OutFile "C:\Temp\graphviz-install-2.46.0-win64.exe"
PS C:\> Start-Process -Wait -FilePath "C:\Temp\graphviz-install-2.46.0-win64.exe" -ArgumentList '/S' -PassThru
PS C:\> echo "C:\Program Files\Graphviz\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

Would it be possible to release 2.46.0 for Windows 10 (64-bit) stable_windows_10_cmake_Release_x64_graphviz-install-2.46.0-win64.exe on https://chocolatey.org/packages/Graphviz? If you need someone to test it on a CI system, I would be happy to test a prerelease for you on the NetworkX CI.

Outdated Up for grabs

Most helpful comment

@jarrodmillman
This appears to be a new development to have changed the release location to the gitlab site. Thanks for bringing this development to light.

@AdmiringWorm if you could make this _up for grabs_

Thanks again @jarrodmillman for the heads up.

All 6 comments

@jarrodmillman
This appears to be a new development to have changed the release location to the gitlab site. Thanks for bringing this development to light.

@AdmiringWorm if you could make this _up for grabs_

Thanks again @jarrodmillman for the heads up.

I get no urls from iwr https://gitlab.com/graphviz/graphviz/-/releases/ so this needs special handling.

OK, I managed to get the urls via REST API but got 401 Unauthorized on download.

$releases = "https://gitlab.com/api/v4/projects/4207231/releases"

function global:au_GetLatest {
  $lastRelease = (irm $releases | select -first 1)[0]
  $url = $lastRelease.assets.links.url -match "stable_windows_10_cmake_Release.+\.exe"
  $version = $url[0] -split '-|_' | select -last 1 -skip 1

  return @{
      URL32       = $url -match 'win64' | select -first 1
      URL64       = $url -match 'win64' | select -first 1
      Version     = $version
  }
}

Result

{
  "URL32": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/0.0.451862831861443475246474057958404272242596503385/stable_windows_10_cmake_Release_x64_graphviz-install-2.46.0-win64.exe",
  "NuspecVersion": "2.44.1.20201124",
  "FileType": "exe",
  "Version": "2.46.0",
  "URL64": "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/0.0.451862831861443475246474057958404272242596503385/stable_windows_10_cmake_Release_x64_graphviz-install-2.46.0-win64.exe",
  "PackageName": "graphviz"
}

@majkinetor
The GitLab API requires a token to authorize a download. This just creates a problem of mega proportions (I would prefer to not go into these issues). The best alternative is to use the website downloads page. I've guessed from previous and the developmental branch on GitLab that the 32 bit version is only one digit higher in the download list.
Try this to get the urls:

$releases = "https://graphviz.org/download/"
$webdata = Invoke-WebRequest -UseBasicParsing -Uri $releases
$url64 = ($webdata.links -match "stable_windows_10_cmake_Release.+\.exe").href
$url64 -match "(\d{7,10})"
if (!([string]::IsNullOrEmpty($Matches)) ) { [int]$incremental = $Matches[0]; $incremental } else { Write-Warning "no digits found" }
$increment = $incremental + 1
$url32 = $url64 -replace ( $incremental , $increment )
Write-Host "url32 -$url32-"
Write-Host "url64 -$url64-"

I hope this helps someone.

To make this quick I removed streams and x32 bit version (we can't rely on @RedBaron2 discovery). This is now only x64 bit package until there is proper x32 bit version link (I guess less relevant nowdays).

GitLab Releases suck.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frankhalligan picture frankhalligan  路  4Comments

jacktose picture jacktose  路  5Comments

kroppt picture kroppt  路  3Comments

Technetium1 picture Technetium1  路  4Comments

Foadsf picture Foadsf  路  4Comments