From b32d7d1df53678ff7c11c59776342b3a962b2879 Mon Sep 17 00:00:00 2001 From: "Lukas Batschelet (he/him)" Date: Fri, 24 May 2024 14:10:35 +0200 Subject: [PATCH] improved automated version labeling Signed-off-by: Lukas Batschelet (he/him) --- .github/workflows/publish.yml | 23 ++++------------------- setup.py | 19 ++++++++----------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 20ed989..977e9b9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine setuptools-scm + python -m pip install setuptools wheel twine setuptools-scm - name: Get version from setuptools-scm id: get_version @@ -40,8 +40,6 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Update CITATION.cff - env: - GH_PAT: ${{ secrets.GH_PAT }} run: | VERSION=${{ env.VERSION }} DATE=$(date -u +"%Y-%m-%d") @@ -52,11 +50,12 @@ jobs: git remote set-url origin https://$GH_PAT@github.com/${{ github.repository }}.git git add CITATION.cff git commit -m "Update CITATION.cff for version $VERSION" - git push origin HEAD:main --force + git push origin HEAD:main + env: + GH_PAT: ${{ secrets.GH_PAT }} - name: Build package run: | - python -m pip install --use-pep517 python setup.py sdist bdist_wheel - name: Check build @@ -72,17 +71,3 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | twine upload dist/* - - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: | - ## Changes in this release - - Updated version to ${{ env.VERSION }} - draft: false - prerelease: false diff --git a/setup.py b/setup.py index 7209245..ab4eccd 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,14 @@ import os from setuptools import setup, find_packages -# Read the contents of your README file def read(file_name): with open(file_name, 'r', encoding='utf-8') as f: return f.read() -# Read the contents of your requirements file def read_requirements(file_name): with open(file_name, 'r', encoding='utf-8') as f: return f.read().splitlines() -# Custom version scheme to avoid .devXXX and .postXXX versions def _clean_version(): """ Custom version scheme to avoid .dev and .post versions. @@ -29,7 +26,7 @@ def empty(version): setup( name='geo-roughness-tool', - use_scm_version=_clean_version, # Use setuptools_scm for versioning + use_scm_version=_clean_version, # Assign the callable directly setup_requires=["setuptools-scm"], packages=find_packages(where='src'), package_dir={'': 'src'}, @@ -37,11 +34,11 @@ def empty(version): license='MIT', author='Lukas Batschelet', description='A package for calculating surface roughness using GeoTIFF DEM files with a GUI and CLI', - long_description=read('README.md'), # Use the README.md as the long description + long_description=read('README.md'), long_description_content_type='text/markdown', - install_requires=read_requirements('requirements.txt'), # Install dependencies from requirements.txt - python_requires='>=3.12', # Specify Python version requirement - include_package_data=True, # Include package data specified in MANIFEST.in + install_requires=read_requirements('requirements.txt'), + python_requires='>=3.12', + include_package_data=True, entry_points={ 'console_scripts': [ 'georough=geo_roughness_tool.main:main', @@ -50,7 +47,7 @@ def empty(version): ] }, classifiers=[ - 'Development Status :: 4 - Beta', # Update as appropriate for your release cycle + 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', @@ -58,10 +55,10 @@ def empty(version): 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: GIS' ], - project_urls={ # Optional + project_urls={ 'Documentation': 'https://github.com/lbatschelet/GeoRoughness-Tool/wiki', 'Source': 'https://github.com/lbatschelet/GeoRoughness-Tool', 'Tracker': 'https://github.com/lbatschelet/GeoRoughness-Tool/issues', }, - keywords='GIS, GeoTIFF, DEM, surface roughness, geographic information systems', # Add relevant keywords + keywords='GIS, GeoTIFF, DEM, surface roughness, geographic information systems', )