(cls, location, package_only=False)
| 1679 | |
| 1680 | @classmethod |
| 1681 | def parse(cls, location, package_only=False): |
| 1682 | with open(location) as f: |
| 1683 | content = f.read() |
| 1684 | |
| 1685 | data = json.loads(content) |
| 1686 | |
| 1687 | sha256 = None |
| 1688 | if '_meta' in data: |
| 1689 | for name, meta in data['_meta'].items(): |
| 1690 | if name == 'hash': |
| 1691 | sha256 = meta.get('sha256') |
| 1692 | |
| 1693 | dependent_packages = parse_with_dparse2( |
| 1694 | location=location, |
| 1695 | file_name='Pipfile.lock', |
| 1696 | ) |
| 1697 | |
| 1698 | package_data = dict( |
| 1699 | datasource_id=cls.datasource_id, |
| 1700 | type=cls.default_package_type, |
| 1701 | primary_language=cls.default_primary_language, |
| 1702 | sha256=sha256, |
| 1703 | dependencies=dependent_packages, |
| 1704 | ) |
| 1705 | yield models.PackageData.from_data(package_data, package_only) |
| 1706 | |
| 1707 | |
| 1708 | class PipRequirementsFileHandler(BaseDependencyFileHandler): |
nothing calls this directly
no test coverage detected