Skip to content

Commit

Permalink
trying to fix scm autoversioning for macos pyuda wheel builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-dixon committed Apr 15, 2024
1 parent edee945 commit 7804676
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ jobs:
cd /project &&
cmake -B build -DNO_JAVA_WRAPPER=ON -DBUILD_SHARED_LIBS=ON -DSSLAUTHENTICATION=OFF -DENABLE_CAPNP=ON -DCLIENT_ONLY=ON &&
cmake --build build -j --config Release --target install &&
cp -r /usr/local/python_installer/* /project/source/wrappers/python/ &&
sed -i 's|\[tool\.setuptools_scm\]|\[tool\.setuptools_scm\]\nroot =\"\/project\"|g' /project/source/wrappers/python/pyproject.toml
cp -r /usr/local/python_installer/* /project/source/wrappers/python/
- name: Build manylinux_2_28 wheels
if: startswith(matrix.build-platform[2], 'manylinux_2_28')
Expand Down Expand Up @@ -108,8 +107,7 @@ jobs:
-DNO_JAVA_WRAPPER=ON
-DENABLE_CAPNP=ON -DCLIENT_ONLY=ON &&
cmake --build build -j --config Release --target install &&
cp -r /usr/local/python_installer/* /project/source/wrappers/python/ &&
sed -i 's|\[tool\.setuptools_scm\]|\[tool\.setuptools_scm\]\nroot =\"\/project\"|g' /project/source/wrappers/python/pyproject.toml
cp -r /usr/local/python_installer/* /project/source/wrappers/python/
- name: build uda on macos
if: runner.os == 'macOS'
Expand All @@ -132,10 +130,7 @@ jobs:
-DCMAKE_INSTALL_PREFIX=$PWD/install
-DCLIENT_ONLY=ON &&
cmake --build build -j --config Release --target install &&
cp -r $PWD/install/python_installer/* ${{github.workspace}}/source/wrappers/python/ &&
sed -i temp.bak 's|\[tool\.setuptools_scm\]|\[tool\.setuptools_scm\]\nroot =\"${{github.workspace}}\"|g' ${{github.workspace}}/source/wrappers/python/pyproject.toml &&
cat ${{github.workspace}}/source/wrappers/python/pyproject.toml &&
cat ${{github.workspace}}/source/wrappers/python/setup.py
cp -r $PWD/install/python_installer/* ${{github.workspace}}/source/wrappers/python/
- name: Build macos wheels
if: runner.os == 'macOS'
Expand All @@ -148,8 +143,8 @@ jobs:
CIBW_PLATFORM: macos
CIBW_BUILD: cp*-${{matrix.build-platform[2]}}
CIBW_SKIP: cp36* cp37*
CIBW_BEFORE_ALL:
cat ./source/wrappers/python/setup.py
# CIBW_BEFORE_ALL:
# cat ./source/wrappers/python/setup.py

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 1 addition & 3 deletions source/wrappers/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=60", "setuptools_scm>=8", "numpy>=1.7", "Cython>=0.29", "six"]
requires = ["setuptools>=42", "numpy>=1.7", "Cython>=0.29", "six"]
build-backend = "setuptools.build_meta"


Expand All @@ -15,5 +15,3 @@ requires-python = ">= 3.5"
[project.optional-dependencies]
plot = ["pyplot"]
full = ["pyplot", "rich"]

[tool.setuptools_scm]
13 changes: 11 additions & 2 deletions source/wrappers/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,19 @@ ext = Extension(
define_macros=extra_macros,
)

# version='@PROJECT_VERSION@',

def get_version():
version = '@PROJECT_VERSION@'
if version.count('.') > 2:
version = "Post.".join(s.rsplit('.', 1))
print("setup version = %s" % version)
return version


# use_scm_version={'version_scheme': 'post-release', 'local_scheme': 'no-local-version'},
setup(
name='ukaea_pyuda_test',
use_scm_version={'version_scheme': 'post-release', 'local_scheme': 'no-local-version'},
version=get_version,
description='Unified Data Access (UDA)',
author='Jonathan Hollocombe',
author_email='jonathan.hollocombe@ukaea.uk',
Expand Down

0 comments on commit 7804676

Please sign in to comment.