swh.loader.package.bioconductor.loader module#

class swh.loader.package.bioconductor.loader.BioconductorPackageInfo(url: str, filename: str | None, version: str, name: str, intrinsic_version: str, last_update_date: str | None = None, checksums_str: str = None, *, directory_extrinsic_metadata: List[RawExtrinsicMetadataCore] = [], checksums: Dict[str, str] = {})[source]#

Bases: BasePackageInfo

Method generated by attrs for class BioconductorPackageInfo.

intrinsic_version#

Intrinsic version of the package, independent from the distribution (e.g. 1.18.0-5)

last_update_date#

Last update date of the package. (e.g. 2023-04-25)

EXTID_TYPE: str = 'bioconductor-md5'#
MANIFEST_FORMAT: Template | None = <string.Template object>#

If not None, used by the default extid() implementation to format a manifest, before hashing it to produce an ExtID.

classmethod from_metadata(a_metadata: Dict[str, Any], version: str) BioconductorPackageInfo[source]#
class swh.loader.package.bioconductor.loader.BioconductorLoader(storage: StorageInterface, url: str, packages: Dict[str, Dict[str, Any]], **kwargs: Any)[source]#

Bases: PackageLoader[BioconductorPackageInfo]

Bioconductor Loader implementation.

Parameters:
  • url – Origin url (e.g. https://bioconductor.org/packages/a4)

  • packages

    versioned packages and associated artifacts, example:

    {
      "3.16/bioc/1.46.0": {
          "package": "a4",
          "release": "3.16",
          "tar_url": (
              "https://bioconductor.org/packages/3.16/bioc"
              "/src/contrib/a4_1.46.0.tar.gz"
          ),
          "version": "1.46.0",
          "category": "bioc",
          "last_update_date": "2022-11-01",
          "checksums": {
              "md5": "4fe2823df78513c79777d009196856fd"
          }
      },
      # ...
    }
    

visit_type: str = 'bioconductor'#
get_versions() Sequence[str][source]#

Sort package versions in ascending order and return them.

get_default_version() str[source]#

Get the latest release version of a bioconductor package

get_package_info(version: str) Iterator[Tuple[str, BioconductorPackageInfo]][source]#
Given a release version of a package, retrieve the associated

package information for such version.

Parameters:

version – Package version

Returns:

(branch name, package metadata)

build_release(p_info: BioconductorPackageInfo, 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