unitelabs.jsondocs.dependencies
Functions
get_distribution_map() -> dict[str, str]
Create mapping of canonicalized distribution names to import package names within the current python environment.
Response
- Type
- dict[str, str]
- Description
get_semver(version_str : str) -> str
For a distribution or build version string build the semver version string.
Parameters
- Name
version_str
- Type
- str
- Default
- Description
Response
- Type
- str
- Description
get_dependency_info(
- packge_req : str,
- distribution_map : dict
For a given package distribution requirement string, e.g. "package==0.48.0" or "package<4.0,>=3.9", get the import name and version information based on the currently loaded packages in sys.path.
Parameters
- Name
packge_req
- Type
- str
- Default
- Description
- Name
distribution_map
- Type
- dict
- Default
- Description
Response
- Type
- DependencyInfo
- Description
Classes
DependencyInfo
- Bases
- typing.TypedDict
Attributes
- Name
dist_name
- Type
- str
- Value
= None
- Description
- Name
name
- Type
- str
- Value
= None
- Description
- Name
version
- Type
- str
- Value
= None
- Description
DistributionInfo
Methods
__init__(self, package_name : str) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
package_name
- Type
- str
- Default
- Description
get_dependencies(self) -> None
Get all dependencies of the given package, including the python version required by the package.
get_dependency_info(self, package_req : str) -> DependencyInfo
Parameters
- Name
self
- Type
- Default
- Description
- Name
package_req
- Type
- str
- Default
- Description
Response
- Type
- DependencyInfo
- Description
Attributes
- Name
package_name
- Type
- Value
= package_name
- Description
- Name
distribution_map
- Type
- Value
= get_distribution_map()
- Description
- Name
_distribution
- Type
- Value
= importlib_metadata.distribution(self.package_name)
- Description
- Name
distribution
- Type
- importlib_metadata.Distribution
- Value
= None
- Description