Some pip refactoring... (#10463)

* Pip updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add wheel upload capability to crew.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* reupload i686 binary of py3_twine

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add :in_install.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Mention uri in uri download failed message.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Have gem maintenance use cleanup instead of pristine.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add binaries for py3_importlib_metadata

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update scripts...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Suggested changes.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* dogfooding build_updated_packages script to make more updates...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More changes to use CREW_GITLAB_PKG_REPO.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Suggested changes and tools updates.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Added a :prerelease property to buildsystems/pip because properties from package.rb are not seen by buildsystems/pip.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update i686 hash

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update last hash

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-09-13 16:58:21 -04:00
committed by GitHub
parent b518445f04
commit db0de20fc4
49 changed files with 812 additions and 347 deletions

View File

@@ -43,11 +43,11 @@ class PackageUtils
end
def self.get_binary_url(pkg)
# Fall back to the old method if querying the gitlab API doesn't work for whatever reason.
fallback_url = "https://gitlab.com/api/v4/projects/26210301/packages/generic/#{pkg.name}/#{pkg.version}_#{ARCH}/#{pkg.name}-#{pkg.version}-chromeos-#{ARCH}.#{pkg.binary_compression}"
# Fall back to the old method of querying if the gitlab API doesn't work for whatever reason.
fallback_url = "#{CREW_GITLAB_PKG_REPO}/generic/#{pkg.name}/#{pkg.version}_#{ARCH}/#{pkg.name}-#{pkg.version}-chromeos-#{ARCH}.#{pkg.binary_compression}"
# List all the packages with the name and version of the package file.
# The name search is fuzzy, so we need to refine it further (otherwise packages like vim, gvim and vim_runtime would break).
packages = JSON.parse(Net::HTTP.get(URI("https://gitlab.com/api/v4/projects/26210301/packages?package_name=#{pkg.name}&package_version=#{pkg.version}_#{ARCH}")))
packages = JSON.parse(Net::HTTP.get(URI("#{CREW_GITLAB_PKG_REPO}?package_name=#{pkg.name}&package_version=#{pkg.version}_#{ARCH}")))
# Loop over each result until we get an exact name match, then return the package ID for that match.
package_id = 0
(0..packages.count - 1).each do |i|
@@ -58,7 +58,7 @@ class PackageUtils
# When we're doing that, we're calling download knowing that there isn't an actual file to download, but relying on CREW_CACHE_ENABLED to save us before we get there.
return fallback_url if package_id.zero?
# List all the package files for that package ID.
package_files = JSON.parse(Net::HTTP.get(URI("https://gitlab.com/api/v4/projects/26210301/packages/#{package_id}/package_files")))
package_files = JSON.parse(Net::HTTP.get(URI("#{CREW_GITLAB_PKG_REPO}/#{package_id}/package_files")))
# Bail out if we weren't actually able to find a package.
return fallback_url if package_files.is_a?(Hash) && package_files['message'] == '404 Not found'
# Loop over each result until we find a matching file_sha256 to our binary_sha256.