From d91a87b523d98949a118ec8063c982b2b67b95f0 Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Wed, 17 May 2023 20:45:22 -0400 Subject: [PATCH 1/4] Convert to PEP-517 Use versioningit for dynamic versioning --- pyproject.toml | 41 +++++++++++++++++++++++++++++++++++++++++ setup.cfg | 5 ----- setup.py | 28 ---------------------------- 3 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..d634ee85b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools", "versioningit"] +build-backend = "setuptools.build_meta" + +[project] +name = "chirp" +dynamic = ["version"] +description = "A cross-platform cross-radio programming tool" +requires-python = ">=3.10,<4" +dependencies = [ + "pyserial", + "requests", + "yattag", + "suds" +] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["chirp*"] + +[project.urls] +homepage = "https://chirp.danplanet.com" +repository = "https://github.com/kk7ds/chirp" + +[project.optional-dependencies] +wx = ["wxPython"] + +[project.scripts] +chirp = "chirp.wxui:chirpmain" +chirpc = "chirp.cli.main:main" +experttune = "chirp.cli.experttune:main" + +[tool.versioningit.tag2version] +rmprefix = "release_" + +[tool.versioningit.format] +distance = "{committer_date:%Y%m%d}" +dirty = "{committer_date:%Y%m%d}+d{build_date:%Y%m%d}" +distance-dirty = "{committer_date:%Y%m%d}+d{build_date:%Y%m%d}" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ba216f19e..000000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[bdist_rpm] -requires = pyserial -packager = Dan Smith -description = A frequency tool for Icom D-STAR Repeaters -vendor = KK7DS diff --git a/setup.py b/setup.py deleted file mode 100644 index 1117eedaa..000000000 --- a/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -from distutils.core import setup -from setuptools import find_packages - -setup(name='chirp', - description='A cross-platform cross-radio programming tool', - packages=find_packages(include=["chirp*"]), - include_package_data=True, - version=0, - url='https://chirp.danplanet.com', - python_requires=">=3.10,<4", - install_requires=[ - 'pyserial', - 'requests', - 'yattag', - 'suds', - 'lark', - ], - extras_require={ - 'wx': ['wxPython'], - }, - entry_points={ - 'console_scripts': [ - "chirp=chirp.wxui:chirpmain", - "chirpc=chirp.cli.main:main", - "experttune=chirp.cli.experttune:main", - ], - }, - ) From eb4ad765636c29fd10db53d223824a986631eadf Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Fri, 19 May 2023 20:54:33 -0400 Subject: [PATCH 2/4] add PKG-INFO to gitignore Those using git archives and shallow clones should add PKG-INFO corresponding to the date version. Example: Version: 20230520 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cff72235f..380ea3798 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ **.pyc **.orig **.rej +PKG-INFO dist build/bdist tools/cpep8.venv/ From 2c776852569ab3cce77b604bd80b71aa156a0892 Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Tue, 23 May 2023 22:27:42 -0400 Subject: [PATCH 3/4] add {distance}.{vcs}{revision} to local identifier to further delineate direct-from-git builds --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d634ee85b..71dcd957b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,6 @@ experttune = "chirp.cli.experttune:main" rmprefix = "release_" [tool.versioningit.format] -distance = "{committer_date:%Y%m%d}" -dirty = "{committer_date:%Y%m%d}+d{build_date:%Y%m%d}" -distance-dirty = "{committer_date:%Y%m%d}+d{build_date:%Y%m%d}" +distance = "{committer_date:%Y%m%d}+{distance}.{vcs}{revision}" +dirty = "{committer_date:%Y%m%d}+{distance}.{vcs}{revision}.d{build_date:%Y%m%d}" +distance-dirty = "{committer_date:%Y%m%d}+{distance}.{vcs}{revision}.d{build_date:%Y%m%d}" From f72fcb5e5ae011de82c117b0fe31df0a9de044e6 Mon Sep 17 00:00:00 2001 From: Charlie Li Date: Sun, 25 Jun 2023 11:37:10 -0400 Subject: [PATCH 4/4] CI: unshallow clone py3-test for versioningit --- .github/workflows/py3-test.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/py3-test.yaml b/.github/workflows/py3-test.yaml index ebbab9af0..13f7a023a 100644 --- a/.github/workflows/py3-test.yaml +++ b/.github/workflows/py3-test.yaml @@ -8,6 +8,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run tox uses: ./.github/actions/py3-tox with: @@ -19,6 +21,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run tox uses: ./.github/actions/py3-tox with: @@ -35,6 +39,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run tox uses: ./.github/actions/py3-tox with: @@ -46,6 +52,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install python 3.12 uses: actions/setup-python@v5 id: pyinst @@ -65,6 +73,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run tox uses: ./.github/actions/py3-tox with: