From 0a189475f1972591791b7e61fda2481f21e6fdb3 Mon Sep 17 00:00:00 2001 From: kchason Date: Mon, 26 Aug 2024 19:20:46 -0400 Subject: [PATCH 1/5] Add python version to artifacts --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f949262..2354a2b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -75,7 +75,7 @@ jobs: - name: Upload HTML Docs uses: actions/upload-artifact@v3 with: - name: packages + name: packages-${{ matrix.python-version }} path: ./dist/ # If this commit is the result of a Git tag, push the wheel and tar packages From 9255a2cab0b9a9d1ec3ec6a29e3243edc7251a04 Mon Sep 17 00:00:00 2001 From: kchason Date: Mon, 26 Aug 2024 19:27:45 -0400 Subject: [PATCH 2/5] Fetch submodules --- .github/workflows/prerelease.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index a4dfe11..64c6727 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -33,10 +33,15 @@ jobs: - '3.12' steps: - - uses: actions/checkout@v3 + - name: Checkout Repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Review dependencies run: make check-supply-chain-pre-commit From a57cb0cbea9b466418fb69e03e04474f416a90ad Mon Sep 17 00:00:00 2001 From: kchason Date: Mon, 26 Aug 2024 19:30:19 -0400 Subject: [PATCH 3/5] Update dependencies for pre-commit --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a617f7c..5c4f5a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pycqa/isort From 1806ec4f27d894b84cb7a01bd4304cbaf069a92e Mon Sep 17 00:00:00 2001 From: kchason Date: Mon, 26 Aug 2024 19:43:16 -0400 Subject: [PATCH 4/5] Fix pre-commit formatting --- case_utils/case_sparql_construct/__init__.py | 8 ++++--- case_utils/case_sparql_select/__init__.py | 8 ++++--- case_utils/case_validate/__init__.py | 24 +++++++++++--------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/case_utils/case_sparql_construct/__init__.py b/case_utils/case_sparql_construct/__init__.py index 46072c0..e6eaa36 100644 --- a/case_utils/case_sparql_construct/__init__.py +++ b/case_utils/case_sparql_construct/__init__.py @@ -42,9 +42,11 @@ def main() -> None: # Configure debug logging before running parse_args, because there could be an error raised before the construction of the argument parser. logging.basicConfig( - level=logging.DEBUG - if ("--debug" in sys.argv or "-d" in sys.argv) - else logging.INFO + level=( + logging.DEBUG + if ("--debug" in sys.argv or "-d" in sys.argv) + else logging.INFO + ) ) parser.add_argument("-d", "--debug", action="store_true") diff --git a/case_utils/case_sparql_select/__init__.py b/case_utils/case_sparql_select/__init__.py index f1c7bb7..906d1ad 100644 --- a/case_utils/case_sparql_select/__init__.py +++ b/case_utils/case_sparql_select/__init__.py @@ -197,9 +197,11 @@ def main() -> None: # Configure debug logging before running parse_args, because there could be an error raised before the construction of the argument parser. logging.basicConfig( - level=logging.DEBUG - if ("--debug" in sys.argv or "-d" in sys.argv) - else logging.INFO + level=( + logging.DEBUG + if ("--debug" in sys.argv or "-d" in sys.argv) + else logging.INFO + ) ) parser.add_argument("-d", "--debug", action="store_true") diff --git a/case_utils/case_validate/__init__.py b/case_utils/case_validate/__init__.py index 8e606ee..bc1125f 100644 --- a/case_utils/case_validate/__init__.py +++ b/case_utils/case_validate/__init__.py @@ -120,14 +120,14 @@ def validate( ) # Validate data graph against ontology graph. - validate_result: Tuple[ - bool, Union[Exception, bytes, str, rdflib.Graph], str - ] = pyshacl.validate( - data_graph, - *args, - ont_graph=ontology_graph, - shacl_graph=ontology_graph, - **kwargs, + validate_result: Tuple[bool, Union[Exception, bytes, str, rdflib.Graph], str] = ( + pyshacl.validate( + data_graph, + *args, + ont_graph=ontology_graph, + shacl_graph=ontology_graph, + **kwargs, + ) ) # Relieve RAM of the data graph after validation has run. @@ -159,9 +159,11 @@ def main() -> None: # could be an error raised before the construction of the argument # parser. logging.basicConfig( - level=logging.DEBUG - if ("--debug" in sys.argv or "-d" in sys.argv) - else logging.INFO + level=( + logging.DEBUG + if ("--debug" in sys.argv or "-d" in sys.argv) + else logging.INFO + ) ) # Add arguments specific to case_validate. From abea835aa602a205c0fe1d30f4cad788da6a0ac1 Mon Sep 17 00:00:00 2001 From: kchason Date: Tue, 27 Aug 2024 09:18:59 -0400 Subject: [PATCH 5/5] Explicitly install setup tools --- .github/workflows/cicd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 2354a2b..19b43e8 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -43,27 +43,32 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Pre-commit Checks run: | pip -q install pre-commit pre-commit run --all-files + - name: Start from clean state run: make clean + - name: Run tests run: make PYTHON3=python check # Build the binary wheel as well as the source tar - name: Build Objects run: | - pip install -q twine wheel + pip install -q twine wheel setuptools python setup.py sdist bdist_wheel # Ensure the objects were packaged correctly and there wasn't an issue with