From 108d45878122d4feb35dbb70bcfd96d8fda996f0 Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Sat, 18 Jun 2022 05:01:19 +1200 Subject: [PATCH 1/9] update the package setup files to allow setup on pypi --- pyproject.toml | 36 +++++++++++++++++++++++++++++++++++- setup.cfg | 3 --- setup.py | 40 +--------------------------------------- 3 files changed, 36 insertions(+), 43 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 374b58c..52a0601 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,40 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools>=61.0.0", "wheel" ] build-backend = "setuptools.build_meta" + +[project] +name = "geoapis" +version = "0.2.5" +description = "A package for downloading geospatial data from web APIs." +readme = "README.md" +authors = [{ name = "Rose pearson", email = "rose.pearson@niwa.co.nz" }] +license = { file = "LICENSE" } +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: GIS", + "Programming Language :: Python :: 3 :: Only", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: OS Independent", +] +keywords = ["APIs", "LiDAR", "point clouds", "vector", "Geospatial data"] +dependencies = [ + "geopandas>=0.9", + "requests>=2.25", + "boto3>=1.17", + 'tomli; python_version < "3.11"', +] +requires-python = ">=3.9" + +[tool.setuptools] +packages = ["geoapis"] + +[project.optional-dependencies] +dev = ["black", "python-dotenv", "pip-tools", "pytest"] + +[project.urls] +GitHub = "https://github.com/niwa/geoapis" +Documentation = "https://github.com/niwa/geoapis/wiki" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 23f09af..0000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -version = attr: geoapis.__version__ -license_files = LICENSE diff --git a/setup.py b/setup.py index e6a70a9..72e141c 100644 --- a/setup.py +++ b/setup.py @@ -6,44 +6,6 @@ """ import setuptools -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - setuptools.setup( - name="geoapis", - author="Rose pearson", - author_email="rose.pearson@niwa.co.nz", - description="A package for downloading geospatial data from web APIs", - keywords="APIs, LiDAR, vector, Geospatial data", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/niwa/geoapis", - project_urls={ - "Documentation": "https://github.com/niwa/geoapis", - "Bug Reports": "https://github.com/niwa/geoapis/issues", - "Source Code": "https://github.com/niwa/geoapis", - # 'Funding': '', - # 'Say Thanks!': '', - }, - package_dir={"": "src"}, - packages=setuptools.find_packages(where="src"), - classifiers=[ - # see https://pypi.org/classifiers/ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: GIS", - "Programming Language :: Python :: 3 :: Only", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent", - ], - python_requires=">=3.6", - install_requires=[ - "geopandas>=0.9", - "requests>=2.25", - "boto3>=1.17", - "python-dotenv>=0.19", - ], - extras_require={ - "dev": ["check-manifest"], - }, + package_dir={"": "src"}, packages=setuptools.find_packages(where="src"), ) From 7d254a3024bcb8b3289b38744e4bb73abbc23b74 Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Mon, 20 Jun 2022 21:04:51 +1200 Subject: [PATCH 2/9] Updated pyproject.toml having built locally and pubilished to the test pypi --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 52a0601..095eef5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,9 @@ classifiers = [ ] keywords = ["APIs", "LiDAR", "point clouds", "vector", "Geospatial data"] dependencies = [ - "geopandas>=0.9", - "requests>=2.25", - "boto3>=1.17", + "geopandas>=0.10", + "requests", + "boto3", 'tomli; python_version < "3.11"', ] requires-python = ">=3.9" From 8c509955a44da6a53fff7c91bb3aceadef1ccf5a Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Mon, 20 Jun 2022 21:21:47 +1200 Subject: [PATCH 3/9] Updated multipolygon handling to remove depreciated handling of shapely. --- src/geoapis/vector.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geoapis/vector.py b/src/geoapis/vector.py index 6902f7e..ed22c29 100644 --- a/src/geoapis/vector.py +++ b/src/geoapis/vector.py @@ -194,9 +194,9 @@ def get_features_inside_catchment( # the geometries if ( shapely_geometry.geometryType() == "MultiPolygon" - and len(shapely_geometry) == 1 + and len(shapely_geometry.geoms) == 1 ): - shapely_geometry = shapely_geometry[0] + shapely_geometry = shapely_geometry.geoms[0] features["geometry"].append(shapely_geometry) # Add the value of each property in turn @@ -268,9 +268,9 @@ def get_features(self, layer: int) -> geopandas.GeoDataFrame: # geometries if ( shapely_geometry.geometryType() == "MultiPolygon" - and len(shapely_geometry) == 1 + and len(shapely_geometry.geoms) == 1 ): - shapely_geometry = shapely_geometry[0] + shapely_geometry = shapely_geometry.geoms[0] features["geometry"].append(shapely_geometry) # Add the value of each property in turn From 55005a9737ed21fc155496f82e46dfa1f7e0892d Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Mon, 20 Jun 2022 21:25:17 +1200 Subject: [PATCH 4/9] Updated the pacakge version --- pyproject.toml | 2 +- src/geoapis/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 095eef5..b1e21c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "geoapis" -version = "0.2.5" +version = "0.2.6" description = "A package for downloading geospatial data from web APIs." readme = "README.md" authors = [{ name = "Rose pearson", email = "rose.pearson@niwa.co.nz" }] diff --git a/src/geoapis/__init__.py b/src/geoapis/__init__.py index 2f9760f..24fbf69 100644 --- a/src/geoapis/__init__.py +++ b/src/geoapis/__init__.py @@ -4,4 +4,4 @@ @author: pearsonra """ -__version__ = "0.2.4" +__version__ = "0.2.6" From 48f4d41fd0151ef837d4e5db36401f00116e034f Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Tue, 21 Jun 2022 00:27:43 +1200 Subject: [PATCH 5/9] Update package version and toml file --- pyproject.toml | 4 ++-- src/geoapis/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b1e21c0..fda6167 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "geoapis" -version = "0.2.6" +version = "0.2.7" description = "A package for downloading geospatial data from web APIs." readme = "README.md" authors = [{ name = "Rose pearson", email = "rose.pearson@niwa.co.nz" }] @@ -36,5 +36,5 @@ packages = ["geoapis"] dev = ["black", "python-dotenv", "pip-tools", "pytest"] [project.urls] -GitHub = "https://github.com/niwa/geoapis" +Homepage = "https://github.com/niwa/geoapis" Documentation = "https://github.com/niwa/geoapis/wiki" diff --git a/src/geoapis/__init__.py b/src/geoapis/__init__.py index 24fbf69..ffdf35f 100644 --- a/src/geoapis/__init__.py +++ b/src/geoapis/__init__.py @@ -4,4 +4,4 @@ @author: pearsonra """ -__version__ = "0.2.6" +__version__ = "0.2.7" From b3e5454701ba93ac862e0e4f9a040f719d5d5a87 Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Tue, 21 Jun 2022 00:46:04 +1200 Subject: [PATCH 6/9] Updated the readme --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8c3afe4..5ad69cb 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ # geoapis -## Build Status - ![Linux](https://github.com/niwa/geoapis/actions/workflows/linux-test.yml/badge.svg) -## Introduction +**_geoapis_** is a Python package for simply downloading publicly available web-hosted geo-spatial data. It currently supports downloading LiDAR data from OpenTopography, and vector data from the LINZ Data Service. -**_geoapis_** is a Python package for simply downloading publicly available web-hosted geo-spatial data. It currently supports downloading LiDAR data from OpenTopography, and vector data from the LINZ Data Service. +## Installation +**_geoapis_** is avaliable on [conda-forge](https://anaconda.org/conda-forge/geoapis) and [PyPI](https://pypi.org/project/geoapis/). Conda is recommended due to difficulties installing geopandas (a dependency) with pip on Windows. See the [Wiki Install Instructions](https://github.com/niwa/geoapis/wiki/Package-Install-Instructions) for more information. -### Wiki -For detailed instructions on installation, usage, and testing please check out the repo [wiki](https://github.com/niwa/geoapis/wiki). +## Documentation +Package API documentation is hosted at https://rosepearson.github.io/GeoFabrics/. Usage, installation and testing documentation can be found at the [GitHub Wiki](https://github.com/niwa/geoapis/wiki). ### Development Please see the [issues](https://github.com/niwa/geoapis/issues) for details on coming features and additions to the software. Please also submit any requests for new functionality here. -## Contributions +### Contributions There is no current expectations of contributions to this project. We accept input in code reviews now. If you would like to be involved in the project, please contact the maintainer. -## Contacts +### Contacts Maintainer: Rose Pearson @rosepearson rose.pearson@niwa.co.nz ## License From 79a2d871bf5585375f0adbd1dbbcdf452cb41a60 Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Tue, 21 Jun 2022 02:12:26 +1200 Subject: [PATCH 7/9] Fixed a few classified in the pyproject.toml file --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fda6167..cb6b371 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,11 +13,11 @@ readme = "README.md" authors = [{ name = "Rose pearson", email = "rose.pearson@niwa.co.nz" }] license = { file = "LICENSE" } classifiers = [ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: GIS", "Programming Language :: Python :: 3 :: Only", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] keywords = ["APIs", "LiDAR", "point clouds", "vector", "Geospatial data"] From a9fc1dfa7715526f3e95057f723304adc3468dfc Mon Sep 17 00:00:00 2001 From: Rose Pearson Date: Tue, 21 Jun 2022 02:38:19 +1200 Subject: [PATCH 8/9] Updated version with correct license info --- pyproject.toml | 2 +- src/geoapis/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cb6b371..47bf6f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "geoapis" -version = "0.2.7" +version = "0.2.8" description = "A package for downloading geospatial data from web APIs." readme = "README.md" authors = [{ name = "Rose pearson", email = "rose.pearson@niwa.co.nz" }] diff --git a/src/geoapis/__init__.py b/src/geoapis/__init__.py index ffdf35f..914c519 100644 --- a/src/geoapis/__init__.py +++ b/src/geoapis/__init__.py @@ -4,4 +4,4 @@ @author: pearsonra """ -__version__ = "0.2.7" +__version__ = "0.2.8" From 602ff21a4e1f74e0024fbacbf14bc730c7cbe9b3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 20 Jun 2022 14:51:26 +0000 Subject: [PATCH 9/9] fixup: Format Python code with Black --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 72e141c..8ef9667 100644 --- a/setup.py +++ b/setup.py @@ -7,5 +7,6 @@ import setuptools setuptools.setup( - package_dir={"": "src"}, packages=setuptools.find_packages(where="src"), + package_dir={"": "src"}, + packages=setuptools.find_packages(where="src"), )