Update build configuration and enhance versioning process
This commit is contained in:
parent
c1db0937a2
commit
ac9bbc0415
|
|
@ -1,4 +1,4 @@
|
|||
# Build this file using 'python -m build' (from 'build' package)
|
||||
# Build this file using 'python -m build --no-isolation'
|
||||
[build-system]
|
||||
requires = ["setuptools>=61.0", "wheel", "sls_build_backend"]
|
||||
build-backend = "sls_build_backend"
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
from setuptools.build_meta import build_wheel as _build_wheel
|
||||
from setuptools.build_meta import build_sdist as _build_sdist
|
||||
from .write_version import main, clean_output
|
||||
|
||||
def _generate_version():
|
||||
from .write_version import main
|
||||
main()
|
||||
|
||||
def build_wheel(*args, **kwargs):
|
||||
_generate_version()
|
||||
return _build_wheel(*args, **kwargs)
|
||||
o = _build_wheel(*args, **kwargs)
|
||||
clean_output()
|
||||
return o
|
||||
|
||||
|
||||
def build_sdist(*args, **kwargs):
|
||||
_generate_version()
|
||||
return _build_sdist(*args, **kwargs)
|
||||
o = _build_sdist(*args, **kwargs)
|
||||
clean_output()
|
||||
return o
|
||||
|
|
@ -27,6 +27,10 @@ def get_commit():
|
|||
def get_timestamp():
|
||||
return datetime.datetime.now(datetime.timezone.utc).isoformat() + "Z"
|
||||
|
||||
def clean_output():
|
||||
if output.exists():
|
||||
output.unlink()
|
||||
|
||||
def main():
|
||||
commit = get_commit()
|
||||
timestamp = get_timestamp()
|
||||
|
|
|
|||
Loading…
Reference in New Issue