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 support for Homebrew and Chocolatey #9187

Merged
merged 13 commits into from Nov 24, 2022
Merged

Conversation

Avasam
Copy link
Sponsor Contributor

@Avasam Avasam commented Nov 13, 2022

I have added support to specify packages to install using Homebrew on MacOS and Chocolatey on Windows. Both come pre-install on the Github Action environments.

Fixed all affected stubs (JACK-Client, pyaudio, and PycURL)
Added ignore_missing_stub = false and completed said stubs
Edit: #9205, #9206 and #9207
Locally validated the installs on both MacOS and Windows.

JACK-Client should be the same on all platforms. I'm only running it on all platforms to prove that the brew and choco installs work. Before merging it should not have any platforms specified.
Edit: Done!

Special notes about pycurl:
The pycurl install on Windows is currently broken as it depends on a version of setuptools that's too old.
That's fixed in their master branch, but still requires to be built from source and does not provide wheels (yet).

The pycurl install on MacOS is too complicated for the CI and does not work with stubtest (unless I'm doing it wrong):

% brew install openssl
% export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
% export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
% pip install --compile --install-option="--with-openssl" pycurl

Fixed all affected stubs
ignore_missing_stub = false and completed stubs
Validated new pycurl constants on macos by manually importing
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

stubs/pycurl/METADATA.toml Outdated Show resolved Hide resolved
@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 15, 2022

There's quite a lot going on in this PR all at once, which makes it a little hard to review:

  • Any -> Incomplete for several annotations
  • missing symbols added to several stubs packages so that we can enable ignore_missing_stub = false
  • New "infrastructure" changes so that we can install dependencies via homebrew or chocolatey when required.

Many of these look like good changes, but would you mind splitting it up into a few smaller PRs, so that we can consider them in isolation? :)

Avasam added a commit to Avasam/typeshed that referenced this pull request Nov 15, 2022
Split off from python#9187
Turned off `ignore_missing_stub` for pyaudio stubs.
Ensured it's valid for Windows and MacOS.
Avasam added a commit to Avasam/typeshed that referenced this pull request Nov 15, 2022
Split off from python#9187
Turned off `ignore_missing_stub` for pycurl stubs.
Ensured it's valid for MacOS.
@Avasam
Copy link
Sponsor Contributor Author

Avasam commented Nov 15, 2022

There's quite a lot going on in this PR all at once, which makes it a little hard to review:
[...] Many of these look like good changes, but would you mind splitting it up into a few smaller PRs, so that we can consider them in isolation? :)

Absolutely! #9205, #9206 and #9207 . Tackling these first will reduce the changes in this PR.

JelleZijlstra pushed a commit that referenced this pull request Nov 16, 2022
Split off from #9187
Turned off `ignore_missing_stub` for pyaudio stubs.
Ensured it's valid for Windows and MacOS.
@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 21, 2022

There's quite a lot going on in this PR all at once, which makes it a little hard to review:
[...] Many of these look like good changes, but would you mind splitting it up into a few smaller PRs, so that we can consider them in isolation? :)

Absolutely! #9205, #9206 and #9207 . Tackling these first will reduce the changes in this PR.

Thanks so much! The changes in this PR are much more manageable now :)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

LGTM other than @sobolevn's point about the unnecessary brew_dependency entry for pycurl

@AlexWaygood AlexWaygood requested a review from JelleZijlstra Nov 21, 2022
@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 22, 2022

(The CI failure will be fixed by #9243.)

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 22, 2022

Ah, looks like we now have a new CI failure due to the fact that 0 packages are being passed into the choco install step.

NONINTERACTIVE=1 brew install $PACKAGES
fi

if [ "${{ matrix.os }}" = "windows-latest" ]; then
Copy link
Member

@sobolevn sobolevn Nov 22, 2022

Choose a reason for hiding this comment

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

Suggested change
if [ "${{ matrix.os }}" = "windows-latest" ]; then
if [ "${{ matrix.os }}" = "windows-latest" ] && [ ! -z "$PACKAGES" ]; then

Copy link
Member

@sobolevn sobolevn Nov 22, 2022

Choose a reason for hiding this comment

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

@AlexWaygood can you please apply this change? :)

This will fix the CI and we can merge it.

Copy link
Member

@AlexWaygood AlexWaygood Nov 22, 2022

Choose a reason for hiding this comment

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

It's probably worth making this change to the apt_dependencies and brew_dependencies branches of this script as well, right? What if we remove stubs for JACK-Client and pyaudio at some point in the future, and then the CI randomly starts failing because suddenly we're passing in 0 packages to the brew install part of this workflow?

Anyway, is there a massive rush? It's @Avasam's PR, I'd prefer to let him respond to this suggestion :)

Copy link
Sponsor Contributor Author

@Avasam Avasam Nov 24, 2022

Choose a reason for hiding this comment

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

No rush on my side. I simply wanted to complete all the stubs that benefited from sobolevn's work with multi-platform support. And this is the last PR in that series.

I've added the check for brew installs and, whilst unlikely, apt installs as well. It doesn't hurt.

I've also changed the os condition to use runner.os instead of matrix.os. This way the exact os version can be updated without braking the condition.

@github-actions

This comment has been minimized.

AlexWaygood added a commit that referenced this pull request Nov 22, 2022
We're about to get a daily test failure with 63 stubtest errors (see the Ubuntu stubtest failure in #9187) due to the release of redis-py 4.3.5, and I'd rather that didn't happen.
srittau pushed a commit that referenced this pull request Nov 22, 2022
We're about to get a daily test failure with 63 stubtest errors (see the Ubuntu stubtest failure in #9187) due to the release of redis-py 4.3.5, and I'd rather that didn't happen.
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood requested a review from sobolevn Nov 24, 2022
Copy link
Member

@sobolevn sobolevn left a comment

Thanks!

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Thanks @Avasam! 🎉

@AlexWaygood AlexWaygood merged commit 7050c1d into python:main Nov 24, 2022
90 checks passed
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