Skip to content

Commit

Permalink
update version check to 3.8 - 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
sameer-google authored and sushantkhanna committed Nov 26, 2024
1 parent 39e1e4c commit f7b016e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gsutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# TODO: gsutil-beta: Distribute a pylint rc file.

ver = sys.version_info
if (ver.major == 2 and ver.minor < 7) or (ver.major == 3 and (ver.minor < 5 or ver.minor > 11)):
if ver.major != 3 or ver.minor < 8 or ver.minor > 12:
sys.exit(
"Error: gsutil requires Python version 2.7 or 3.5-3.11, but a different version is installed.\n"
"Error: gsutil requires Python version 3.8-3.12, but a different version is installed.\n"
"You are currently running Python {}.{}\n"
"Follow the steps below to resolve this issue:\n"
"\t1. Switch to Python 3.5-3.11 using your Python version manager or install an appropriate version.\n"
"\t1. Switch to Python 3.8-3.12 using your Python version manager or install an appropriate version.\n"
"\t2. If you are unsure how to manage Python versions, visit [https://cloud.google.com/storage/docs/gsutil_install#specifications] for detailed instructions.".format(ver.major, ver.minor)
)

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ def make_release_tree(self, base_dir, files):
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: System :: Filesystems',
'Topic :: Utilities',
],
# Gsutil supports Python 3.5+
python_requires='!=2.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
# Gsutil supports Python 3.8 to 3.12
python_requires='>=3.8, <=3.12',
platforms='any',
packages=find_packages(
exclude=[
Expand Down

2 comments on commit f7b016e

@leonboot
Copy link

@leonboot leonboot commented on f7b016e Dec 6, 2024

Choose a reason for hiding this comment

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

I just tried to install the recently released 5.32 version in the python:3.12-alpine Docker image and my build failed because of this constraint. Using python:3.12.0-alpine still works, but python-3.12.1-alpine doesn't, per this constraint. @sameer-google is this on purpose, or should the second constraint actually be <3.13?

@sameer-google
Copy link
Collaborator Author

@sameer-google sameer-google commented on f7b016e Dec 6, 2024

Choose a reason for hiding this comment

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

Thank you @leonboot, we have already noticed this issue. This will be taken care in an upcoming release, FYI: #PR/1827.

Please sign in to comment.