Skip to content

Commit

Permalink
Fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixS90 committed Jun 6, 2024
1 parent 413a36d commit 2c80964
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/actions/steps_download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ inputs:
required: true
RunShell:
required: true
PkgVersion:
required: true
runs:
using: composite
steps:
Expand All @@ -31,6 +33,8 @@ runs:
TMP: "${{ runner.temp }}"
TESTRESULTSPATH: "${{ runner.temp }}"
COVRESULTSPATH: "${{ runner.temp }}\\cov.xml"
# Optionally used inside test environment to check for version specific functionality
PYTHON_SEMANTIC_RELEASE_VERSION: "${{inputs.PkgVersion}}"
run: tox --installpkg ${{ runner.workspace }}/${{inputs.ArtifactName}}/* -vv -r -s true
shell: "${{inputs.RunShell}}"
working-directory: "${{inputs.PkgRootFolder}}"
16 changes: 16 additions & 0 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,20 @@ jobs:
- uses: actions/checkout@v4.1.0
with:
lfs: true
submodules: recursive
# Python Semantic Release needs access to the full history to determine whether a release should be made.
fetch-depth: 0
- uses: "./.github/actions/steps_psr"
with:
PyVersionLatest: "${{inputs.PyVersionLatest}}"
PkgRootFolder: "${{ github.workspace }}/${{inputs.PkgRootFolder}}"
- uses: "./.github/actions/steps_download"
with:
PyVersionLatest: "${{inputs.PyVersionLatest}}"
ArtifactName: Wheel${{inputs.PyVersionLatest}}
PkgRootFolder: "${{ github.workspace }}/${{inputs.PkgRootFolder}}"
RunShell: cmd
PkgVersion: "${{ steps.pythonsemanticrelease.outputs.version }}"
if: inputs.Pure == true
needs: PackageWheelsPure
DownloadTestSdist:
Expand All @@ -227,12 +235,20 @@ jobs:
- uses: actions/checkout@v4.1.0
with:
lfs: true
submodules: recursive
# Python Semantic Release needs access to the full history to determine whether a release should be made.
fetch-depth: 0
- uses: "./.github/actions/steps_psr"
with:
PyVersionLatest: "${{inputs.PyVersionLatest}}"
PkgRootFolder: "${{ github.workspace }}/${{inputs.PkgRootFolder}}"
- uses: "./.github/actions/steps_download"
with:
PyVersionLatest: "${{inputs.PyVersionLatest}}"
ArtifactName: Sdist
PkgRootFolder: "${{ github.workspace }}/${{inputs.PkgRootFolder}}"
RunShell: ${{ matrix.config.RunShell }}
PkgVersion: "${{ steps.pythonsemanticrelease.outputs.version }}"
needs: PackageSDist
Upload:
permissions:
Expand Down
22 changes: 13 additions & 9 deletions pylibCZIrw/tests/integration/write/test_write.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Module implementing integration tests for the write function of the CziWriter class"""

import os
from os.path import join, abspath, dirname
from collections import OrderedDict
import tempfile
Expand Down Expand Up @@ -142,14 +142,18 @@ def test_write_succeeds_if_file_does_not_exist(exist_ok: bool, path: str) -> Non
def test_write_metadata_application_version_matches_package_version() -> None:
"""Tests that Metadata/Information/Application/Version matches the package version as specified in setup.py"""
# Arrange
# retrieve version as generated through setup.py
root = join(abspath(dirname(dirname(dirname(dirname(dirname(__file__)))))))
with open(join(root, "setup.py"), encoding="utf-8") as f:
readme = f.readlines()
for line in readme:
if "VERSION" in line:
setup_version = line.split('"')[1]
break
# retrieve version as generated through setup.py (locally) or env set through python-semantic-release in pipeline
setup_version = os.getenv("PYTHON_SEMANTIC_RELEASE_VERSION")
if setup_version is None:
root = join(abspath(dirname(dirname(dirname(dirname(dirname(__file__)))))))
with open(join(root, "setup.py"), encoding="utf-8") as f:
readme = f.readlines()
for line in readme:
if "VERSION" in line:
setup_version = line.split('"')[1]
break

assert setup_version is not None

original_plane = get_plane(CZI_DOCUMENT_TEST_WRITE1, None)
with tempfile.TemporaryDirectory() as td:
Expand Down

0 comments on commit 2c80964

Please sign in to comment.