diff --git a/.github/workflows/deploy-sdist.yaml b/.github/workflows/deploy-sdist.yaml index f7fb019d..c4fcfdf4 100644 --- a/.github/workflows/deploy-sdist.yaml +++ b/.github/workflows/deploy-sdist.yaml @@ -18,7 +18,7 @@ jobs: shell: bash -l {0} run: | python -m pip install -U build pip - python -m build --sdist + python -m build - name: Publish package to PyPI # upload to PyPI on every release for a tag starting with 'v' diff --git a/MANIFEST.in b/MANIFEST.in index d1be46ef..8c1fd4a2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,8 +2,8 @@ recursive-include doc/source * recursive-include polar2grid/tests/etc * include polar2grid/grids/grids.yaml recursive-include polar2grid/fonts * -recursive-include etc * +recursive-include polar2grid/etc * include LICENSE.txt include README.rst -recursive-exclude doc/source/_static/example_images *.png *.jpeg *.jpg +recursive-exclude doc/source/_static/example_images *.png *.jpg recursive-exclude doc/source/_static *.psd *.xcf diff --git a/etc/colormaps/IFR_PROB.cmap b/polar2grid/etc/colormaps/IFR_PROB.cmap similarity index 100% rename from etc/colormaps/IFR_PROB.cmap rename to polar2grid/etc/colormaps/IFR_PROB.cmap diff --git a/etc/colormaps/LIFR_PROB.cmap b/polar2grid/etc/colormaps/LIFR_PROB.cmap similarity index 100% rename from etc/colormaps/LIFR_PROB.cmap rename to polar2grid/etc/colormaps/LIFR_PROB.cmap diff --git a/etc/colormaps/MVFR_PROB.cmap b/polar2grid/etc/colormaps/MVFR_PROB.cmap similarity index 100% rename from etc/colormaps/MVFR_PROB.cmap rename to polar2grid/etc/colormaps/MVFR_PROB.cmap diff --git a/etc/colormaps/abi_l2_modified_cloud_top.cmap b/polar2grid/etc/colormaps/abi_l2_modified_cloud_top.cmap similarity index 100% rename from etc/colormaps/abi_l2_modified_cloud_top.cmap rename to polar2grid/etc/colormaps/abi_l2_modified_cloud_top.cmap diff --git a/etc/colormaps/amsr2_36h.cmap b/polar2grid/etc/colormaps/amsr2_36h.cmap similarity index 100% rename from etc/colormaps/amsr2_36h.cmap rename to polar2grid/etc/colormaps/amsr2_36h.cmap diff --git a/etc/colormaps/amsr2_89h.cmap b/polar2grid/etc/colormaps/amsr2_89h.cmap similarity index 100% rename from etc/colormaps/amsr2_89h.cmap rename to polar2grid/etc/colormaps/amsr2_89h.cmap diff --git a/etc/colormaps/gridded_data.cmap b/polar2grid/etc/colormaps/gridded_data.cmap similarity index 100% rename from etc/colormaps/gridded_data.cmap rename to polar2grid/etc/colormaps/gridded_data.cmap diff --git a/etc/colormaps/hsl256_no_black.cmap b/polar2grid/etc/colormaps/hsl256_no_black.cmap similarity index 100% rename from etc/colormaps/hsl256_no_black.cmap rename to polar2grid/etc/colormaps/hsl256_no_black.cmap diff --git a/etc/colormaps/p2g_sst_palette.txt b/polar2grid/etc/colormaps/p2g_sst_palette.txt similarity index 100% rename from etc/colormaps/p2g_sst_palette.txt rename to polar2grid/etc/colormaps/p2g_sst_palette.txt diff --git a/etc/colormaps/tropix_no_white.cmap b/polar2grid/etc/colormaps/tropix_no_white.cmap similarity index 100% rename from etc/colormaps/tropix_no_white.cmap rename to polar2grid/etc/colormaps/tropix_no_white.cmap diff --git a/etc/colormaps/viirs_edr_flood_water_detection.cmap b/polar2grid/etc/colormaps/viirs_edr_flood_water_detection.cmap similarity index 100% rename from etc/colormaps/viirs_edr_flood_water_detection.cmap rename to polar2grid/etc/colormaps/viirs_edr_flood_water_detection.cmap diff --git a/etc/composites/abi.yaml b/polar2grid/etc/composites/abi.yaml similarity index 100% rename from etc/composites/abi.yaml rename to polar2grid/etc/composites/abi.yaml diff --git a/etc/composites/ahi.yaml b/polar2grid/etc/composites/ahi.yaml similarity index 100% rename from etc/composites/ahi.yaml rename to polar2grid/etc/composites/ahi.yaml diff --git a/etc/composites/mersi-2.yaml b/polar2grid/etc/composites/mersi-2.yaml similarity index 100% rename from etc/composites/mersi-2.yaml rename to polar2grid/etc/composites/mersi-2.yaml diff --git a/etc/composites/modis.yaml b/polar2grid/etc/composites/modis.yaml similarity index 100% rename from etc/composites/modis.yaml rename to polar2grid/etc/composites/modis.yaml diff --git a/etc/composites/viirs.yaml b/polar2grid/etc/composites/viirs.yaml similarity index 100% rename from etc/composites/viirs.yaml rename to polar2grid/etc/composites/viirs.yaml diff --git a/etc/enhancements/abi.yaml b/polar2grid/etc/enhancements/abi.yaml similarity index 100% rename from etc/enhancements/abi.yaml rename to polar2grid/etc/enhancements/abi.yaml diff --git a/etc/enhancements/agri.yaml b/polar2grid/etc/enhancements/agri.yaml similarity index 100% rename from etc/enhancements/agri.yaml rename to polar2grid/etc/enhancements/agri.yaml diff --git a/etc/enhancements/ahi.yaml b/polar2grid/etc/enhancements/ahi.yaml similarity index 100% rename from etc/enhancements/ahi.yaml rename to polar2grid/etc/enhancements/ahi.yaml diff --git a/etc/enhancements/ami.yaml b/polar2grid/etc/enhancements/ami.yaml similarity index 100% rename from etc/enhancements/ami.yaml rename to polar2grid/etc/enhancements/ami.yaml diff --git a/etc/enhancements/generic.yaml b/polar2grid/etc/enhancements/generic.yaml similarity index 100% rename from etc/enhancements/generic.yaml rename to polar2grid/etc/enhancements/generic.yaml diff --git a/etc/enhancements/mersi-2.yaml b/polar2grid/etc/enhancements/mersi-2.yaml similarity index 100% rename from etc/enhancements/mersi-2.yaml rename to polar2grid/etc/enhancements/mersi-2.yaml diff --git a/etc/enhancements/modis.yaml b/polar2grid/etc/enhancements/modis.yaml similarity index 100% rename from etc/enhancements/modis.yaml rename to polar2grid/etc/enhancements/modis.yaml diff --git a/etc/enhancements/viirs.yaml b/polar2grid/etc/enhancements/viirs.yaml similarity index 100% rename from etc/enhancements/viirs.yaml rename to polar2grid/etc/enhancements/viirs.yaml diff --git a/etc/pyspectral.yaml b/polar2grid/etc/pyspectral.yaml similarity index 100% rename from etc/pyspectral.yaml rename to polar2grid/etc/pyspectral.yaml diff --git a/etc/readers/mirs.yaml b/polar2grid/etc/readers/mirs.yaml similarity index 100% rename from etc/readers/mirs.yaml rename to polar2grid/etc/readers/mirs.yaml diff --git a/etc/resampling.yaml b/polar2grid/etc/resampling.yaml similarity index 100% rename from etc/resampling.yaml rename to polar2grid/etc/resampling.yaml diff --git a/etc/writers/awips_tiled.yaml b/polar2grid/etc/writers/awips_tiled.yaml similarity index 100% rename from etc/writers/awips_tiled.yaml rename to polar2grid/etc/writers/awips_tiled.yaml diff --git a/etc/writers/binary.yaml b/polar2grid/etc/writers/binary.yaml similarity index 100% rename from etc/writers/binary.yaml rename to polar2grid/etc/writers/binary.yaml diff --git a/etc/writers/hdf5.yaml b/polar2grid/etc/writers/hdf5.yaml similarity index 100% rename from etc/writers/hdf5.yaml rename to polar2grid/etc/writers/hdf5.yaml diff --git a/pyproject.toml b/pyproject.toml index 217e0483..5dff3a63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,91 @@ [build-system] -requires = ["setuptools>=45", "wheel"] +requires = ["setuptools>=45"] build-backend = "setuptools.build_meta" +[project] +name = "polar2grid" +version = "3.1.0" +authors = [ + {name = "David Hoese", email = "david.hoese@ssec.wisc.edu"}, +] +description = "Library and scripts to remap satellite data to a gridded image" +readme = "README.rst" +license = {text = "GPLv3"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: Implementation :: CPython", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS :: MacOS X", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "Topic :: Scientific/Engineering :: GIS", +] +requires-python = ">=3.10" +dependencies = [ + "satpy", + "rasterio", + "netCDF4", + "h5py", +] + +[project.optional-dependencies] +utils = ["matplotlib"] +docs = ["sphinx", "rst2pdf", "sphinx-argparse", "sphinxcontrib-apidoc", "pytest"] +tests = ["pytest"] +coastlines = ["pycoast", "pydecorate"] +all = ["matplotlib", "sphinx", "rst2pdf", "sphinx-argparse", "sphinxcontrib-apidoc", "pytest", "pycoast", "pydecorate"] + +[project.urls] +Documentation = "https://www.ssec.wisc.edu/software/polar2grid/" +Home-page = "https://cimss.ssec.wisc.edu/cspp/" +Download-URL = "https://pypi.org/project/polar2grid/" +Project-URL = "https://github.com/ssec/polar2grid/" + +[project.scripts] +polar2grid = "polar2grid.__main__:p2g_main" +geo2grid = "polar2grid.__main__:g2g_main" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages] +find = {} + +[tool.isort] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] +profile = "black" +skip_gitignore = true +force_to_top = true +default_section = "THIRDPARTY" +known_first_party = "polar2grid" +line_length = 120 + [tool.black] line-length = 120 -target-version = ['py38'] +target-version = ['py310'] include = '\.pyi?$' + +[tool.coverage.run] +relative_files = true + +[tool.ruff] +# See https://docs.astral.sh/ruff/rules/ +select = ["E", "W", "B", "D", "T10", "C90"] +# Remove D416 when all docstrings have been converted to google-style +ignore = ["D107", "D416"] +line-length = 120 +exclude = ["versioneer.py", "pyresample/version.py"] + +[tool.ruff.per-file-ignores] +"pyresample/test/*.py" = ["D102", "S101"] # assert allowed in tests + +[tool.ruff.pydocstyle] +convention = "google" + +[tool.ruff.mccabe] +max-complexity = 10 diff --git a/setup.cfg b/setup.cfg index 748a33f5..69402b55 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,21 +1,6 @@ -[bdist_wheel] -# this is only true when ewa resampling uses pyresample directly -universal=1 - [flake8] max-line-length = 120 ignore = D101,D102,D103,D105,D106,D107,E203 per-file-ignores = doc/source/conf.py:E501 polar2grid/readers/*.py:D205,D400 - -[isort] -sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER -profile = black -skip_gitignore = true -force_to_top = true -default_section = THIRDPARTY -known_first_party = polar2grid - -[coverage:run] -relative_files = True diff --git a/setup.py b/setup.py deleted file mode 100644 index db9e428e..00000000 --- a/setup.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python3 -# encoding: utf-8 -# Copyright (C) 2014 Space Science and Engineering Center (SSEC), -# University of Wisconsin-Madison. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# This file is part of the polar2grid software package. Polar2grid takes -# satellite observation data, remaps it, and writes it to a file format for -# input into another program. -# Documentation: http://www.ssec.wisc.edu/software/polar2grid/ -# -# Written by David Hoese November 2014 -# University of Wisconsin-Madison -# Space Science and Engineering Center -# 1225 West Dayton Street -# Madison, WI 53706 -# david.hoese@ssec.wisc.edu -"""Script for installing the polar2grid package. - -See the documentation site for more information: - -http://www.ssec.wisc.edu/software/polar2grid/ - -""" -from glob import glob - -from setuptools import find_packages, setup - -version = "3.1.0" - - -def readme(): - with open("README.rst", "r") as f: - return f.read() - - -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: Implementation :: CPython", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS :: MacOS X", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: GIS", -] - -extras_require = { - # Other: - "utils": ["matplotlib"], - "docs": ["sphinx", "rst2pdf", "sphinx-argparse", "sphinxcontrib-apidoc", "pytest"], - "tests": ["pytest"], - "coastlines": ["pycoast", "pydecorate"], -} -extras_require["all"] = list(set([x for y in extras_require.values() for x in y])) - -entry_points = { - "console_scripts": [ - "polar2grid=polar2grid.__main__:p2g_main", - "geo2grid=polar2grid.__main__:g2g_main", - ], -} - -setup( - name="polar2grid", - version=version, - author="David Hoese, SSEC", - author_email="david.hoese@ssec.wisc.edu", - license="GPLv3", - description="Library and scripts to remap satellite data to a grid", - long_description=readme(), - classifiers=classifiers, - keywords="", - url="https://www.ssec.wisc.edu/software/polar2grid/", - packages=find_packages(), - include_package_data=True, - package_data={ - "polar2grid": [ - "grids/*.conf", - ] - }, - # The location of where these are installed are important for the swbundle and glue scripts! - # Look at env.sh, glue.py, and glue_legacy.py for where these are pointed to. - data_files=[ - ("etc/polar2grid/colormaps", glob("etc/colormaps/*")), - ("etc/polar2grid/composites", glob("etc/composites/*")), - ("etc/polar2grid/enhancements", glob("etc/enhancements/*")), - ("etc/polar2grid/readers", glob("etc/readers/*")), - ("etc/polar2grid/writers", glob("etc/writers/*")), - ("etc/polar2grid", ["etc/pyspectral.yaml"]), - ("etc/polar2grid", ["etc/resampling.yaml"]), - ], - zip_safe=True, - install_requires=[ - "setuptools", # reading configuration files - "satpy", - "rasterio", - "netCDF4", - "h5py", - ], - python_requires=">=3.9", - extras_require=extras_require, - entry_points=entry_points, - scripts=[file for file in glob("swbundle/*.sh") if file not in ["swbundle/env.sh", "swbundle/polar2grid_env.sh"]], -)