Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use shutil.copytree over setuptools._distutils #2518

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import pathlib
import shutil
import sys
import tarfile

import pytest
from setuptools._distutils import dir_util

import pyhf

Expand Down Expand Up @@ -164,9 +164,6 @@ def datadir(tmp_path, request):
test_dir = pathlib.Path(request.module.__file__).with_suffix('')

if test_dir.is_dir():
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, tmp_path)
shutil.copytree(test_dir, tmp_path, dirs_exist_ok=True)

return tmp_path