Skip to content

Commit

Permalink
refactor: Deprecate distutils in favor of setuptools._distutils (#1849)
Browse files Browse the repository at this point in the history
* Use setuptools._distutils over distutils as distutils is deprecated in
Python 3.10 and scheduled for removal in Python 3.12 as noted in the pip v21.3
release notes.
   - c.f. https://pip.pypa.io/en/stable/news/#v21-3
  • Loading branch information
matthewfeickert authored Apr 15, 2022
1 parent 6452cc6 commit 1cf0ac6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pytest
import pyhf
import sys
import tarfile
import json
import pathlib
import distutils.dir_util
import sys
import tarfile

import pytest
from setuptools._distutils import dir_util

import pyhf


# Factory as fixture pattern
Expand Down Expand Up @@ -134,7 +136,7 @@ def datadir(tmp_path, request):
test_dir = pathlib.Path(request.module.__file__).with_suffix('')

if test_dir.is_dir():
distutils.dir_util.copy_tree(test_dir, str(tmp_path))
dir_util.copy_tree(test_dir, str(tmp_path))
# shutil is nicer, but doesn't work: https://bugs.python.org/issue20849
# Once pyhf is Python 3.8+ only then the below can be used.
# shutil.copytree(test_dir, tmpdir)
Expand Down

0 comments on commit 1cf0ac6

Please sign in to comment.