Python functions to get top-level importables names
0

Configure Feed

Select the types of activity you want to include in your feed.

Add conditional import for tomli for older Python versions

Juan Luis Cano Rodríguez (Dec 4, 2023, 9:45 PM +0100) 4542022f 9402574d

+5 -1
+1
pyproject.toml
··· 12 12 "build", 13 13 "installer", 14 14 "pyproject_hooks", 15 + "tomli ; python_version < '3.11'", 15 16 "validate-pyproject", 16 17 ] 17 18 authors = [
+4 -1
src/pygetpackages/__init__.py
··· 24 24 25 25 import pathlib 26 26 import tempfile 27 - import tomllib 28 27 import typing as t 29 28 import zipfile 30 29 31 30 from build import ProjectBuilder 31 + try: 32 + import tomllib 33 + except ImportError: 34 + import tomli as tomllib 32 35 from build.env import DefaultIsolatedEnv 33 36 from installer.sources import WheelFile, WheelSource 34 37 from installer.utils import parse_metadata_file