diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c58f09..0486d5e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,7 +24,8 @@ jobs: run: | python -m pip install -U pip python -m pip install -Ur requirements.txt - python -m build + python -m build --no-isolation + ls -lAh - name: "Upload to Actions" uses: actions/upload-artifact@v4 diff --git a/project.toml b/project.toml new file mode 100644 index 0000000..d2c1c6f --- /dev/null +++ b/project.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "packaging"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 55e122d..490c787 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,25 @@ import os +import re from setuptools import setup -from packaging.version import parse, InvalidVersion +# from packaging.version import parse, InvalidVersion -def get_version() -> str: - try: - ref = os.environ.get('GITHUB_REF_NAME', '0.0.1') - version = parse(ref) - return version.public - except InvalidVersion: +# def get_version() -> str: +# try: +# ref = os.environ.get('GITHUB_REF_NAME', '0.0.1') +# version = parse(ref) +# return version.public +# except InvalidVersion: +# return '0.0.1' + + +def get_version(): + version = os.environ.get('GITHUB_REF_NAME', '0.0.1') + pattern = r'^(\d+)\.(\d+)\.(\d+)(?:-(\w+|\d+)\.(\w+|\d+))?$' + match = re.match(pattern, version) + if match: + return version + else: return '0.0.1'