Skip to content

Commit

Permalink
Merge pull request #23 from TUW-GEO/fix/python3-12
Browse files Browse the repository at this point in the history
Fix/python3 12
  • Loading branch information
SwamyDev authored Oct 24, 2024
2 parents 34694bd + 84c8539 commit ca4384a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 55 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/geospade_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8']
python-version: ['3.8', '3.12']
os: ["ubuntu-latest"]

steps:
Expand Down Expand Up @@ -49,15 +49,15 @@ jobs:
filename=env_py${{ matrix.python-version }}_${{ matrix.os }}.yml
conda env export --no-builds | grep -v "prefix" > .artifacts/$filename
- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: os_py_environments
path: .artifacts/*
- name: Install package and test
shell: bash -l {0}
run: |
pip install .
python setup.py test
pip install .[testing]
pytest
- name: Upload Coverage
shell: bash -l {0}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/geospade_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Install package and test
shell: bash -l {0}
run: |
pip install .
python setup.py test
pip install .[testing]
pytest
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 0.2.4
=============

- fixed python 3.12 deprecations (pkg\_resources and typing in tests)

Version 0.2.3
=============

Expand Down
12 changes: 3 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

[metadata]
name = geospade
version = attr: geospade.__version__
description = A place for classes and properties of raster and vector geometries and their geospatial operations alike.
author = TU Wien MRS group
author-email = [email protected]
author_email = [email protected]
license = mit
long-description = file: README.md
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/TUW-GEO/geospade
keywords =
Expand All @@ -35,8 +36,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.2a0,<3.3a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires =
numpy
Expand Down Expand Up @@ -120,8 +119,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.2.2
package = geospade
22 changes: 1 addition & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# -*- coding: utf-8 -*-
"""
Setup file for geospade.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.2.2.
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 VersionConflict, require
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()
12 changes: 1 addition & 11 deletions src/geospade/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound

try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
finally:
del get_distribution, DistributionNotFound
__version__ = "v0.2.4"

# declare global variables
DECIMALS = 9 # TODO: how should this be declared?
16 changes: 8 additions & 8 deletions tests/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def setUp(self):
self.sref = SpatialRef(4326)

# define region of interest/extent
ll_x = random.randrange(-50., 50., 10.)
ll_y = random.randrange(-50., 50., 10.)
ur_x = ll_x + random.randrange(10., 50., 10.)
ur_y = ll_y + random.randrange(10., 50., 10.)
ll_x = random.randrange(-50, 50, 10)
ll_y = random.randrange(-50, 50, 10)
ur_x = ll_x + random.randrange(10, 50, 10)
ur_y = ll_y + random.randrange(10, 50, 10)
self.sh_geom = Polygon((
(ll_x, ll_y),
(ll_x, ur_y),
Expand Down Expand Up @@ -465,8 +465,8 @@ def setUp(self):
x_pixel_size = 0.01
y_pixel_size = 0.01
# define origin and number of tiles (randomly)
mosaic_ul_x = random.randrange(-50., 50., 10.)
mosaic_ul_y = random.randrange(-50., 50., 10.)
mosaic_ul_x = random.randrange(-50, 50, 10)
mosaic_ul_y = random.randrange(-50, 50, 10)
mosaic_rows = 1
y_tile_size = 1.
# define cols
Expand Down Expand Up @@ -633,8 +633,8 @@ def setUp(self):
x_pixel_size = 0.01
y_pixel_size = 0.01
# define origin and number of tiles (randomly)
mosaic_ul_x = random.randrange(-50., 50., 10.)
mosaic_ul_y = random.randrange(-50., 50., 10.)
mosaic_ul_x = random.randrange(-50, 50, 10)
mosaic_ul_y = random.randrange(-50, 50, 10)
mosaic_rows = 3
mosaic_cols = 3
x_tile_size = 1.
Expand Down

0 comments on commit ca4384a

Please sign in to comment.