Skip to content

Commit

Permalink
Merge pull request #91 from mwtoews/pyproject-toml
Browse files Browse the repository at this point in the history
Move project metadata to pyproject.toml, modify build scripts
  • Loading branch information
larsbutler committed Jul 15, 2023
2 parents 8d2b8f2 + 5725e01 commit 5a69f35
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 75 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Ram Rachum <ram@rachum.com> - June 2020
Andrew Chapkowski <andrewonboe@gmail.com> - June 2020
Vadim Kozyrevskii <vadikko2@mail.ru> - January 2021
Stian Jensen <me@stianj.com> - January 2022
Mike Taves <mwtoews@gmail.com> - May 2023
5 changes: 1 addition & 4 deletions build-scripts/01-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ function cleanup {
pushd ${ROOT_DIR}
trap cleanup EXIT

pip install -r requirements.txt
python setup.py -q install
pip install .
# Verify that the `geomet` CLI was installed:
which geomet
# Check the package for publishing suitability:
twine check dist/*
9 changes: 8 additions & 1 deletion build-scripts/03-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ function cleanup {
pushd ${ROOT_DIR}
trap cleanup EXIT

# Clean any previous builds:
rm -rfv geomet.egg-info
rm -rfv dist

# Create source and binary distributions:
python setup.py sdist bdist_wheel
python -m build

# Check the package for publishing suitability:
twine check --strict dist/*
4 changes: 1 addition & 3 deletions packaging-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
setuptools
wheel
build
twine
readme-renderer
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[build-system]
requires = [
"setuptools >=61",
]
build-backend = "setuptools.build_meta"

[project]
name = "geomet"
maintainers = [
{name = "Lars Butler", email = "lars.butler@gmail.com"},
]
description = "Pure Python conversion library for common geospatial data formats"
requires-python = ">=3.7"
keywords = [
"esri",
"ewkb",
"ewkt",
"geojson",
"geopackage",
"geospatial",
"gis",
"spatial",
"wkb",
"wkt",
]
license = {text = "Apache-2.0"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: GIS",
]
dependencies = [
"click",
"six",
]
dynamic = ["version"]

[project.readme]
text = """\
GeoMet
Convert GeoJSON to WKT/WKB (Well-Known Text/Binary), and vice versa.
"""
content-type = "text/x-rst"

[project.scripts]
geomet = "geomet.tool:cli"

[project.urls]
Repository = "https://github.com/geomet/geomet"

[tool.setuptools.dynamic]
version = {attr = "geomet.__init__.__version__"}

[tool.setuptools.packages.find]
include = ["geomet", "geomet.*"]
exclude = ["geomet.tests", "geomet.tests.*"]
69 changes: 2 additions & 67 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,70 +1,5 @@
"""
GeoMet
Convert GeoJSON to WKT/WKB (Well-Known Text/Binary), and vice versa.
"""

import re
import sys

from setuptools import find_packages
from setuptools import setup


def get_version():
version_re = r"^__version__\s+=\s+['\"]([^'\"]*)['\"]"
version = None

for line in open('geomet/__init__.py', 'r'):
version_match = re.search(version_re, line, re.M)
if version_match:
version = version_match.group(1)
break
else:
sys.exit('__version__ variable not found in geomet/__init__.py')

return version

VERSION = get_version()

setup(
name='geomet',
version=VERSION,
maintainer='Lars Butler',
maintainer_email='lars.butler@gmail.com',
url='https://github.com/geomet/geomet',
description='Conversion library for common geospatial data formats (GeoJSON/WKT/EWKT/WKB/EWKB/GeoPackage/EsriJson)',
long_description=__doc__,
platforms=['any'],
packages=find_packages(exclude=['geomet.tests', 'geomet.tests.*']),
entry_points={'console_scripts': ['geomet=geomet.tool:cli']},
license='Apache 2.0',
keywords=[
'esri',
'ewkb',
'ewkt',
'geojson',
'geopackage',
'geospatial',
'gis',
'spatial',
'wkb',
'wkt',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering :: GIS',
],
zip_safe=False,
install_requires=['click', 'six'],
python_requires=">=3.7, <4",
)
# See pyproject.toml for project metadata
setup(name='geomet')

0 comments on commit 5a69f35

Please sign in to comment.