diff --git a/cyclonedx_py/_internal/pipenv.py b/cyclonedx_py/_internal/pipenv.py index 0c1d5997d..8bcde3439 100644 --- a/cyclonedx_py/_internal/pipenv.py +++ b/cyclonedx_py/_internal/pipenv.py @@ -202,6 +202,8 @@ def __is_local(self, data: 'NameDict') -> bool: location: str = data['file'] elif 'path' in data: location = data['path'] + elif (vcs_source := self.__package_vcs(data)) is not None: + location = vcs_source[1] else: return False # schema length is expected to be at least 2 chars, to prevent confusion with Windows drive letters `C:\` diff --git a/tests/_data/infiles/pipenv/local-vcs/Pipfile b/tests/_data/infiles/pipenv/local-vcs/Pipfile new file mode 100644 index 000000000..ff13a5e41 --- /dev/null +++ b/tests/_data/infiles/pipenv/local-vcs/Pipfile @@ -0,0 +1,9 @@ +[pipenv] +sort_pipfile = true + +[packages] +my-local-project = {git = "git+file:///home/user/projects/my-local-project", ref = "da59ad000d1405eaecd557175e29083a87d19f7c"} +six = {git = "git+https://github.com/benjaminp/six.git", ref = "1.16.0"} +my-other-local-project = {git = "file:///home/user/projects/my-other-local-project", ref = "da59ad000d1405eaecd557175e29083a87d19f7c"} + +[dev-packages] \ No newline at end of file diff --git a/tests/_data/infiles/pipenv/local-vcs/Pipfile.lock b/tests/_data/infiles/pipenv/local-vcs/Pipfile.lock new file mode 100644 index 000000000..7e9cc5a16 --- /dev/null +++ b/tests/_data/infiles/pipenv/local-vcs/Pipfile.lock @@ -0,0 +1,31 @@ +{ + "_meta": { + "hash": { + "sha256": "0000000000000000000000000000000000000000000000000000000000000000" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "my-local-project": { + "git": "git+file:///home/user/projects/my-local-project", + "ref": "da59ad000d1405eaecd557175e29083a87d19f7c" + }, + "my-other-local-project": { + "git": "file:///home/user/projects/my-other-local-project", + "ref": "da59ad000d1405eaecd557175e29083a87d19f7c" + }, + "six": { + "git": "git+https://github.com/benjaminp/six.git", + "ref": "65486e4383f9f411da95937451205d3c7b61b9e1" + } + }, + "develop": {} +} \ No newline at end of file diff --git a/tests/_data/infiles/pipenv/local-vcs/pyproject.toml b/tests/_data/infiles/pipenv/local-vcs/pyproject.toml new file mode 100644 index 000000000..81f950cc4 --- /dev/null +++ b/tests/_data/infiles/pipenv/local-vcs/pyproject.toml @@ -0,0 +1,5 @@ +[project] +# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata +name = "local-vcs" +version = "0.1.0" +description = "packages from local VCS repositories" \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.0.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.0.xml.bin new file mode 100644 index 000000000..81a0a2b27 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.0.xml.bin @@ -0,0 +1,21 @@ + + + + + my-local-project + + false + + + my-other-local-project + + false + + + six + + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + false + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.1.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.1.xml.bin new file mode 100644 index 000000000..ccd372b05 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.1.xml.bin @@ -0,0 +1,36 @@ + + + + + my-local-project + + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + + my-other-local-project + + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + + six + + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.json.bin new file mode 100644 index 000000000..adc3d3e84 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.json.bin @@ -0,0 +1,83 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "type": "library", + "version": "" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "type": "library", + "version": "" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library", + "version": "" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "tools": [ + { + "name": "cyclonedx-py", + "vendor": "CycloneDX", + "version": "thisVersion-testing" + }, + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "libVersion-testing" + } + ] + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.2" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.xml.bin new file mode 100644 index 000000000..1a9fc93bd --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.2.xml.bin @@ -0,0 +1,61 @@ + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + + + my-local-project + + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + + my-other-local-project + + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + + six + + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + + + + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.json.bin new file mode 100644 index 000000000..c08c3877e --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.json.bin @@ -0,0 +1,107 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library", + "version": "" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library", + "version": "" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library", + "version": "" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "properties": [ + { + "name": "cdx:reproducible", + "value": "true" + } + ], + "tools": [ + { + "name": "cyclonedx-py", + "vendor": "CycloneDX", + "version": "thisVersion-testing" + }, + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "libVersion-testing" + } + ] + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.3a.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.3" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.xml.bin new file mode 100644 index 000000000..73fbb4341 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.3.xml.bin @@ -0,0 +1,73 @@ + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + true + + + + + my-local-project + + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + my-other-local-project + + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + six + + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + default + + + + + + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.json.bin new file mode 100644 index 000000000..3ce9698f0 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.json.bin @@ -0,0 +1,139 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "properties": [ + { + "name": "cdx:reproducible", + "value": "true" + } + ], + "tools": [ + { + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-bom/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-bom-tool.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python/" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python/#readme" + } + ], + "name": "cyclonedx-py", + "vendor": "CycloneDX", + "version": "thisVersion-testing" + }, + { + "externalReferences": [ ], + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "libVersion-testing" + } + ] + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.4" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.xml.bin new file mode 100644 index 000000000..dd8eb7214 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.4.xml.bin @@ -0,0 +1,97 @@ + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + + + https://github.com/CycloneDX/cyclonedx-python/actions + + + https://pypi.org/project/cyclonedx-bom/ + + + https://cyclonedx-bom-tool.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python/issues + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python/ + + + https://github.com/CycloneDX/cyclonedx-python/#readme + + + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + true + + + + + my-local-project + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + my-other-local-project + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + six + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + default + + + + + + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.json.bin new file mode 100644 index 000000000..3b55cc9c8 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.json.bin @@ -0,0 +1,153 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "properties": [ + { + "name": "cdx:reproducible", + "value": "true" + } + ], + "tools": { + "components": [ + { + "description": "CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments", + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-bom/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-bom-tool.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python/" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python/#readme" + } + ], + "group": "CycloneDX", + "licenses": [ + { + "license": { + "id": "Apache-2.0" + } + } + ], + "name": "cyclonedx-py", + "type": "application", + "version": "thisVersion-testing" + }, + { + "description": "stripped", + "externalReferences": [ ], + "group": "CycloneDX", + "licenses": [ ], + "name": "cyclonedx-python-lib", + "type": "library", + "version": "libVersion-testing" + } + ] + } + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.5" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.xml.bin new file mode 100644 index 000000000..0f2e6d365 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.5.xml.bin @@ -0,0 +1,107 @@ + + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments + + + Apache-2.0 + + + + + https://github.com/CycloneDX/cyclonedx-python/actions + + + https://pypi.org/project/cyclonedx-bom/ + + + https://cyclonedx-bom-tool.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python/issues + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python/ + + + https://github.com/CycloneDX/cyclonedx-python/#readme + + + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + true + + + + + my-local-project + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + my-other-local-project + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + six + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + default + + + + + + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.json.bin new file mode 100644 index 000000000..40d2d76bb --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.json.bin @@ -0,0 +1,154 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "properties": [ + { + "name": "cdx:reproducible", + "value": "true" + } + ], + "tools": { + "components": [ + { + "description": "CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments", + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-bom/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-bom-tool.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python/" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python/#readme" + } + ], + "group": "CycloneDX", + "licenses": [ + { + "license": { + "acknowledgement": "declared", + "id": "Apache-2.0" + } + } + ], + "name": "cyclonedx-py", + "type": "application", + "version": "thisVersion-testing" + }, + { + "description": "stripped", + "externalReferences": [ ], + "group": "CycloneDX", + "licenses": [ ], + "name": "cyclonedx-python-lib", + "type": "library", + "version": "libVersion-testing" + } + ] + } + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.6" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.xml.bin new file mode 100644 index 000000000..285cb8859 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.6.xml.bin @@ -0,0 +1,107 @@ + + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments + + + Apache-2.0 + + + + + https://github.com/CycloneDX/cyclonedx-python/actions + + + https://pypi.org/project/cyclonedx-bom/ + + + https://cyclonedx-bom-tool.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python/issues + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python/ + + + https://github.com/CycloneDX/cyclonedx-python/#readme + + + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + true + + + + + my-local-project + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + my-other-local-project + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + six + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + default + + + + + + + + + + diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.json.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.json.bin new file mode 100644 index 000000000..57c2f5d65 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.json.bin @@ -0,0 +1,154 @@ +{ + "components": [ + { + "bom-ref": "my-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "my-other-local-project", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c" + } + ], + "name": "my-other-local-project", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "type": "library" + }, + { + "bom-ref": "six", + "externalReferences": [ + { + "comment": "from git", + "type": "vcs", + "url": "git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1" + } + ], + "name": "six", + "properties": [ + { + "name": "cdx:pipenv:category", + "value": "default" + } + ], + "purl": "pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1", + "type": "library" + } + ], + "dependencies": [ + { + "ref": "my-local-project" + }, + { + "ref": "my-other-local-project" + }, + { + "ref": "root-component" + }, + { + "ref": "six" + } + ], + "metadata": { + "component": { + "bom-ref": "root-component", + "description": "packages from local VCS repositories", + "name": "local-vcs", + "type": "application", + "version": "0.1.0" + }, + "properties": [ + { + "name": "cdx:reproducible", + "value": "true" + } + ], + "tools": { + "components": [ + { + "description": "CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments", + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-bom/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-bom-tool.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python/" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python/#readme" + } + ], + "group": "CycloneDX", + "licenses": [ + { + "license": { + "acknowledgement": "declared", + "id": "Apache-2.0" + } + } + ], + "name": "cyclonedx-py", + "type": "application", + "version": "thisVersion-testing" + }, + { + "description": "stripped", + "externalReferences": [ ], + "group": "CycloneDX", + "licenses": [ ], + "name": "cyclonedx-python-lib", + "type": "library", + "version": "libVersion-testing" + } + ] + } + }, + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.7" +} \ No newline at end of file diff --git a/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.xml.bin b/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.xml.bin new file mode 100644 index 000000000..51ff1cdc6 --- /dev/null +++ b/tests/_data/snapshots/pipenv/plain_local-vcs_1.7.xml.bin @@ -0,0 +1,107 @@ + + + + + + + CycloneDX + cyclonedx-py + thisVersion-testing + CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments + + + Apache-2.0 + + + + + https://github.com/CycloneDX/cyclonedx-python/actions + + + https://pypi.org/project/cyclonedx-bom/ + + + https://cyclonedx-bom-tool.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python/issues + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python/ + + + https://github.com/CycloneDX/cyclonedx-python/#readme + + + + + CycloneDX + cyclonedx-python-lib + libVersion-testing + + + + + + + + local-vcs + 0.1.0 + packages from local VCS repositories + + + true + + + + + my-local-project + + + git+file:///home/user/projects/my-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + my-other-local-project + + + file:///home/user/projects/my-other-local-project#da59ad000d1405eaecd557175e29083a87d19f7c + from git + + + + default + + + + six + pkg:pypi/six?vcs_url=git%2Bhttps://github.com/benjaminp/six.git%4065486e4383f9f411da95937451205d3c7b61b9e1 + + + git+https://github.com/benjaminp/six.git#65486e4383f9f411da95937451205d3c7b61b9e1 + from git + + + + default + + + + + + + + + +