From a9ef5f9ace215c0d3560212be09536f0e793c801 Mon Sep 17 00:00:00 2001 From: Bernhard Raml Date: Thu, 24 Oct 2024 15:48:21 +0200 Subject: [PATCH 1/3] e remove deprecated pkg_resources & pyscaffold so it work with Python 3.12 --- .gitignore | 3 +++ README.rst | 6 ------ setup.cfg | 12 ++---------- setup.py | 23 +---------------------- src/geopathfinder/__init__.py | 8 +------- 5 files changed, 7 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 79e0670..439f2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ MANIFEST # user defined .scripts + +.venv +venv \ No newline at end of file diff --git a/README.rst b/README.rst index 0ebcaae..a827439 100644 --- a/README.rst +++ b/README.rst @@ -43,9 +43,3 @@ The following description aims to show how to implement a new naming convention: To allow this, one can define methods tagged with *property* in the current class. *SmartFilename* then handles the properties of the inherited class equally to a common filename entry given in the field definition. - Add tests to "tests" and name the test file "test_[]_naming.py", where "[]" should be replaced by the abbreviation of the new naming convention. - -Note -==== - -This project has been set up using PyScaffold 3.1. For details and usage -information on PyScaffold see https://pyscaffold.org/. diff --git a/setup.cfg b/setup.cfg index d62e1bc..5c25158 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,11 +4,12 @@ [metadata] name = geopathfinder +version = attr: geopathfinder.__version__ description = Creating, quering, and searching in data structures holding geo-datasets. author = Bernhard Bauer-Marschallinger author-email = bbm@geo.tuwien.ac.at license = mit -url = https://pyscaffold.org/ +url = https://github.com/TUW-GEO/geopathfinder long-description = file: README.rst # Change if running only on Windows, Mac or Linux (comma-separated) platforms = any @@ -24,8 +25,6 @@ packages = find: include_package_data = True package_dir = =src -# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD! -setup_requires = pyscaffold>=3.1a0,<3.2a0 # Add here dependencies of your project (semicolon/line-separated), e.g. # install_requires = numpy; scipy install_requires = @@ -110,10 +109,3 @@ exclude = .eggs docs/conf.py -[pyscaffold] -# PyScaffold's parameters when the project was created. -# This will be used when updating. Do not change! -version = 3.1 -package = geopathfinder -extensions = - no_skeleton diff --git a/setup.py b/setup.py index c28997d..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,24 +1,3 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -""" - Setup file for geopathfinder. - Use setup.cfg to configure your project. - - This file was generated with PyScaffold 3.1. - PyScaffold helps you to put up the scaffold of your new Python project. - Learn more under: https://pyscaffold.org/ -""" -import sys - -from pkg_resources import require, VersionConflict from setuptools import setup -try: - require('setuptools>=38.3') -except VersionConflict: - print("Error: version of setuptools is too old (<38.3)!") - sys.exit(1) - - -if __name__ == "__main__": - setup(use_pyscaffold=True) +setup() diff --git a/src/geopathfinder/__init__.py b/src/geopathfinder/__init__.py index c280328..42c7ee1 100644 --- a/src/geopathfinder/__init__.py +++ b/src/geopathfinder/__init__.py @@ -1,7 +1 @@ -# -*- coding: utf-8 -*- -import pkg_resources - -try: - __version__ = pkg_resources.get_distribution(__name__).version -except: - __version__ = 'unknown' +__version__ = "v0.0.7" \ No newline at end of file From 00114854f2ec26c1b6e9cf639013b2b82b8b1196 Mon Sep 17 00:00:00 2001 From: Bernhard Raml Date: Thu, 24 Oct 2024 16:09:57 +0200 Subject: [PATCH 2/3] e update tag --- src/geopathfinder/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geopathfinder/__init__.py b/src/geopathfinder/__init__.py index 42c7ee1..1048b12 100644 --- a/src/geopathfinder/__init__.py +++ b/src/geopathfinder/__init__.py @@ -1 +1 @@ -__version__ = "v0.0.7" \ No newline at end of file +__version__ = "v0.1.5" \ No newline at end of file From 5bbaa687092314009dad9a23188e7ddeedf64761 Mon Sep 17 00:00:00 2001 From: Bernhard Raml Date: Thu, 24 Oct 2024 16:26:09 +0200 Subject: [PATCH 3/3] e use importlib-metadata to determine version --- src/geopathfinder/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/geopathfinder/__init__.py b/src/geopathfinder/__init__.py index 1048b12..413503b 100644 --- a/src/geopathfinder/__init__.py +++ b/src/geopathfinder/__init__.py @@ -1 +1,15 @@ -__version__ = "v0.1.5" \ No newline at end of file +import sys + +if sys.version_info[:2] >= (3, 8): + from importlib.metadata import PackageNotFoundError, version # pragma: no cover +else: + from importlib_metadata import PackageNotFoundError, version # pragma: no cover + +try: + # Change here if project is renamed and does not equal the package name + dist_name = __name__ + __version__ = version(dist_name) +except PackageNotFoundError: # pragma: no cover + __version__ = "unknown" +finally: + del version, PackageNotFoundError \ No newline at end of file