Skip to content

Commit 95c6893

Browse files
authored
Merge branch 'master' into add-conda-hash
2 parents 51afacf + e2be444 commit 95c6893

File tree

12 files changed

+161
-90
lines changed

12 files changed

+161
-90
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Setup python ${{ env.PYTHON_VERISON }}
3535
# see https://github.com/actions/setup-python
36-
uses: actions/setup-python@v3
36+
uses: actions/setup-python@v4
3737
with:
3838
python-version: ${{ env.PYTHON_VERISON }}
3939
- name: Setup poetry ${{ env.POETRY_VERSION }}

.github/workflows/manual-release-candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v3
2525
with:
2626
fetch-depth: 0
27-
- uses: actions/setup-python@v3
27+
- uses: actions/setup-python@v4
2828
with:
2929
python-version: ${{ env.PYTHON_VERISON }}
3030
- name: Install dependencies

.github/workflows/python.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/checkout@v3
4444
- name: Setup Python Environment
4545
# see https://github.com/actions/setup-python
46-
uses: actions/setup-python@v3
46+
uses: actions/setup-python@v4
4747
with:
4848
python-version: ${{ env.PYTHON_VERISON_DEFAULT }}
4949
architecture: 'x64'
@@ -55,19 +55,29 @@ jobs:
5555
- name: Install dependencies
5656
run: poetry install
5757
- name: Run tox
58-
run: poetry run tox -e flake8
58+
run: poetry run tox -e flake8 -s false
5959

6060
static-code-analysis:
61-
name: Static Coding Analysis
61+
name: Static Coding Analysis (py${{ matrix.python-version}} ${{ matrix.toxenv-factor }})
6262
runs-on: ubuntu-latest
6363
timeout-minutes: 10
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
include:
68+
- # test with the locked dependencies
69+
python-version: '3.10'
70+
toxenv-factor: 'locked'
71+
- # test with the lowest dependencies
72+
python-version: '3.6'
73+
toxenv-factor: 'lowest'
6474
steps:
6575
- name: Checkout
6676
# see https://github.com/actions/checkout
6777
uses: actions/checkout@v3
6878
- name: Setup Python Environment
6979
# see https://github.com/actions/setup-python
70-
uses: actions/setup-python@v3
80+
uses: actions/setup-python@v4
7181
with:
7282
python-version: ${{ env.PYTHON_VERISON_DEFAULT }}
7383
architecture: 'x64'
@@ -79,10 +89,10 @@ jobs:
7989
- name: Install dependencies
8090
run: poetry install
8191
- name: Run tox
82-
run: poetry run tox -e mypy
92+
run: poetry run tox -e mypy-${{ matrix.toxenv-factor }} -s false
8393

8494
build-and-test:
85-
name: Tests for Python ${{ matrix.python-version }} on ${{ matrix.os }}
95+
name: Test (${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.toxenv-factor }})
8696
runs-on: ${{ matrix.os }}
8797
timeout-minutes: 10
8898
env:
@@ -97,6 +107,12 @@ jobs:
97107
- "3.8"
98108
- "3.7"
99109
- "3.6" # lowest supported
110+
toxenv-factor: ['locked']
111+
include:
112+
- # test with the lowest dependencies
113+
os: 'ubuntu-latest'
114+
python-version: '3.6'
115+
toxenv-factor: 'lowest'
100116
steps:
101117
- name: Checkout
102118
# see https://github.com/actions/checkout
@@ -105,7 +121,7 @@ jobs:
105121
run: mkdir ${{ env.REPORTS_DIR }}
106122
- name: Setup Python Environment
107123
# see https://github.com/actions/setup-python
108-
uses: actions/setup-python@v3
124+
uses: actions/setup-python@v4
109125
with:
110126
python-version: ${{ matrix.python-version }}
111127
architecture: 'x64'
@@ -119,11 +135,11 @@ jobs:
119135
- name: Ensure build successful
120136
run: poetry build
121137
- name: Run tox
122-
run: poetry run tox -e py -s false
138+
run: poetry run tox -e py-${{ matrix.toxenv-factor }} -s false
123139
- name: Generate coverage reports
124140
run: >
125141
poetry run coverage report &&
126-
poetry run coverage xml -o ${{ env.REPORTS_DIR }}/coverage-${{ matrix.os }}-${{ matrix.python-version }}.xml &&
142+
poetry run coverage xml -o ${{ env.REPORTS_DIR }}/coverage-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.toxenv-factor }}.xml &&
127143
poetry run coverage html -d ${{ env.REPORTS_DIR }}
128144
- name: Artifact reports
129145
if: ${{ ! cancelled() }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
fetch-depth: 0 # action `relekang/python-semantic-release` requires all git history
5555
- name: Setup python ${{ env.PYTHON_VERISON }}
5656
# see https://github.com/actions/setup-python
57-
uses: actions/setup-python@v3
57+
uses: actions/setup-python@v4
5858
with:
5959
python-version: ${{ env.PYTHON_VERISON }}
6060
- name: Setup poetry ${{ env.POETRY_VERSION }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
<!--next-version-placeholder-->
44

5+
## v3.2.2 (2022-06-02)
6+
### Fix
7+
* Add actively used (transitive) dependencies ([#363](https://github.com/CycloneDX/cyclonedx-python/issues/363)) ([`1f45ad9`](https://github.com/CycloneDX/cyclonedx-python/commit/1f45ad9162be511f07e9310414793218c554a097))
8+
59
## v3.2.1 (2022-04-05)
610
### Fix
711
* Cli default file for json format ([`8747620`](https://github.com/CycloneDX/cyclonedx-python/commit/8747620dac7ed3eeff69369c05dfb6386a56e549))

cyclonedx_py/client.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,24 @@ def get_output(self) -> BaseOutput:
105105

106106
bom = Bom.from_parser(parser=parser)
107107

108-
# Add cyclonedx_bom as a Tool to record it being part of the CycloneDX SBOM generation process
109-
if sys.version_info >= (3, 8, 0):
110-
from importlib.metadata import version as md_version
108+
# region Add cyclonedx_bom as a Tool to record it being part of the CycloneDX SBOM generation process
109+
if sys.version_info < (3, 8):
110+
from typing import Callable
111+
112+
from importlib_metadata import version as __md_version
113+
114+
# this stupid kind of code is needed to satisfy mypy/typing
115+
_md_version: Callable[[str], str] = __md_version
111116
else:
112-
from importlib_metadata import version as md_version # type: ignore
117+
from importlib.metadata import version as _md_version
118+
_this_tool_name = 'cyclonedx-bom'
119+
_this_tool_version: Optional[str] = _md_version(_this_tool_name)
113120
bom.metadata.tools.add(Tool(
114-
vendor='CycloneDX', name='cyclonedx-bom', version=md_version('cyclonedx-bom')
121+
vendor='CycloneDX',
122+
name=_this_tool_name,
123+
version=_this_tool_version
115124
))
125+
# endregion
116126

117127
return get_output_instance(
118128
bom=bom,

cyclonedx_py/parser/environment.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
from pkg_resources import DistInfoDistribution # type: ignore
3636

3737
if sys.version_info >= (3, 8):
38-
from email.message import Message as _MetadataReturn
38+
if sys.version_info >= (3, 10):
39+
from importlib.metadata import PackageMetadata as _MetadataReturn
40+
else:
41+
from email.message import Message as _MetadataReturn
3942
from importlib.metadata import metadata
4043
else:
4144
from importlib_metadata import metadata, PackageMetadata as _MetadataReturn

0 commit comments

Comments
 (0)