Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# This file is part of CycloneDX Python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.

# For details of what checks are run for PRs please refer below
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

Expand Down Expand Up @@ -41,7 +58,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'
- name: Setup poetry ${{ env.POETRY_VERSION }}
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# encoding: utf-8

# This file is part of CycloneDX Python
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,6 +15,9 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.

# For details of what checks are run for PRs please refer below
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: Python CI

on:
Expand Down Expand Up @@ -57,7 +58,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand All @@ -81,7 +81,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand All @@ -105,7 +104,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand Down Expand Up @@ -139,7 +137,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand All @@ -163,7 +160,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand Down Expand Up @@ -197,7 +193,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install self
run: pip install .
- name: run command
Expand All @@ -206,7 +201,7 @@ jobs:
build-and-test:
name: Test (${{ matrix.os }} py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
Expand All @@ -228,8 +223,10 @@ jobs:
include:
- os: macos-13
python-version: "3.10"
unittest-args: []
- os: macos-13
python-version: "3.9"
unittest-args: []
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -241,7 +238,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: craft PY_UT_ARGS
shell: python
run: |-
import sys, os
PY_UT_ARGS=[]
if sys.version_info >= (3, 12):
PY_UT_ARGS.append('--durations=0')
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
env_file.write(f'PY_UT_ARGS={" ".join(PY_UT_ARGS)}\n')
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand All @@ -252,7 +257,7 @@ jobs:
- name: Ensure build successful
run: poetry build
- name: Run tox
run: poetry run tox r -e py -s false
run: poetry run -- tox r -e py -s false -- $PY_UT_ARGS
- name: Generate coverage reports
if: ${{ failure() || success() }}
shell: bash
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# This file is part of CycloneDX Python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.

# For details of what checks are run for PRs please refer below
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: Release

on:
Expand Down Expand Up @@ -57,7 +77,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand All @@ -81,7 +100,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v9
Expand Down Expand Up @@ -122,7 +140,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install and configure Poetry
# See https://github.com/marketplace/actions/install-poetry-action
uses: snok/install-poetry@v1
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ tomli = { version = "^2.0.1", python = "<3.11" }
tox = "4.27.0"
pyupgrade = "3.20.0"
deptry = "0.23.0"
# for tests, use the GPL-version of jsonschema format validators - they are faster
jsonschema = { version = "*", extras = ["format"] }

# min version required to be able to install some dependencies
# see https://github.com/MichaelKim0407/flake8-use-fstring/issues/33
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ allowlist_externals = poetry
## deps = poetry ## << this one caused https://github.com/python-poetry/poetry/issues/6288
commands_pre =
{envpython} --version
poetry install --no-root -v
# poetry install --no-root -v
poetry run pip freeze
commands =
poetry run coverage run --source=cyclonedx_py -m unittest discover -t . -s tests -v
poetry run coverage run --source=cyclonedx_py -m unittest discover -t . -s tests -v {posargs}
setenv =
PYTHONHASHSEED=0
CDX_TEST_RECREATE_SNAPSHOTS={env:CDX_TEST_RECREATE_SNAPSHOTS:}
Expand Down
Loading