(
self,
package_name: str,
package: Optional[PypiPackage]=None,
fetch_github: bool=True
)
| 331 | |
| 332 | |
| 333 | def __init__( |
| 334 | self, |
| 335 | package_name: str, |
| 336 | package: Optional[PypiPackage]=None, |
| 337 | fetch_github: bool=True |
| 338 | ): |
| 339 | self.package_name = package_name |
| 340 | |
| 341 | if package is None: |
| 342 | self.pkg = PypiPackage.from_cached(package_name) |
| 343 | else: |
| 344 | self.pkg = package |
| 345 | |
| 346 | self.now = pytz.UTC.localize(datetime.datetime.utcnow()) |
| 347 | self.github = None |
| 348 | |
| 349 | if fetch_github: |
| 350 | try: |
| 351 | self.load_github() |
| 352 | except exceptions.NoSuchRepository: |
| 353 | LOGGER.warning(f"Repository does not exists: `{self.pkg.source_url}`") |
| 354 | |
| 355 | def load_github(self): |
| 356 | self.repo_url = self.pkg.source_url |
nothing calls this directly
no test coverage detected