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 python 3.11 support #1253

Merged
merged 13 commits into from Jan 7, 2023
Merged

Conversation

fedepad
Copy link
Contributor

@fedepad fedepad commented Dec 20, 2022

The core dependencies used by this package seem to be running with Python version 3.11 (more checks might be due).
This is an attempt to bump the test matrix and fix a warning regarding the deprecation of HTTPResponse.getheader()
Here the warning I was getting:

DeprecationWarning: HTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTResponse.headers.get(name, default).

Here my environment:
MacOS 13.0.1 (M1 chip),
Anaconda Python version 3.11
and here the result of pip list

Package           Version
----------------- ---------
astroid           2.12.13
attrs             22.1.0
autopep8          2.0.1
certifi           2022.12.7
dill              0.3.6
iniconfig         1.1.1
isort             5.11.3
lazy-object-proxy 1.8.0
mccabe            0.7.0
packaging         22.0
pip               22.3.1
platformdirs      2.6.0
pluggy            1.0.0
pycodestyle       2.10.0
pylint            2.15.9
pytest            7.2.0
setuptools        65.6.3
tomlkit           0.11.6
urllib3           1.26.13
wheel             0.38.4
wrapt             1.14.1

* Update the Python versions test matrix for CI tests
* Update setup.py to include Python 3.11 version in the classifiers list
Reason: when running tests I got
DeprecationWarning: HTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTResponse.headers.get(name, default).
@@ -166,7 +166,7 @@ def _handle_redirect_response(
307: ("Redirect", "Temporary redirect"),
400: ("BadRequest", "Bad request"),
}.get(response.status, (None, None))
region = response.getheader("x-amz-bucket-region")
region = response.headers.get("x-amz-bucket-region")
Copy link
Member

Choose a reason for hiding this comment

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

This PR #1249 fixed and passed CI on Ubuntu and Windows. You would need to add macos in Github workflow to get it passed.

Copy link
Contributor Author

@fedepad fedepad Dec 20, 2022

Choose a reason for hiding this comment

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

Ok, will add the github workflow with macos-latest like the others although it's not clear the architecture (https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md, I assume still Intel if not specified there...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@balamurugana balamurugana changed the title Bump to python 311 Add python 3.11 support Dec 20, 2022
* This file adds a GitHub workflow for macos runners. It uses the latest available mac os in the GitHub runners, which might not be the latest OS released to the public.
Here is assumed a Mac with Intel chip, since through simple CTRL+F the page https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md didn't show reference to M1 chips
@fedepad
Copy link
Contributor Author

fedepad commented Dec 20, 2022

Removed the action codespell-project/actions-codespell@master from macos workflow as the CI complained that it is supported only on Linux.

@fedepad
Copy link
Contributor Author

fedepad commented Dec 20, 2022

@balamurugana Any idea about this error: https://github.com/minio/minio-py/actions/runs/3741803675/jobs/6352419060#step:7:21 ?
On my mac functional tests seem to all pass and the log of the action is not pointing to a specific.

@balamurugana
Copy link
Member

@balamurugana Any idea about this error: https://github.com/minio/minio-py/actions/runs/3741803675/jobs/6352419060#step:7:21 ? On my mac functional tests seem to all pass and the log of the action is not pointing to a specific.

You would need to brew install wget and other required dependencies.

* Install wget if it doesn't exist
* Try if installing the ca-certificates via Homebrew for mac os runs solves the wget problem
if ! [ -x "$(command -v wget)" ]; then
brew install wget
fi
- name: Run functional tests
Copy link
Member

Choose a reason for hiding this comment

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

You could remove functional tests task entirely including above wget install. It is OK not to run in macos now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do it! It looks like was an error with self-signed certificates that prevents the download, probably a bit more work to do to have it run...

wget -v -O /tmp/minio https://dl.min.io/server/minio/release/darwin-amd64/minio
--2022-12-21 00:35:11--  https://dl.min.io/server/minio/release/darwin-amd64/minio
Resolving dl.min.io (dl.min.io)... 138.68.11.125, 178.1[28](https://github.com/minio/minio-py/actions/runs/3743960059/jobs/6359613951#step:8:29).69.202
Connecting to dl.min.io (dl.min.io)|138.68.11.125|:443... connected.
ERROR: cannot verify dl.min.io's certificate, issued by ‘CN=Sectigo RSA Domain Validation Secure Server CA,O=Sectigo Limited,L=Salford,ST=Greater Manchester,C=GB’:
  Self-signed certificate encountered.
To connect to dl.min.io insecurely, use `--no-check-certificate'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

* Remove as per comment, functional tests to run on macos-latest GitHub runner image.
wget was blocked because a self-signed certificate needs to be trusted (pass the path if already in the machine) or installed.
Related:
* macos-latest can currently be associated with either macos-11 or macos-12, so pinned it for the moment --> https://github.blog/changelog/2022-10-03-github-actions-jobs-running-on-macos-latest-are-now-running-on-macos-12/
* Update checkout actions and setup python actions versions
* Tools not installed in PATH locations: actions/runner-images#6507
* Explicit export workaround for the only case that seems to fail (for PATH not found reasons): add PATH missing to PATH if os is macos-12 (the one pinned) and running Python 3.11
@fedepad
Copy link
Contributor Author

fedepad commented Jan 3, 2023

I changed something in the macos workflow due to issues from GitHub already documented in the commit message plus aligned to current master.
I would give that maybe a try, even if the builds/tests for windows and linux seems ok even for Python 3.11.

* add export in macos runner for Python version < 3.11
@fedepad
Copy link
Contributor Author

fedepad commented Jan 3, 2023

Re-added the user local PATH to the Python versions < 3.11 that I mistakenly removed for macos runs. Sorry

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

👍🏼 🍰

@harshavardhana harshavardhana merged commit 3d5f326 into minio:master Jan 7, 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