Skip to content

Commit

Permalink
automatic architecture for linux and macos wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 15, 2023
1 parent b84753c commit 53499f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pymeshlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def do_not_use_cpu_opengl():

# function that binds a name to a method of a class that calls the apply_filter function
def bind_function(name):
def foo(self, **kwargs): # Have to add self since this will become a method
def filter_function(self, **kwargs): # Have to add self since this will become a method
res_dict = self.apply_filter(name, **kwargs)
if bool(res_dict): # return the dictionary only if it is not empty
return res_dict

foo.__name__ = name # change the name of the function to the actual filter name
return foo
filter_function.__name__ = name # change the name of the function to the actual filter name
return filter_function


# for each filter loaded, create a method in the MeshSet class with that name that calls the apply_filter
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from setuptools import setup
import platform
import os
import sysconfig

# this setup.py assumes that pymeshlab has been already built,
# installed in the pymeshlab directory of this repository
Expand Down Expand Up @@ -33,9 +34,11 @@ def get_tag(self):
if platform.system() == 'Windows':
platform_tag = 'win_amd64'
elif platform.system() == 'Linux':
platform_tag = 'manylinux_2_31_x86_64'
arch = sysconfig.get_platform().split('-')[1]
platform_tag = 'manylinux_2_31_' + arch
elif platform.system() == 'Darwin':
platform_tag = 'macosx_10_11_x86_64'
arch = sysconfig.get_platform().split('-')[2]
platform_tag = 'macosx_10_11_' + arch
return a, b, platform_tag
except ImportError:
bdist_wheel = None
Expand Down

0 comments on commit 53499f2

Please sign in to comment.