Add support for Python 3.10 (#986)

* Add support for Python 3.10

* YAPF supports Python 2.7 and 3.6.4+

* Add support for Python 3.10
pull/987/head
Hugo van Kemenade 2022-01-02 03:54:34 +02:00 committed by GitHub
parent ebd977af00
commit e02dfd19ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [2.7, 3.7, 3.8, 3.9]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest]
steps:

View File

@ -5,6 +5,7 @@
## [0.40.0] UNRELEASED
### Changes
- Moved 'pytree' parsing tools into its own subdirectory.
- Add support for Python 3.10.
## [0.32.0] 2021-12-26
### Added

View File

@ -61,6 +61,10 @@ with codecs.open('README.rst', 'r', 'utf-8') as fd:
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'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',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Quality Assurance',
],

View File

@ -1,5 +1,5 @@
[tox]
envlist=py27,py34,py35,py36,py37,py38
envlist=py27,py36,py37,py38,py39,py310
[testenv]
commands=

View File

@ -198,12 +198,12 @@ def FormatCode(unformatted_source,
def _CheckPythonVersion(): # pragma: no cover
errmsg = 'yapf is only supported for Python 2.7 or 3.4+'
errmsg = 'yapf is only supported for Python 2.7 or 3.6+'
if sys.version_info[0] == 2:
if sys.version_info[1] < 7:
raise RuntimeError(errmsg)
elif sys.version_info[0] == 3:
if sys.version_info[1] < 4:
if sys.version_info[1] < 6:
raise RuntimeError(errmsg)