Skip to content

Commit

Permalink
try this one
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Jan 7, 2024
1 parent 4fdd620 commit 719ac95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI_CCBlade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
fail-fast: False
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Official way to do miniconda, but it messes with the worker environment and shell
- name: Install miniconda
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def has_ext_modules(foo):
return True
#######
this_dir = os.path.abspath(os.path.dirname(__file__))
staging_dir = os.path.join(this_dir, "meson_build")
build_dir = os.path.join(this_dir, "build")

def copy_shared_libraries():
build_path = os.path.join(build_dir, "ccblade")
for root, _dirs, files in os.walk(build_path):
for file in files:
# move ccblade libraries to just under staging_dir
if file.endswith((".so", ".lib", ".pyd", ".pdb", ".dylib", ".dll")):
if ".so.p" in root or ".pyd.p" in root: # excludes intermediate object files
continue
Expand Down Expand Up @@ -80,22 +80,23 @@ def build_extension(self, ext):
os.environ["CC"] = "gcc"

purelibdir = "."
configure_call = ["meson", "setup", build_dir, "--wipe",
configure_call = ["meson", "setup", staging_dir, "--wipe",
f"-Dpython.purelibdir={purelibdir}", f"--prefix={build_dir}",
f"-Dpython.platlibdir={purelibdir}"] + meson_args.split()
configure_call = [m for m in configure_call if m.strip() != ""]
print(configure_call)

build_call = ["meson", "compile", "-vC", build_dir]
build_call = ["meson", "compile", "-vC", staging_dir]
print(build_call)

self.build_temp = build_dir
install_call = ["meson", "install", "-C", staging_dir]
print(install_call)

# Need fresh build directory for CMake
os.makedirs(self.build_temp, exist_ok=True)
self.build_temp = build_dir

self.spawn(configure_call)
self.spawn(build_call)
self.spawn(install_call)
copy_shared_libraries()


Expand Down

0 comments on commit 719ac95

Please sign in to comment.