Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/migrate_extrinsic_metadata.py
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | deposit_revision_message_re = re.compile( | ||||
b"Deposit (?P<deposit_id>[0-9]+) in collection (?P<collection>[a-z]+).*" | b"Deposit (?P<deposit_id>[0-9]+) in collection (?P<collection>[a-z]+).*" | ||||
) | ) | ||||
# not reliable, because PyPI allows arbitrary names | # not reliable, because PyPI allows arbitrary names | ||||
def pypi_project_from_filename(filename): | def pypi_project_from_filename(filename): | ||||
match = re.match( | match = re.match( | ||||
r"^(?P<project_name>[a-zA-Z0-9_.-]+)" | r"^(?P<project_name>[a-zA-Z0-9_.-]+)" | ||||
r"-[0-9.]+([a-z]+[0-9]+)?(\.dev[0-9]+)?\.(tar\.gz|zip)$", | r"-[0-9.]+([a-z]+[0-9]+)?(dev|\.dev[0-9]+)?(-[a-z][a-z0-9]*)?\.(tar\.gz|zip)$", | ||||
filename, | filename, | ||||
) | ) | ||||
assert match, filename | assert match, filename | ||||
return match.group("project_name") | return match.group("project_name") | ||||
def cran_package_from_url(filename): | def cran_package_from_url(filename): | ||||
match = re.match( | match = re.match( | ||||
▲ Show 20 Lines • Show All 859 Lines • Show Last 20 Lines |