Skip to content

Commit

Permalink
Add 3.11 and 3.13 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
hongtaozhang committed Feb 20, 2025
1 parent 1b8212d commit 4ade7f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .azure-pipelines/cpu-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ strategy:
imageTag: '3.8'
python-3.10:
imageTag: '3.10'
python-3.11:
imageTag: '3.11'
python-3.12:
imageTag: '3.12'
maxParallel: 4
python-3.13:
imageTag: '3.13'
maxParallel: 6

pool:
vmImage: ubuntu-latest
Expand All @@ -28,7 +32,7 @@ steps:
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Export path
- script: |
if [[ "$(echo $(imageTag) '< 3.12' | bc -l)" == 1 ]]; then
if [[ "$(echo $(imageTag) '< 3.11' | bc -l)" == 1 ]]; then
python3 -m pip install --upgrade pip setuptools==65.7
else
python3 -m pip install --upgrade pip
Expand Down
17 changes: 6 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
'python3 -m pip install --upgrade pip wheel setuptools==65.7\033[0m'
)
raise
elif sys.version_info[:2] != (3, 12):
print(
f'\033[0mPython {sys.version_info.major}.{sys.version_info.minor} is not supported yet, '
'please use Python 3.7, 3.8, 3.9, 3.10 or 3.12.\033[0m'
)
sys.exit(1)

here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.md').read_text(encoding='utf-8')
Expand All @@ -59,8 +53,8 @@ def finalize_options(self):

def run(self):
"""Fromat the code using yapf."""
if sys.version_info[:2] == (3, 12):
print('Disable yapf for Python 3.12 due to the compatibility issue.')
if sys.version_info[:2] >= (3, 12):
print('Disable yapf for Python 3.12+ due to the compatibility issue.')
else:
errno = os.system('python3 -m yapf --in-place --recursive --exclude .git --exclude .eggs .')
sys.exit(0 if errno == 0 else 1)
Expand All @@ -87,11 +81,12 @@ def finalize_options(self):

def run(self):
"""Lint the code with yapf, mypy, and flake8."""
# Disable yapf for Python 3.12 due to the compatibility issue.
if sys.version_info[:2] >= (3, 12):
print('Disable lint for Python 3.12+ due to the compatibility issue.')
errno = os.system(
' && '.join(
[
'python3 -m yapf --diff --recursive --exclude .git --exclude .eggs .' if sys.version_info[:2] !=
'python3 -m yapf --diff --recursive --exclude .git --exclude .eggs .' if sys.version_info[:2] <
(3, 12) else ':',
'python3 -m mypy .',
'python3 -m flake8',
Expand Down Expand Up @@ -200,7 +195,7 @@ def run(self):
extras_require=(
lambda x: {
**x,
'develop': x['dev'] + x['test'] + x['torch'],
'develop': x['dev'] + x['test'],
'cpuworker': x['torch'],
'amdworker': x['torch'] + x['amd'],
'nvworker': x['torch'] + x['ort'] + x['nvidia'],
Expand Down

0 comments on commit 4ade7f3

Please sign in to comment.