From ef0d06bd705d3ca0d95c4a197dfa835c7d0c1e55 Mon Sep 17 00:00:00 2001 From: Taco de Wolff Date: Wed, 22 May 2024 08:07:32 -0400 Subject: [PATCH] Update Python binding for locally built, see #706 --- bindings/py/Makefile | 2 ++ bindings/py/setup.py | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bindings/py/Makefile b/bindings/py/Makefile index 171ee5f16f..d76bbacfe5 100644 --- a/bindings/py/Makefile +++ b/bindings/py/Makefile @@ -9,6 +9,8 @@ compile: go build -buildmode=c-shared -o src/minify/minify.so build: compile + go mod init github.com/tdewolff/minify/bindings/py + go mod tidy python -m build --sdist publish: clean build diff --git a/bindings/py/setup.py b/bindings/py/setup.py index cf20924591..f0b3835cc3 100644 --- a/bindings/py/setup.py +++ b/bindings/py/setup.py @@ -5,20 +5,9 @@ from setuptools.extension import Extension from subprocess import CalledProcessError, check_call - HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() - -#def get_version(): -# with open('go.mod') as f: -# for line in f: -# line = line.strip() -# if line.startswith('github.com/tdewolff/minify/v2'): -# return line.split()[1].split('-')[0][1:] -# raise CompileError('Version retrieval failed') - - class build_ext_external(build_ext): """Placeholder for externally-built extension.""" def build_extension(self, ext: Extension): @@ -28,7 +17,6 @@ def build_extension(self, ext: Extension): except CalledProcessError as e: raise CompileError('Go compilation failed!') from e - setup( name="tdewolff-minify", version="{VERSION}",