File: testutils.py

package info (click to toggle)
pdm-backend 2.4.5%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,124 kB
  • sloc: python: 2,833; ansic: 21; makefile: 5; sh: 1
file content (15 lines) | stat: -rw-r--r-- 330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from __future__ import annotations

import tarfile
import zipfile
from pathlib import Path


def get_tarball_names(path: Path) -> list[str]:
    with tarfile.open(path, "r:gz") as tar:
        return tar.getnames()


def get_wheel_names(path: Path) -> list[str]:
    with zipfile.ZipFile(path) as zf:
        return zf.namelist()