Skip to content

Commit

Permalink
reverted to working version
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Batschelet (he/him) <lukas.batschelet@students.unibe.ch>
  • Loading branch information
lbatschelet committed May 24, 2024
1 parent 6d2a9a2 commit 2545e7b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine setuptools-scm
pip install setuptools wheel twine setuptools-scm
- name: Get version from setuptools-scm
id: get_version
Expand All @@ -40,6 +40,8 @@ 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")
Expand All @@ -50,9 +52,7 @@ 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
env:
GH_PAT: ${{ secrets.GH_PAT }}
git push origin HEAD:main --force
- name: Build package
run: |
Expand All @@ -71,3 +71,17 @@ 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
36 changes: 13 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
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()

def _clean_version():
"""
Custom version scheme to avoid .dev and .post versions.
"""
def get_version(version):
if version.exact:
return version.format_with("{tag}")
else:
return version.format_next_version("{tag}.post{distance}")

def empty(version):
return ''

return {'local_scheme': get_version, 'version_scheme': empty}

setup(
name='geo-roughness-tool',
use_scm_version=_clean_version, # Assign the callable directly
use_scm_version={
"version_scheme": "post-release",
"local_scheme": "no-local-version"
},
setup_requires=["setuptools-scm"],
packages=find_packages(where='src'),
package_dir={'': 'src'},
url='https://github.com/lbatschelet/GeoRoughness-Tool',
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'),
long_description=read('README.md'), # Use the README.md as the long description
long_description_content_type='text/markdown',
install_requires=read_requirements('requirements.txt'),
python_requires='>=3.12',
include_package_data=True,
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
entry_points={
'console_scripts': [
'georough=geo_roughness_tool.main:main',
Expand All @@ -47,18 +37,18 @@ def empty(version):
]
},
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 4 - Beta', # Update as appropriate for your release cycle
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering :: GIS'
],
project_urls={
project_urls={ # Optional
'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',
keywords='GIS, GeoTIFF, DEM, surface roughness, geographic information systems', # Add relevant keywords
)

0 comments on commit 2545e7b

Please sign in to comment.