Skip to content

Commit

Permalink
Update Python binding for locally built, see #706
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed May 22, 2024
1 parent 29e7cb2 commit ef0d06b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions bindings/py/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions bindings/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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}",
Expand Down

0 comments on commit ef0d06b

Please sign in to comment.