If python had a package management, I would hate it.
This commit is contained in:
parent
8a5bebb254
commit
2eec7b4f5e
8 changed files with 67 additions and 92 deletions
|
|
@ -1,3 +1,33 @@
|
|||
from setuptools import setup
|
||||
import subprocess
|
||||
from contextlib import suppress
|
||||
from setuptools import Command, setup
|
||||
from setuptools.command.build import build
|
||||
|
||||
setup(name="pygomx-module", version="0.0.1", py_modules=["_pygomx"])
|
||||
|
||||
class CustomCommand(Command):
|
||||
def initialize_options(self) -> None:
|
||||
pass
|
||||
|
||||
def finalize_options(self) -> None:
|
||||
pass
|
||||
|
||||
def run(self) -> None:
|
||||
go_call = [
|
||||
"go",
|
||||
"build",
|
||||
"-buildmode=c-archive",
|
||||
"-o",
|
||||
"../pygomx-module/libmxclient.a",
|
||||
".",
|
||||
]
|
||||
subprocess.call(go_call, cwd="../libmxclient")
|
||||
|
||||
|
||||
class CustomBuild(build):
|
||||
sub_commands = [("build_custom", None)] + build.sub_commands
|
||||
|
||||
|
||||
setup(
|
||||
cffi_modules=["build_ffi.py:ffibuilder"],
|
||||
cmdclass={"build": CustomBuild, "build_custom": CustomCommand},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue