find_work.core.utils#
Utility functions and classes.
- find_work.core.utils.extract_package_name(line: str) str | None #
Find the first CPV-looking thing in a line and try to extract its package name.
- Parameters:
line – line to match
- Returns:
qualified package name or
None
>>> extract_package_name("Please bump Firefox") is None True >>> extract_package_name("sys-kernel/genkernel-4-3-10 is an invalid atom") is None True >>> extract_package_name("media-libs/libjxl: version bump") 'media-libs/libjxl' >>> extract_package_name(">=dev-java/ant-1.10.14: version bump - needed for jdk:21") 'dev-java/ant' >>> extract_package_name("dev-cpp/std-format-0_pre20220112-r1 fails to compile") 'dev-cpp/std-format' >>> extract_package_name("app-foo/bar-2-baz-4.0: version bump") 'app-foo/bar-2-baz'
- find_work.core.utils.aiohttp_session() AsyncGenerator[ClientSession, None] #
Construct an
aiohttp.ClientSession
object with out settings.
- find_work.core.utils.requests_session() Session #
Construct an
requests.Session
object with out settings.