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

Add a script to add the latest miniforge and mambaforge versions #2560

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

smcgivern
Copy link
Contributor

@smcgivern smcgivern commented Dec 13, 2022

Used in #2559.

This takes inspiration from the similar script for miniconda, but it simplifies by using the GitHub Releases API instead of scraping HTML.

It only backfills releases from the first page of the GitHub API results, which I think is reasonable.


Make sure you have checked all steps below.

Prerequisite

  • Please consider implementing the feature as a hook script or plugin as a first step.
    • pyenv has some powerful support for plugins and hook scripts. Please refer to Authoring plugins for details and try to implement it as a plugin if possible.
  • Please consider contributing the patch upstream to rbenv, since we have borrowed most of the code from that project.
    • We occasionally import the changes from rbenv. In general, you can expect changes made in rbenv will be imported to pyenv too, eventually.
    • Generally speaking, we prefer not to make changes in the core in order to keep compatibility with rbenv.
  • My PR addresses the following pyenv issue (if any)

Description

  • Here are some details about my PR

Tests

  • My PR adds the following unit tests (if any)

@smcgivern smcgivern marked this pull request as ready for review December 13, 2022 16:29
Copy link
Member

@native-api native-api left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! This brings us one step further to automating adding new versions (one of the most requested features)!

plugins/python-build/scripts/add_miniforge.py Outdated Show resolved Hide resolved
plugins/python-build/scripts/add_miniforge.py Outdated Show resolved Hide resolved
plugins/python-build/scripts/add_miniforge.py Outdated Show resolved Hide resolved
This takes inspiration from the similar script for miniconda, but it
simplifies in a couple of ways:

1. Use the GitHub Releases API instead of scraping HTML.
2. Don't perform a diff, simply add the latest release.

Lots of intermediate miniconda releases have been skipped in the past,
and it doesn't seem particularly valuable to backfill those.
@smcgivern
Copy link
Contributor Author

@native-api sorry for the delay, I've updated this now to fill in all of the last 20 releases (if missing).

Local output
$ python add_miniforge.py
INFO:__main__:Looking for 22.9.0-3 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 22.9.0-2 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 22.9.0-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 22.9.0-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.14.0-2 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.14.0-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.14.0-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.13.0-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.13.0-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.12.0-3 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.12.0-3
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.12.0-3
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.12.0-3
INFO:__main__:Looking for 4.12.0-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.12.0-1
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.12.0-1
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.12.0-1
INFO:__main__:Looking for 4.12.0-2 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.12.0-2
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.12.0-2
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.12.0-2
INFO:__main__:Looking for 4.12.0-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.12.0-0
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.12.0-0
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.12.0-0
INFO:__main__:Looking for 4.11.0-4 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.11.0-4
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.11.0-4
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.11.0-4
INFO:__main__:Looking for 4.11.0-3 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.11.0-3
INFO:__main__:Writing 2 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.11.0-3
INFO:__main__:Writing 2 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.11.0-3
INFO:__main__:Looking for 4.11.0-2 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.11.0-2
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.11.0-2
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.11.0-2
INFO:__main__:Looking for 4.11.0-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.11.0-1
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.11.0-1
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.11.0-1
INFO:__main__:Looking for 4.11.0-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.11.0-0
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.11.0-0
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.11.0-0
INFO:__main__:Looking for 4.10.3-10 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Looking for 4.10.3-9 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-9

INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-9
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-9
INFO:__main__:Looking for 4.10.3-8 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-8
INFO:__main__:Writing 2 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-8
INFO:__main__:Writing 2 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-8
INFO:__main__:Looking for 4.10.3-7 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-7
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-7
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-7
INFO:__main__:Looking for 4.10.3-6 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-6
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-6
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-6
INFO:__main__:Looking for 4.10.3-5 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-5
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-5
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-5
INFO:__main__:Looking for 4.10.3-4 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-4
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-4
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-4
INFO:__main__:Looking for 4.10.3-3 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-3
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-3
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-3
INFO:__main__:Looking for 4.10.3-2 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-2
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-2
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-2
INFO:__main__:Looking for 4.10.3-1 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-1
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-1
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-1
INFO:__main__:Looking for 4.10.3-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.3-0
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.3-0
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.3-0
INFO:__main__:Looking for 4.10.2-0 in /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build
INFO:__main__:Downloading 4.10.2-0
INFO:__main__:Writing 5 specs for miniforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/miniforge3-4.10.2-0
INFO:__main__:Writing 5 specs for mambaforge to /home/smcgivern/forks/pyenv/plugins/python-build/share/python-build/mambaforge-4.10.2-0

That is, I add these files:

mambaforge-22.9.0-0
mambaforge-22.9.0-1
mambaforge-22.9.0-3
mambaforge-4.10.2-0
mambaforge-4.10.3-0
mambaforge-4.10.3-1
mambaforge-4.10.3-2
mambaforge-4.10.3-3
mambaforge-4.10.3-4
mambaforge-4.10.3-5
mambaforge-4.10.3-6
mambaforge-4.10.3-7
mambaforge-4.10.3-8
mambaforge-4.10.3-9
mambaforge-4.11.0-0
mambaforge-4.11.0-1
mambaforge-4.11.0-2
mambaforge-4.11.0-3
mambaforge-4.11.0-4
mambaforge-4.12.0-0
mambaforge-4.12.0-1
mambaforge-4.12.0-2
mambaforge-4.12.0-3
mambaforge-4.13.0-1
mambaforge-4.14.0-0
mambaforge-4.14.0-1
mambaforge-4.14.0-2
miniforge3-22.9.0-0
miniforge3-22.9.0-1
miniforge3-22.9.0-3
miniforge3-4.10.2-0
miniforge3-4.10.3-0
miniforge3-4.10.3-1
miniforge3-4.10.3-2
miniforge3-4.10.3-3
miniforge3-4.10.3-4
miniforge3-4.10.3-5
miniforge3-4.10.3-6
miniforge3-4.10.3-7
miniforge3-4.10.3-8
miniforge3-4.10.3-9
miniforge3-4.11.0-0
miniforge3-4.11.0-1
miniforge3-4.11.0-2
miniforge3-4.11.0-3
miniforge3-4.11.0-4
miniforge3-4.12.0-0
miniforge3-4.12.0-1
miniforge3-4.12.0-2
miniforge3-4.12.0-3
miniforge3-4.13.0-0
miniforge3-4.13.0-1
miniforge3-4.14.0-0
miniforge3-4.14.0-1
miniforge3-4.14.0-2

Do you want me to create a separate PR for those?

@anton-petrov
Copy link
Member

@smcgivern hi, did you test every new version you added?

@anton-petrov
Copy link
Member

anton-petrov commented Jan 11, 2023

Do you want me to create a separate PR for those?

@smcgivern Yes, I think you can add all of these files in one new PR.

@smcgivern
Copy link
Contributor Author

@anton-petrov yep, I put the details in the PR that adds those versions. This is a very basic test 😃

@anton-petrov anton-petrov merged commit c03d9cf into pyenv:master Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants