Skip to content

Commit

Permalink
Fix dynamic versioning
Browse files Browse the repository at this point in the history
add fetch-depth to gh workflow

add fetch-depth to gh workflow: v2

Update GHA

Update GHA2

Update GHA3

Update GHA4

Update GHA5

Update GHA6
  • Loading branch information
youyupei committed Sep 29, 2024
1 parent dd31068 commit b4a3080
Show file tree
Hide file tree
Showing 3 changed files with 4,253 additions and 858 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,25 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # this is needed to get the tags
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: '3.9'

# - name: Install setuptools_scm and update seuptools
# run: pip install setuptools_scm setuptools; pip install --upgrade setuptools
#
# - name: Get package version from setuptools_scm
# run: python -m setuptools_scm

- name: Build wheels
uses: pypa/[email protected]

- name: check git status
run: git status

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
Expand All @@ -28,12 +43,27 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # this is needed to get the tags

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install setuptools_scm and update seuptools
run: pip install setuptools_scm setuptools; pip install --upgrade setuptools

- name: Get package version from setuptools_scm
run: python -m setuptools_scm; git tag -l

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from setuptools import setup
from Cython.Build import cythonize
import setuptools_scm

version = setuptools_scm.get_version()
setup(
ext_modules=cythonize("src/fast_edit_distance.pyx")
ext_modules=cythonize("src/fast_edit_distance.pyx"),
version=version # I have to do this because setuptools_scm doesn't work with Cython (the cythonize function would modify the repo so that the version is not the same as the one in the repo)
)
Loading

0 comments on commit b4a3080

Please sign in to comment.