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

Set up automation for updating pytype and pyright versions. #11491

Closed
wants to merge 8 commits into from

Conversation

Mr-Sunglasses
Copy link
Contributor

fix: #11484

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

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

Thanks! Before merging this, I will figure out why the CI is failing on this pull request, and test this in my fork.

scripts/check_for_update_dependency.py Outdated Show resolved Hide resolved
.github/workflows/update_daily_ dependency.yml Outdated Show resolved Hide resolved
.github/workflows/update_daily_ dependency.yml Outdated Show resolved Hide resolved
.github/workflows/update_daily_ dependency.yml Outdated Show resolved Hide resolved
scripts/check_for_update_dependency.py Outdated Show resolved Hide resolved
@JelleZijlstra
Copy link
Member

Did you consider setting up a Dependabot configuration instead? That would be preferable since it means we can rely on a well-tested, widely used tool instead of having to write the script ourselves.

@AlexWaygood
Copy link
Member

Did you consider setting up a Dependabot configuration instead? That would be preferable since it means we can rely on a well-tested, widely used tool instead of having to write the script ourselves.

We can't do that for pyright because of the unique way we pin pyright in pyproject.toml. Perhaps we could do a handrolled solution for pyright and do dependabot for everything else, though

@Avasam
Copy link
Collaborator

Avasam commented Feb 29, 2024

About dependabot, I'll repost this conversation: jakebailey/pyright-action#9 (comment)

Renovate could possibly do it. Otherwise it looks like it might be possible to Contributing new ecosystems

There's also the option of using https://pypi.org/project/pyright/ and updating our scripts to get the version from requirements.txt rather than pyproject.toml (just like we do for mypy). That way dependabot can pick it up.
Edit: Similarly, it could go in a package.json to avoid using the python wrapper #11484 (comment)

iirc, the sole reason the version is stored in pyproject.toml currently is to deduplicate it.

@jakebailey
Copy link
Contributor

jakebailey commented Feb 29, 2024

You can pin pyright in a package.json and dependabot will update that for you; the work to pull it out of the JSON file in CI is about the same as doing TOML:

jq -r '.devDependencies.pyright' < ./path.to/package.json

@AlexWaygood
Copy link
Member

Renovate could possibly do it. Otherwise it looks like it might be possible to Contributing new ecosystems

I use renovate over at https://github.com/AlexWaygood/typeshed-stats and it works fine, though it's a bit of a pain to configure it correctly. I'd prefer dependabot if possible; @jakebailey's suggestion of reading the pyright version from a json file sounds great if it'll work with dependabot.

@jakebailey
Copy link
Contributor

For a more concrete example of how to do this in GHA: https://github.com/microsoft/TypeChat/blob/main/.github/workflows/ci.python.yml#L49

But if you find this too cumbersome, I feel like I should probably add something to the action that lets you give it a package.json to read.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I still think a solution that uses dependabot rather than a custom Python script would be simpler, easier to maintain, and less prone to bugs (since dependabot is widely used and well tested)

@Mr-Sunglasses
Copy link
Contributor Author

Mr-Sunglasses commented Mar 4, 2024

I still think a solution that uses dependabot rather than a custom Python script would be simpler, easier to maintain, and less prone to bugs (since dependabot is widely used and well tested)

Yes if it can be solved by dependabot, nothing is better than that.

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.

Set up automation for updating pytype and pyright versions
6 participants