From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 642A51382C5 for ; Wed, 16 Dec 2020 10:40:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 28F8BE0986; Wed, 16 Dec 2020 10:40:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 02D76E0986 for ; Wed, 16 Dec 2020 10:40:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9203533BEE8 for ; Wed, 16 Dec 2020 10:40:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21D67C7 for ; Wed, 16 Dec 2020 10:40:24 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1608115220.eda5e9bfd6481ef10149cc981364a27457fd5a8c.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/fsspec/files/, dev-python/fsspec/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/fsspec/files/fsspec-0.8.2-test-cleanup.patch dev-python/fsspec/fsspec-0.8.2.ebuild X-VCS-Directories: dev-python/fsspec/files/ dev-python/fsspec/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: eda5e9bfd6481ef10149cc981364a27457fd5a8c X-VCS-Branch: master Date: Wed, 16 Dec 2020 10:40:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ad0abd9-fb40-47fa-8889-12d60924feaf X-Archives-Hash: 0ca030caaba7f77341fbf27bb347d3bc commit: eda5e9bfd6481ef10149cc981364a27457fd5a8c Author: Michał Górny gentoo org> AuthorDate: Wed Dec 16 10:38:12 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Dec 16 10:40:20 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eda5e9bf dev-python/fsspec: Fix tests Signed-off-by: Michał Górny gentoo.org> .../fsspec/files/fsspec-0.8.2-test-cleanup.patch | 80 ++++++++++++++++++++++ dev-python/fsspec/fsspec-0.8.2.ebuild | 4 ++ 2 files changed, 84 insertions(+) diff --git a/dev-python/fsspec/files/fsspec-0.8.2-test-cleanup.patch b/dev-python/fsspec/files/fsspec-0.8.2-test-cleanup.patch new file mode 100644 index 00000000000..8227c2d23c6 --- /dev/null +++ b/dev-python/fsspec/files/fsspec-0.8.2-test-cleanup.patch @@ -0,0 +1,80 @@ +From f933694238f78fbef91367d5051d515e0f9d0635 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Wed, 16 Dec 2020 11:32:04 +0100 +Subject: [PATCH] clean up properly after test_git + +Restore original directory after test_git. Otherwise, next tests +are run in non-existing directory and fail: + +[...] +> cwd = os.getcwd() +E FileNotFoundError: [Errno 2] No such file or directory + +/usr/lib/python3.9/site-packages/gunicorn/util.py:443: FileNotFoundError + +While at it, reflow the logic so that the temporary directory is always +cleaned, even if the test fails in middle of setup. +--- + fsspec/implementations/tests/test_git.py | 42 +++++++++++++----------- + 1 file changed, 22 insertions(+), 20 deletions(-) + +diff --git a/fsspec/implementations/tests/test_git.py b/fsspec/implementations/tests/test_git.py +index 562b228..4cd4c3f 100644 +--- a/fsspec/implementations/tests/test_git.py ++++ b/fsspec/implementations/tests/test_git.py +@@ -10,30 +10,32 @@ pygit2 = pytest.importorskip("pygit2") + + @pytest.fixture() + def repo(): ++ orig_dir = os.getcwd() + d = tempfile.mkdtemp() +- os.chdir(d) +- subprocess.call("git init", shell=True, cwd=d) +- subprocess.call("git init", shell=True, cwd=d) +- subprocess.call('git config user.email "you@example.com"', shell=True, cwd=d) +- subprocess.call('git config user.name "Your Name"', shell=True, cwd=d) +- open(os.path.join(d, "file1"), "wb").write(b"data0") +- subprocess.call("git add file1", shell=True, cwd=d) +- subprocess.call('git commit -m "init"', shell=True, cwd=d) +- sha = open(os.path.join(d, ".git/refs/heads/master"), "r").read().strip() +- open(os.path.join(d, "file1"), "wb").write(b"data00") +- subprocess.check_output('git commit -a -m "tagger"', shell=True, cwd=d) +- subprocess.call('git tag -a thetag -m "make tag"', shell=True, cwd=d) +- open(os.path.join(d, "file2"), "wb").write(b"data000") +- subprocess.call("git add file2", shell=True) +- subprocess.call('git commit -m "master tip"', shell=True, cwd=d) +- subprocess.call("git checkout -b abranch", shell=True, cwd=d) +- os.mkdir("inner") +- open(os.path.join(d, "inner", "file1"), "wb").write(b"data3") +- subprocess.call("git add inner/file1", shell=True, cwd=d) +- subprocess.call('git commit -m "branch tip"', shell=True, cwd=d) + try: ++ os.chdir(d) ++ subprocess.call("git init", shell=True, cwd=d) ++ subprocess.call("git init", shell=True, cwd=d) ++ subprocess.call('git config user.email "you@example.com"', shell=True, cwd=d) ++ subprocess.call('git config user.name "Your Name"', shell=True, cwd=d) ++ open(os.path.join(d, "file1"), "wb").write(b"data0") ++ subprocess.call("git add file1", shell=True, cwd=d) ++ subprocess.call('git commit -m "init"', shell=True, cwd=d) ++ sha = open(os.path.join(d, ".git/refs/heads/master"), "r").read().strip() ++ open(os.path.join(d, "file1"), "wb").write(b"data00") ++ subprocess.check_output('git commit -a -m "tagger"', shell=True, cwd=d) ++ subprocess.call('git tag -a thetag -m "make tag"', shell=True, cwd=d) ++ open(os.path.join(d, "file2"), "wb").write(b"data000") ++ subprocess.call("git add file2", shell=True) ++ subprocess.call('git commit -m "master tip"', shell=True, cwd=d) ++ subprocess.call("git checkout -b abranch", shell=True, cwd=d) ++ os.mkdir("inner") ++ open(os.path.join(d, "inner", "file1"), "wb").write(b"data3") ++ subprocess.call("git add inner/file1", shell=True, cwd=d) ++ subprocess.call('git commit -m "branch tip"', shell=True, cwd=d) + yield d, sha + finally: ++ os.chdir(orig_dir) + shutil.rmtree(d) + + +-- +2.29.2 + diff --git a/dev-python/fsspec/fsspec-0.8.2.ebuild b/dev-python/fsspec/fsspec-0.8.2.ebuild index fe649f0feac..7e7f5fb6a32 100644 --- a/dev-python/fsspec/fsspec-0.8.2.ebuild +++ b/dev-python/fsspec/fsspec-0.8.2.ebuild @@ -31,6 +31,10 @@ BDEPEND=" distutils_enable_tests pytest +PATCHES=( + "${FILESDIR}"/fsspec-0.8.2-test-cleanup.patch +) + src_test() { git config --global user.email "you@example.com" || die git config --global user.name "Your Name" || die