diff --git a/.github/workflows/decompiler-plugins-pypi.yml b/.github/workflows/decompiler-plugins-pypi.yml index e47234e..0a9b35b 100644 --- a/.github/workflows/decompiler-plugins-pypi.yml +++ b/.github/workflows/decompiler-plugins-pypi.yml @@ -22,11 +22,6 @@ jobs: pip install build --user - - name: Update version in pyproject.toml - working-directory: ${{ github.workspace }}/decompiler-plugins - run: | - version=$(echo "${{ github.ref_name }}" | sed 's:.*/::') - sed -i "s/^version = \".*\"/version = \"$version\"/" pyproject.toml - name: Build a binary wheel and a source tarball working-directory: ${{ github.workspace }}/decompiler-plugins run: >- diff --git a/decompiler-plugins/pyproject.toml b/decompiler-plugins/pyproject.toml index 107b39f..9a3fc00 100644 --- a/decompiler-plugins/pyproject.toml +++ b/decompiler-plugins/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=64", "setuptools-scm>=8"] build-backend = "setuptools.build_meta" [project] name = "patcherex2-decompiler-plugins" -version = "0.0.0" +dynamic = ["version"] requires-python = ">=3.8" readme = "README.md" dependencies = [ @@ -26,3 +26,7 @@ include = ["patcherex2.decompiler_plugins"] [tool.ruff.lint] extend-select = ["I", "N", "UP", "B"] + +[tool.setuptools_scm] +root = ".." +tag_regex = '^decompiler-plugins/(?P[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$' diff --git a/decompiler-plugins/src/patcherex2/decompiler_plugins/__init__.py b/decompiler-plugins/src/patcherex2/decompiler_plugins/__init__.py index ffa5f62..1fcdef7 100644 --- a/decompiler-plugins/src/patcherex2/decompiler_plugins/__init__.py +++ b/decompiler-plugins/src/patcherex2/decompiler_plugins/__init__.py @@ -1,3 +1,8 @@ +from importlib import metadata + +__version__ = metadata.version("patcherex2-decompiler-plugins") + + def create_plugin(*args, **kwargs): """ This is the entry point that all decompilers will call in various ways. To remain agnostic,