Skip to content

Commit

Permalink
Fixed version handling in workflow.
Browse files Browse the repository at this point in the history
Corrected error in test_version.py
  • Loading branch information
rhjdjong committed Dec 4, 2024
1 parent 6384bee commit d0d1b96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 74 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,79 +69,6 @@ jobs:
name: dist
path: dist/

# details:
# runs-on: ubuntu-latest
# outputs:
# new_version: ${{ steps.release.outputs.latest_version }}
# suffix: ${{ steps.release.outputs.suffix }}
# tag_name: ${{ steps.release.outputs.tag_name }}
# steps:
# - uses: actions/checkout@v2
#
# - name: Extract tag and Details
# id: release
# run: |
# if [ "${{ github.ref_type }}" = "tag" ]; then
# TAG_NAME=${GITHUB_REF#refs/tags/}
# NEW_VERSION=$(echo $TAG_NAME | awk -F'-' '{print $1}')
# SUFFIX=$(echo $TAG_NAME | grep -oP '[a-z]+[0-9]+' || echo "")
# echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
# echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT"
# echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
# echo "Version is $NEW_VERSION"
# echo "Suffix is $SUFFIX"
# echo "Tag name is $TAG_NAME"
# else
# echo "No tag found"
# exit 1
# fi
#
# check_pypi:
# needs: details
#
# - name: Compare versions and exit if not newer
# run: |
# NEW_VERSION=${{ needs.details.outputs.new_version }}
# LATEST_VERSION=$latest_previous_version
# if [ "$(printf '%s\n' "$LATEST_VERSION" "$NEW_VERSION" | sort -rV | head -n 1)" != "$NEW_VERSION" ] || [ "$NEW_VERSION" == "$LATEST_VERSION" ]; then
# echo "The new version $NEW_VERSION is not greater than the latest version $LATEST_VERSION on PyPI."
# exit 1
# else
# echo "The new version $NEW_VERSION is greater than the latest version $LATEST_VERSION on PyPI."
# fi
#
# setup_and_build:
# needs: [details, check_pypi]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.12"
#
# - name: Install Hatch
# run: |
# python -m pip install --upgrade pip setuptools wheel
# pip install hatch
#
# - name: Set project version with Hatch
# run: |
# hatch version ${{ needs.details.outputs.new_version }}
#
# - name: Build source and wheel distribution
# run: |
# hatch build
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist
# path: dist/
#


# pypi_publish:
# name: Upload release to PyPI
# needs: [build_package]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
from semantic_version_check import version_check


def test_version():
def test_version() -> None:
__version__ = version("sliplib")
assert version_check(__version__)

0 comments on commit d0d1b96

Please sign in to comment.