Files
dvc/tests/__init__.py
T
Saugat PachhaiandRuslan Kuprieiev fc6999ad17 Run CI for Python3.9 (#4647)
* Run CI for Python3.9, skips hdfs tests for 3.9

Also, `dvc[hdfs]` install will be a no-op till we have
a pyarrow wheel for 3.9.

Note that this does not add an entry to the classifier
claiming it supports 3.9, that will be added when 3.9
gets released (or, wait for pyarrow to be released).

* Skip HDFS related tests on Python3.9

Also, fix the python version regex for `3.9.0b5` like versions.

* Exclude python3.9 for Windows

libxml does not have wheels for Python39.
We do compile them on Linux and Mac

* Update tests/unit/test_info.py

* Use realpath for gitignore

Windows tests for Python3.8 was failing
intermittently.

Note: Also removed the realpath wrap around self.root_dir as it's already a
realpath when `Git` is instantiated.

Co-authored-by: Ruslan Kuprieiev <[email protected]>
2020-10-01 10:41:39 +03:00

44 lines
1.3 KiB
Python

import os
import sys
# FIXME: Search and replace these from the tests if pyarrow wheel is available
PY39 = sys.version_info >= (3, 9, 0)
PYARROW_NOT_AVAILABLE = "pyarrow not available yet for Python3.9"
# Increasing fd ulimit for tests
if os.name == "nt":
import subprocess
import win32file # pylint: disable=import-error
win32file._setmaxstdio(2048)
# Workaround for two bugs:
#
# 1) gitpython-developers/GitPython#546
# GitPython leaves git cat-file --batch/--batch-check processes that are
# not cleaned up correctly, so Popen._active list has their defunct
# process handles, that it is not able to cleanup because of bug 2)
#
# 2) https://bugs.python.org/issue37380
# subprocess.Popen._internal_poll on windows is getting
#
# OSError: [WinError 6] The handle is invalid
#
# exception, which it doesn't ignore and so Popen is not able to cleanup
# old processes and that prevents it from creating any new processes at
# all, which results in our tests failing whenever they try to use Popen.
def noop():
pass
subprocess._cleanup = noop
else:
import resource
resource.setrlimit(resource.RLIMIT_NOFILE, (2048, 2048))
nproc_soft, nproc_hard = resource.getrlimit(resource.RLIMIT_NPROC)
resource.setrlimit(resource.RLIMIT_NPROC, (nproc_hard, nproc_hard))