swh.loader.package.pubdev.loader module#

class swh.loader.package.pubdev.loader.PubDevPackageInfo(url: str, filename: str | None, name: str, version: str, last_modified: str, author: Person, *, directory_extrinsic_metadata: List[RawExtrinsicMetadataCore] = [], checksums: Dict[str, str] = {})[source]#

Bases: BasePackageInfo

Method generated by attrs for class PubDevPackageInfo.

name#

Name of the package

version#

Current version

last_modified#

Last modified date as release date

author#

Author

class swh.loader.package.pubdev.loader.PubDevLoader(storage: StorageInterface, url: str, **kwargs)[source]#

Bases: PackageLoader[PubDevPackageInfo]

Loader’s constructor. This raises exception if the minimal required

configuration is missing (cf. fn:check method).

Parameters:
  • storage – Storage instance

  • url – Origin url to load data from

visit_type: str = 'pubdev'#
PUBDEV_BASE_URL = 'https://pub.dev/'#
info() Dict[source]#

Return the project metadata information (fetched from pub.dev registry)

get_versions() Sequence[str][source]#

Get all released versions of a PubDev package

Returns:

A sequence of versions

Example:

["0.1.1", "0.10.2"]

get_default_version() str[source]#

Get the newest release version of a PubDev package

Returns:

A string representing a version

Example:

"0.1.2"

get_package_info(version: str) Iterator[Tuple[str, PubDevPackageInfo]][source]#

Get release name and package information from version

Package info comes from extrinsic metadata (from self.info())

Parameters:

version – Package version (e.g: “0.1.0”)

Returns:

Iterator of tuple (release_name, p_info)

build_release(p_info: PubDevPackageInfo, uncompressed_path: str, directory: bytes) Release | None[source]#

Build the release from the archive metadata (extrinsic artifact metadata) and the intrinsic metadata.

Parameters:
  • p_info – Package information

  • uncompressed_path – Artifact uncompressed path on disk