Skip to content

Commit

Permalink
fix: Extract tests from .conda/.tar.bz2 formats
Browse files Browse the repository at this point in the history
via conda-package-streaming

Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed May 8, 2024
1 parent f3f1cbc commit 44731d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions bioconda_utils/bioconda_utils-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ conda=24.3.*
conda-libmamba-solver=24.1.*
conda-build=24.3.*
conda-index=0.4.*
conda-package-streaming=0.9.*
mamba=1.5.*
boa=0.17.*

Expand Down
6 changes: 4 additions & 2 deletions bioconda_utils/pkg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from conda_build.metadata import MetaData
from conda_index.index import update_index
from conda_package_streaming.package_streaming import stream_conda_info

logger = logging.getLogger(__name__)

Expand All @@ -23,8 +24,9 @@
def get_tests(path):
"Extract tests from a built package"
tmp = tempfile.mkdtemp()
t = tarfile.open(path)
t.extractall(tmp)
for tar, member in stream_conda_info(path):
if member.name.startswith("info/recipe/"):
tar.extract(member, tmp)
input_dir = os.path.join(tmp, 'info', 'recipe')

tests = [
Expand Down

0 comments on commit 44731d5

Please sign in to comment.