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

setup-nextstrain-cli: Use a standalone installation instead of Pip/PyPI #55

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented Sep 14, 2023

Simplifies and speeds up installation. Aligns with our recommended installation used by many users and many of ourselves. Drops the baggage of setting up a Python install as a side-effect. Discussed on Slack a while back.¹

In order to continue supporting PEP 440/508 (i.e. Pip-style) version range constraints in the cli-version input, I added support for those to the https://nextstrain.org/cli/download/... endpoint.²

I've audited all existing callsites I could find, internally and externally, for transitive reliance on the setup-python step. None seemed to rely upon it, so it's now gone. See also the added comment about removing the python-version input.

¹ https://bedfordlab.slack.com/archives/C01LCTT7JNN/p1694627907115309
² nextstrain/nextstrain.org#797

Todo

Checklist

  • Checks pass

tsibley added a commit to nextstrain/nextstrain.org that referenced this pull request Feb 12, 2024
…loads

This allows URLs like:

    https://nextstrain.org/cli/download/>=7.4.0/standalone-x86_64-unknown-linux-gnu.tar.gz

which will let us use the standalone installer, e.g.

    curl -fsSL --proto '=https' https://nextstrain.org/cli/installer/linux | bash -s '>=7.4.0'

in automated contexts where we want to be able to declare constraints
like lower version bounds or incompatible versions.

Note that the standalone installer on macOS on aarch64 hardware does
very rudimentary version comparison¹ to decide if the requested version
is older or newer than the first release with actual aarch64 support
(8.2.0), and it won't compare version range constraints correctly:
they'll always be considered greater than (newer/later) than 8.2.0.  But
I expect this to be fine in practice and not matter for actual usage.

We depend on an older version of @renovatebot/pep440 (<3) because >=3
adds a dependency on Node >=18 and this codebase is still on Node 16.  I
reviewed the changelog for newer versions of the package and nothing
else substantial seems to have changed anyhow.

Related-to: <nextstrain/.github#55>

¹ <nextstrain/cli#358>
  <https://github.com/nextstrain/cli/blob/af976b06/bin/standalone-installer-unix#L146-L154>
@tsibley tsibley force-pushed the trs/setup-nextstrain-cli/standalone-installation branch from b4855de to e2e8ced Compare February 16, 2024 08:16
@tsibley tsibley changed the title wip! setup-nextstrain-cli: Use a standalone installation instead of pip/PyPI setup-nextstrain-cli: Use a standalone installation instead of Pip/PyPI Feb 16, 2024
@tsibley tsibley force-pushed the trs/setup-nextstrain-cli/standalone-installation branch from e2e8ced to 026caab Compare February 16, 2024 08:25
It's intended to work there, so test it.
A big caveat on Windows is that no runtime is set up since none are
supported given the intersection of our runtime constraints and the
constraints of GitHub Actions Windows runners.
Simplifies and speeds up installation.  Aligns with our recommended
installation used by many users and many of ourselves.  Drops the
baggage of setting up a Python install as a side-effect.  Discussed on
Slack a while back.¹

In order to continue supporting PEP 440/508 (i.e. Pip-style) version
range constraints in the cli-version input, I added support for those to
the https://nextstrain.org/cli/download/… endpoint.²

I've audited all existing callsites I could find, internally and
externally, for transitive reliance on the setup-python step.  None
seemed to rely upon it, so it's now gone.  See also the added comment
about removing the python-version input.

¹ <https://bedfordlab.slack.com/archives/C01LCTT7JNN/p1694627907115309>
² <nextstrain/nextstrain.org#797>
To avail ourselves of the switch to the standalone installer.
@tsibley tsibley force-pushed the trs/setup-nextstrain-cli/standalone-installation branch from 026caab to ef5c51a Compare February 16, 2024 08:43
@tsibley tsibley marked this pull request as ready for review February 16, 2024 08:52
@tsibley tsibley requested a review from a team February 16, 2024 08:52
@tsibley
Copy link
Member Author

tsibley commented Feb 16, 2024

Going to merge this now pre-review so I can see it in action (har har) today and address anything that arises. If it's a big flop, we'll just revert! As always, I'd welcome post-merge review and feedback.

@tsibley tsibley merged commit 3bcc299 into master Feb 16, 2024
39 of 41 checks passed
@tsibley tsibley deleted the trs/setup-nextstrain-cli/standalone-installation branch February 16, 2024 17:26
tsibley added a commit to nextstrain/docker-base that referenced this pull request Feb 16, 2024
Deprecated and no longer used as setup-python isn't called.

Related-to: <nextstrain/.github#55>
tsibley added a commit to nextstrain/ncov that referenced this pull request Feb 16, 2024
Deprecated and no longer used as setup-python isn't called.

Related-to: <nextstrain/.github#55>
Copy link
Member

@victorlin victorlin left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +40 to +49
# XXX TODO: Remove this in coordination with existing callers. Callers must
# stop specifying it before we remove it here in order to not break. I've
# audited all of our internal usages¹ of this action to check that they don't
# rely on the setup-python call and prepped those usages for the removal of
# this input. There are also many external usages², mostly existing in forks
# of our repos.
# -trs, 13 Feb 2024
#
# ¹ <https://github.com/search?q=org%3Anextstrain+%2Fsetup-nextstrain-cli%40master%2F+%28path%3A*.yaml+OR+path%3A*.yml%29&type=code&p=1>
# ² <https://github.com/search?q=%28NOT+org%3Anextstrain%29+%2Fsetup-nextstrain-cli%40master%2F+%28path%3A*.yaml+OR+path%3A*.yml%29&type=code&p=1>
Copy link
Member

Choose a reason for hiding this comment

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

It looks like all external usages are either forks or exact copies of one of our repos. I did a quick spot check and didn't find any that are actively using the GitHub workflows.

I don't think coordination with the external usages is feasible. I would be ok with dropping it now that internal usages are up to date. In the slim chance that this breaks external usage, they should be able to contact us and we can help them fix it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nod. I'd be fine with that, but didn't want to start something that might cause broader fallout while I'm out. But by all means you can start it… :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants