add support for Python 3.10 (#6422)

* add support for Python 3.10

pyarrow is not available, so we are skipping tests for it.
And, restricting `hdfs` extras to be not installed in Python3.10.

Pathlib removed `_init` method and `init` parameter, so just working
around that. It's not a big change.

* skip windows on 3.10; update pip/wheel/setuptools during install

pywin32 is not yet available for 3.10 Python, so skipping those for now

* install libgit2 with Python3.10 as pygit2 wheel is not available

* install libgit2

* only run on macOS, libgit2-1.1 not available on ubuntu
This commit is contained in:
Saugat Pachhai
2021-08-16 16:24:28 +05:45
committed by GitHub
parent a285d2ba47
commit 1bb7f39e14
4 changed files with 30 additions and 12 deletions
+8 -2
View File
@@ -47,6 +47,7 @@ from global repo template to creating everything inplace, which:
import os
import pathlib
import sys
from contextlib import contextmanager
from textwrap import dedent
@@ -81,12 +82,17 @@ class TmpDir(pathlib.Path):
cls = ( # pylint: disable=self-cls-assignment
WindowsTmpDir if os.name == "nt" else PosixTmpDir
)
self = cls._from_parts(args, init=False)
# init parameter and `_init` method has been removed in Python 3.10.
kw = {"init": False} if sys.version_info < (3, 10) else {}
self = cls._from_parts( # pylint: disable=unexpected-keyword-arg
args, **kw
)
if not self._flavour.is_supported:
raise NotImplementedError(
f"cannot instantiate {cls.__name__!r} on your system"
)
self._init()
if sys.version_info < (3, 10):
self._init() # pylint: disable=no-member
return self
def init(self, *, scm=False, dvc=False, subdir=False):