Repository: blaylockbk/goes2go (language: python)

Issue:
Update setup.py to use new setup.cfg
People have reported issues with installing goes2go. I think that's because they are using unsupported versions of Python. I need to migrate the install to the new setup.cfg method anyways.

<!-- Edit the body of your new issue then click the ✓ "Create Issue" button in the top right of the editor. The first line will be the issue title. Assignees and Labels follow after a blank line. Leave an empty line before beginning the body of the issue. -->


Discussion / hints:

Fix patch:
diff --git a/environment-dev.yml b/environment-dev.yml
new file mode 100644
index 0000000..272139e
--- /dev/null
+++ b/environment-dev.yml
@@ -0,0 +1,82 @@
+name: goes2go-dev
+channels:
+  - conda-forge
+dependencies:
+  - python=3.10
+  - pip
+  - git
+  - rclone >= 1.58.0  # Not required by goes2go, but is an awesome alternative https://rclone.org/
+
+  # Tools
+  # -----
+  - cartopy
+  - geopandas
+  - h5netcdf
+  - jupyter
+  - jupyterlab
+  - matplotlib
+  - metpy
+  - netcdf4
+  - numpy
+  - pandas
+  - s3fs
+  - toml
+  - xarray
+
+  # Formatter & Testing
+  # -------------------
+  - black
+  - isort
+  - pytest
+
+
+  # Documentation
+  # -------------
+  - sphinx>=4.5
+  - nbsphinx
+  - nbconvert>=6.5
+  - pydata-sphinx-theme # PyData Sphinx Theme (i.e, Numpy, Pandas, MetPy)
+  - sphinx-design
+  - recommonmark
+  - sphinx-markdown-tables
+  - autodocsumm
+  - sphinx-autosummary-accessors # pandas and xarray accessor docs
+  - latexmk
+  - myst-parser
+  - linkify-it-py
+
+  - pip:
+      # Install from PyPi
+      #- goes2go
+
+      # Install most recent version on GitHub
+      #- git+https://github.com/blaylockbk/goes2go.git
+
+      # Install a specific branch
+      - git+https://github.com/blaylockbk/goes2go.git@blaylockbk/issue33-update-to-setup.cfg
+
+      # Borrow some tools from my garage
+      - git+https://github.com/blaylockbk/Carpenter_Workshop.git
+
+###############################################################################
+#
+# Note: Being more specific with versions *may* help speed up conda
+# creating/updating environments
+# https://www.anaconda.com/blog/understanding-and-improving-condas-performance
+#
+###############################################################################
+#
+# To create this environment
+#
+#     wget https://github.com/blaylockbk/goes2go/raw/main/environment.yml
+#     conda env create -f environment.yml
+#
+# To update this environment
+#
+#     conda env update -f environment.yml --prune
+#
+# To remove this environment
+#
+#     conda env remove --name environment
+#
+###############################################################################
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..8ca4445
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,11 @@
+[build-system]
+requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools_scm]
+version_scheme = "post-release"
+local_scheme = "no-local-version"
+write_to = "goes2go/_version.py"
+
+[tool.isort]
+profile = "black"
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..96991f1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,65 @@
+[metadata]
+name = goes2go
+description = Retrieve GOES-16/17 data from AWS. Also proves some RGB recipes.
+author = Brian K. Blaylock
+author_email = blaylockbk@gmail.com
+long_description = file: README.md
+long_description_content_type = text/markdown
+license = MIT
+license_file = LICENSE
+platform = any
+url = https://github.com/blaylockbk/goes2go
+project_urls =
+    Source Code = https://github.com/blaylockbk/goes2go
+    Documentation = https://blaylockbk.github.io/goes2go/_build/html/
+    Release Notes = https://github.com/blaylockbk/goes2go/releases
+    Bug Tracker = https://github.com/blaylockbk/goes2go/issues
+keywords =
+    meteorology
+    weather
+    atmosphere
+    GOES
+    xarray
+classifiers =
+    Development Status :: 4 - Beta
+    Programming Language :: Python :: 3
+    Operating System :: OS Independent
+    License :: OSI Approved :: MIT License
+    Intended Audience :: Science/Research
+    Topic :: Scientific/Engineering :: Atmospheric Science
+
+[options]
+packages = find:
+include_package_data = True
+setup_requires = setuptools_scm
+python_requires = >=3.8
+zip_safe = False
+install_requires =
+    numpy
+    pandas
+    xarray
+    s3fs
+    netcdf4
+    metpy
+    cartopy
+    toml
+
+## Something wrong with the below??
+
+#[options.extra_require]
+#tests =
+#    pytest
+#    black
+#    isort
+#doc =
+#    sphinx
+#    nbsphinx
+#    pydata-sphinx-theme
+#    sphinx-design
+#    autodocsumm
+#    myst-parser
+#
+#[build_sphinx]
+#source-dir = docs
+#build-dir = docs/_build
+#
diff --git a/setup.py b/setup.py
index 38b303e..7f1a176 100644
--- a/setup.py
+++ b/setup.py
@@ -1,70 +1,4 @@
-from pathlib import Path
-from setuptools import setup, find_packages
+from setuptools import setup
 
-HERE = Path(__file__).parent
-README = (HERE / "README.md").read_text(encoding="utf8")
-
-setup(
-    name="goes2go",
-    version="2022.08.26",
-    author="Brian K. Blaylock",
-    author_email="blaylockbk@gmail.com",
-    description="Retreive GOES-16/17 data from AWS. Also proves some RGB recipes.",
-    long_description=README,
-    long_description_content_type="text/markdown",
-    project_urls={
-        "Source Code": "https://github.com/blaylockbk/goes2go",
-        "Documentation": "https://blaylockbk.github.io/goes2go/_build/html/",
-    },
-    license="MIT",
-    packages=find_packages(),
-    package_data={
-        "": ["*.cfg", "*.txt"],
-    },
-    # python_requires='>3.7',   # Will this requirement cause problems for people??
-    install_requires=["numpy", "pandas", "xarray", "s3fs", "netcdf4"],
-    keywords=["xarray", "meteorology", "weather", "GOES", "forecast"],
-    classifiers=[
-        "Development Status :: 4 - Beta",
-        "License :: OSI Approved :: MIT License",
-        "Intended Audience :: Developers",
-        "Intended Audience :: Education",
-        "Intended Audience :: Science/Research",
-        "Natural Language :: English",
-        "Programming Language :: Python",
-        "Topic :: Scientific/Engineering :: Atmospheric Science",
-    ],
-    zip_safe=False,
-)
-
-###############################################################################
-## Brian's Note: How to upload a new version to PyPI
-## -------------------------------------------------
-# Update version in
-#  - setup.py
-#  - CITATION.cff
-#  - Create a tag and release in GitHub
-# Created a new conda environment with twine
-# conda create -n pypi python=3 twine pip -c conda-forge
-"""
-conda activate pypi
-cd goes2go
-python setup.py sdist bdist_wheel
-twine check dist/*
-# Test PyPI
-twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
-# PyPI
-twine upload --skip-existing dist/*
-"""
-
-
-#######################################################
-## On May 12, 2022 I changed the default branch to main
-## You can change your local clone default name with
-## The following
-"""
-git branch -m master main
-git fetch origin
-git branch -u origin/main main
-git remote set-head origin -a
-"""
+if __name__ == "__main__":
+    setup()


Test patch:
diff --git a/tests/test_GOES.py b/tests/test_GOES.py
new file mode 100644
index 0000000..8af292f
--- /dev/null
+++ b/tests/test_GOES.py
@@ -0,0 +1,25 @@
+from goes2go import GOES
+
+def test_GOES():
+    """Create a GOES object"""
+    G = GOES(satellite="noaa-goes16", domain='C')
+    assert G.satellite == 'noaa-goes16'
+    assert G.domain == 'C'
+
+def test_GOES_latest():
+    G = GOES()
+    ds = G.latest()
+
+def test_GOES_nearesttime():
+    G = GOES()
+    ds = G.nearesttime('2022-01-01')
+
+def test_GOES_timerange():
+    G = GOES()
+    ds = G.timerange('2022-01-01 00:00', '2022-01-01 01:00')
+
+def test_GOES_df():
+    G = GOES()
+    df = G.df('2022-01-01 00:00', '2022-01-01 01:00')
+
+