mirror of
https://github.com/mudler/luet.git
synced 2025-09-23 03:58:18 +00:00
⚙️ Add ability to build from Dockerfiles directly
This commit is contained in:
committed by
mudler
parent
4e2a2adfc1
commit
e70a543f42
37
vendor/github.com/asottile/dockerfile/setup.py
generated
vendored
Normal file
37
vendor/github.com/asottile/dockerfile/setup.py
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import os.path
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from setuptools import Extension
|
||||
from setuptools import setup
|
||||
|
||||
if not os.path.exists('vendor/github.com/moby/buildkit/frontend'):
|
||||
print('moby checkout is missing!')
|
||||
print('Run `git submodule update --init`')
|
||||
exit(1)
|
||||
|
||||
if sys.platform != 'win32' and platform.python_implementation() == 'CPython':
|
||||
try:
|
||||
import wheel.bdist_wheel
|
||||
except ImportError:
|
||||
cmdclass = {}
|
||||
else:
|
||||
class bdist_wheel(wheel.bdist_wheel.bdist_wheel):
|
||||
def finalize_options(self) -> None:
|
||||
self.py_limited_api = f'cp3{sys.version_info[1]}'
|
||||
super().finalize_options()
|
||||
|
||||
cmdclass = {'bdist_wheel': bdist_wheel}
|
||||
else:
|
||||
cmdclass = {}
|
||||
|
||||
setup(
|
||||
ext_modules=[
|
||||
Extension(
|
||||
'dockerfile', ['pylib/main.go'],
|
||||
py_limited_api=True, define_macros=[('Py_LIMITED_API', None)],
|
||||
),
|
||||
],
|
||||
cmdclass=cmdclass,
|
||||
build_golang={'root': 'github.com/asottile/dockerfile'},
|
||||
)
|
Reference in New Issue
Block a user