Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
added bdist_wheel install
  • Loading branch information
perara authored Aug 28, 2023
1 parent 5e20d4b commit 6e3135c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.bdist_wheel import bdist_wheel
import cffi
import tomli
from typing import Dict, Any
Expand Down Expand Up @@ -44,6 +45,16 @@ def build_cffi():

ffibuilder.compile(verbose=True)

class TMUbdistWheel(bdist_wheel):
"""
Custom install command that builds the CFFI modules
before proceeding with the standard installation process.
"""

def run(self):
build_cffi()
super().run()


class TMUInstall(install):
"""
Expand Down Expand Up @@ -78,6 +89,7 @@ def has_ext_modules(foo):
cmdclass={
"install": TMUInstall,
"develop": TMUDevelop,
"bdist_wheel": TMUbdistWheel
},
distclass=BinaryDistribution
)

0 comments on commit 6e3135c

Please sign in to comment.