File: test_packages_support.py

package info (click to toggle)
python-pipx 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,776 kB
  • sloc: python: 9,653; makefile: 17; sh: 7
file content (21 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import platform
import sys
from pathlib import Path

PYTHON_VERSION_STR = f"{sys.version_info[0]}.{sys.version_info[1]}"

# Platform logic
if sys.platform == "darwin":
    FULL_PLATFORM = "macos" + platform.release().split(".")[0]
elif sys.platform == "win32":
    FULL_PLATFORM = "win"
else:
    FULL_PLATFORM = "unix"


def get_platform_list_path(package_list_dir_path: Path) -> Path:
    return package_list_dir_path / f"{FULL_PLATFORM}-python{PYTHON_VERSION_STR}.txt"


def get_platform_packages_dir_path(pipx_package_cache_path: Path) -> Path:
    return pipx_package_cache_path / f"{PYTHON_VERSION_STR}"