From 9dae5a0d8285006c70c1f0147760b6fcfd10fefb Mon Sep 17 00:00:00 2001 From: doronz88 Date: Tue, 8 Oct 2024 13:35:23 +0300 Subject: [PATCH 1/2] pyproject: use `setuptools-scm` for dynamic versioning --- .github/workflows/pypi.yml | 5 ----- .gitignore | 5 ++++- pyproject.toml | 7 +++++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 259c187..7ffcb27 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -22,11 +22,6 @@ jobs: pip install build --user - - name: Update version in pyproject.toml - run: >- - sed -i - "s/^version = \".*\"/version = \"${{ github.ref_name }}\"/" - pyproject.toml - name: Build a binary wheel and a source tarball run: >- python -m diff --git a/.gitignore b/.gitignore index 6769e21..0a2d885 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +# auto-generated by setuptools-scm +src/headless_ida/_version.py diff --git a/pyproject.toml b/pyproject.toml index 1ff7eef..769d8cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,9 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=43.0.0", "setuptools_scm>=8", "wheel"] build-backend = "setuptools.build_meta" [project] name = "headless-ida" -version = "0.0.0" dependencies = [ "rpyc", ] @@ -16,6 +15,7 @@ authors = [ license = {file = "LICENSE"} keywords = ["ida", "headless", "idapro", "hexrays"] requires-python = ">=3" +dynamic = ["version"] [project.scripts] headless-ida = "headless_ida:headlessida_cli" @@ -28,3 +28,6 @@ repository = "https://github.com/DennyDai/headless-ida" [tool.setuptools.packages.find] where = ["src"] + +[tool.setuptools_scm] +version_file = "src/headless_ida/_version.py" From 2e30c743e8b2b760e9edc041c0e3cc51767eaa55 Mon Sep 17 00:00:00 2001 From: doronz88 Date: Tue, 8 Oct 2024 13:35:53 +0300 Subject: [PATCH 2/2] ci: change pypi workflow to occur on github releases --- .github/workflows/pypi.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 7ffcb27..304acce 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,7 +1,6 @@ on: - push: - tags: - - '*' + release: + types: [ created ] jobs: Publish: