Skip to content

Commit

Permalink
Merge pull request #15 from ITISFoundation/setuptools_scm
Browse files Browse the repository at this point in the history
Setuptools scm
  • Loading branch information
wvangeit authored Jul 30, 2024
2 parents 8254313 + d8a6b02 commit 048194c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 766 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
arch: [x86_64]
env:
SCCACHE_GHA_ENABLED: "on"
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -24,22 +26,35 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.11
- name: Bump version and push tag
if: ${{ github.ref == 'refs/heads/master' }}
id: tag_version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
- name: Get dakota src
run: make get-dakota-src
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}*${{ matrix.arch }}
- name: Upload wheels
uses: actions/upload-artifact@v4
- name: Create a GitHub release
if: ${{ github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
artifacts: ./wheelhouse/*.whl

test-pypi:
name: Publish wheels on Test PyPI
runs-on: ubuntu-latest
needs:
- wheels
if: github.ref == 'refs/heads/master'
environment:
name: testpypi
url: https://test.pypi.org/p/itis-dakota
Expand Down
9 changes: 7 additions & 2 deletions itis_dakota/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
from . import _version
__version__ = _version.get_versions()['version']
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("osparc_filecomms")
except PackageNotFoundError:
# package is not installed
pass
Loading

0 comments on commit 048194c

Please sign in to comment.