diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 59e4a8b..d4c7f4c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,12 +15,12 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: ['3.11', '3.10'] + python-version: ['3.12', '3.11'] exclude: # tests with ubuntu-latest, python latest # are executed by build_docs.yaml - os: ubuntu-latest - python-version: 3.11 + python-version: 3.12 steps: - name: Checkout source diff --git a/AUTHORS.rst b/AUTHORS.rst deleted file mode 100644 index e18bd8a..0000000 --- a/AUTHORS.rst +++ /dev/null @@ -1,13 +0,0 @@ -======= -Credits -======= - -Maintainer ----------- - -* Andrew Leaf - -Contributors ------------- - -None yet. Why not be the first? See: CONTRIBUTING.rst diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 30ef0ca..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,104 +0,0 @@ -============ -Contributing -============ - -Contributions are welcome, and they are greatly appreciated! Every -little bit helps, and credit will always be given. - -You can contribute in many ways: - -Types of Contributions ----------------------- - -Report Bugs -~~~~~~~~~~~ - -Report bugs at https://github.com/aleaf/modflow-export/issues. - -If you are reporting a bug, please include: - -* Any details about your local setup that might be helpful in troubleshooting. -* Detailed steps to reproduce the bug. - -Fix Bugs -~~~~~~~~ - -Look through the GitHub issues for bugs. Anything tagged with "bug" -is open to whoever wants to implement it. - -Implement Features -~~~~~~~~~~~~~~~~~~ - -Look through the GitHub issues for features. Anything tagged with "feature" -is open to whoever wants to implement it. - -Write Documentation -~~~~~~~~~~~~~~~~~~~ - -modflow-export could always use more documentation, whether -as part of the official modflow-export docs, in docstrings, -or even on the web in blog posts, articles, and such. - -Submit Feedback -~~~~~~~~~~~~~~~ - -The best way to send feedback is to file an issue at https://github.com/aleaf/modflow-export/issues. - -If you are proposing a feature: - -* Explain in detail how it would work. -* Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions - are welcome :) - -Get Started! ------------- - -Ready to contribute? Here's how to set up `modflow-export` for local development. - -1. Fork the `modflow-export` repo on GitHub. -2. Clone your fork locally:: - - $ git clone git@github.com:your_name_here/modflow-export.git - -3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: - - $ mkvirtualenv mfexport - $ cd mfexport/ - $ python setup.py develop - -4. Create a branch for local development:: - - $ git checkout -b name-of-your-bugfix-or-feature - - Now you can make your changes locally. - -5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: - - $ flake8 mfexport tests - $ python setup.py test - $ tox - - To get flake8 and tox, just pip install them into your virtualenv. - -6. Commit your changes and push your branch to GitHub:: - - $ git add . - $ git commit -m "Your detailed description of your changes." - $ git push origin name-of-your-bugfix-or-feature - -7. Submit a pull request through the GitHub website. - -Pull Request Guidelines ------------------------ - -Before you submit a pull request, check that it meets these guidelines: - -1. The pull request should include tests. -2. If the pull request adds functionality, the docs should be updated. Put - your new functionality into a function with a docstring, and add the - feature to the list in README.rst. -3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5 and for PyPy. Check - https://travis-ci.org/aleaf/modflow-export/pull_requests - and make sure that the tests pass for all supported Python versions. - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ebe6a81..0000000 --- a/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019, Andrew Leaf -Laboratory. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the Brookhaven Science Associates, Brookhaven National - Laboratory nor the names of its contributors may be used to endorse or promote - products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100755 index 0000000..7dbcd7c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,46 @@ +License +======= + +Unless otherwise noted, This project is in the public domain in the United +States because it contains materials that originally came from the United +States Geological Survey, an agency of the United States Department of +Interior. For more information, see the official USGS copyright policy at +https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits + +Additionally, we waive copyright and related rights in the work +worldwide through the CC0 1.0 Universal public domain dedication. + + +CC0 1.0 Universal Summary +------------------------- + +This is a human-readable summary of the +[Legal Code (read the full text)][1]. + + +### No Copyright + +The person who associated a work with this deed has dedicated the work to +the public domain by waiving all of his or her rights to the work worldwide +under copyright law, including all related and neighboring rights, to the +extent allowed by law. + +You can copy, modify, distribute and perform the work, even for commercial +purposes, all without asking permission. + + +### Other Information + +In no way are the patent or trademark rights of any person affected by CC0, +nor are the rights that other persons may have in the work or in how the +work is used, such as publicity or privacy rights. + +Unless expressly stated otherwise, the person who associated a work with +this deed makes no warranties about the work, and disclaims liability for +all uses of the work, to the fullest extent permitted by applicable law. +When using or citing the work, you should not imply endorsement by the +author or the affirmer. + + + +[1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 10bdc53..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,16 +0,0 @@ -include AUTHORS.rst -include CONTRIBUTING.rst -include LICENSE -include README.rst -include requirements.txt - -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -recursive-include docs *.rst conf.py Makefile make.bat - -include versioneer.py -include mfexport/_version.py - -# If including data files in the package, add them like: -# include path/to/data_file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cf71a91 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +[build-system] +requires = [ + "setuptools >= 61", + #'tomli; python_version < "3.11"', +] +build-backend = "setuptools.build_meta" + +[project] +name = "modflow-export" +dynamic = ["version"] +authors = [ + { name = "Andrew Leaf", email = "aleaf@usgs.gov" }, + { name = "Mike Fienen", email = "mnfienen@usgs.gov" }, +] +description = "Fast & easy summarizing of MODFLOW data and export to GIS file formats" +readme = "Readme.md" +keywords = ["MODFLOW", "groundwater", "hydrogeology"] +license = {file = "LICENSE.md"} +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: Hydrology", +] +requires-python = ">=3.11" +dependencies = [ + "gis-utils", + "fiona", + "flopy", + "matplotlib", + "numpy", + "pandas", + "pyproj", + "pyyaml", + "rasterio", + "shapely", + "xarray", +] + +[project.optional-dependencies] +optional = [ +] +test = [ + "codecov", + "coverage", + "pytest", +] +docs = [ + "modflow-export[optional]", + "ipython[kernel]", + "sphinx", + "numpydoc", + "nbsphinx", + "sphinx-copybutton", + "sphinx-rtd-theme" +] + +[project.scripts] +get-modflow = "flopy.utils.get_modflow:cli_main" + +[project.urls] +documentation = "https://aleaf.github.io/modflow-export/latest/" +repository = "https://github.com/aleaf/modflow-export" + +[tool.setuptools.packages.find] +include = ["mfexport", "mfexport.*"] + +[tool.versioneer] +VCS = "git" +style = "pep440-post" +versionfile_source = "mfexport/_version.py" +versionfile_build = "mfexport/_version.py" +tag_prefix = "v" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index b1f5b0a..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,26 +0,0 @@ -# These are required for developing the package (running the tests, building -# the documentation) but not necessarily required for _using_ it. -pyyaml -numpy -pandas -xarray -gdal -fiona -rasterio -shapely -pyproj -rtree -flopy -gis-utils -codecov -coverage -flake8 -pytest -sphinx -# These are dependencies of various sphinx extensions for documentation. -ipython -matplotlib -numpydoc -sphinx-copybutton -sphinx_rtd_theme - diff --git a/requirements-dev.yml b/requirements-dev.yml deleted file mode 100644 index ab1daca..0000000 --- a/requirements-dev.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: mfexport_dev -channels: - - conda-forge - - defaults -dependencies: - - python - - pyyaml - - numpy - - pandas - - xarray - - gdal - - fiona - - rasterio - - shapely - - pyproj>=2.0 - - codecov - - coverage - - flake8 - - pytest - - sphinx - - numpydoc - - nbsphinx # for rendering notebooks in sphinx-generated docs - - sphinx-copybutton - - sphinx_rtd_theme - - pip - - pip: - - pytest-timeout - - git+https://github.com/modflowpy/flopy@develop - - git+https://github.com/aleaf/gis-utils@develop - diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b4fd621..0000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -# List required packages in this file, one per line. -pyyaml -numpy -pandas -xarray -gdal -fiona -rasterio -shapely -pyproj -flopy -gis-utils \ No newline at end of file diff --git a/requirements.yml b/requirements.yml deleted file mode 100644 index 5ae1bdd..0000000 --- a/requirements.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: mfexport -channels: -- conda-forge -dependencies: -- python -- pyyaml -- numpy -- pandas -- xarray -- gdal -- fiona -- rasterio -- shapely -- pyproj -- pip -- pip: - - git+https://github.com/modflowpy/flopy@develop - - git+https://github.com/aleaf/gis-utils@develop - diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bef97be..0000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[versioneer] -VCS = git -style = pep440-post -versionfile_source = mfexport/_version.py -versionfile_build = mfexport/_version.py -tag_prefix = v diff --git a/setup.py b/setup.py index 91e0feb..5fa9821 100644 --- a/setup.py +++ b/setup.py @@ -1,67 +1,18 @@ -from os import path -from setuptools import setup, find_packages +import os import sys -import versioneer - - -# NOTE: This file must remain Python 2 compatible for the foreseeable future, -# to ensure that we error out properly for people with outdated setuptools -# and/or pip. -min_version = (3, 6) -if sys.version_info < min_version: - error = """ -modflow-export does not support Python {0}.{1}. -Python {2}.{3} and above is required. Check your Python version like so: - -python3 --version -This may be due to an out-of-date pip. Make sure you have pip >= 9.0.1. -Upgrade pip like so: +from setuptools import setup -pip install --upgrade pip -""".format(*(sys.version_info[:2] + min_version)) - sys.exit(error) - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, 'Readme.md'), encoding='utf-8') as readme_file: - readme = readme_file.read() - -with open(path.join(here, 'requirements.txt')) as requirements_file: - # Parse requirements.txt, ignoring any commented-out lines. - requirements = [line for line in requirements_file.read().splitlines() - if not line.startswith('#')] +# ensure the current directory is on sys.path so versioneer can be imported +# when pip uses PEP 517/518 build rules. +# https://github.com/python-versioneer/python-versioneer/issues/193 +sys.path.append(os.path.dirname(__file__)) +import versioneer +# see pyproject.toml for static project metadata setup( name='modflow-export', version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), - description="Fast & easy export of MODFLOW data to GIS file formats", - long_description=readme, - author="Andrew Leaf", - author_email='aleaf@usgs.gov', - url='https://github.com/aleaf/modflow-export', - python_requires='>={}'.format('.'.join(str(n) for n in min_version)), - packages=find_packages(exclude=['docs', 'tests']), - entry_points={ - 'console_scripts': [ - # 'command = some.module:some_function', - ], - }, - include_package_data=True, - package_data={ - 'modflow-export': [ - # When adding files here, remember to update MANIFEST.in as well, - # or else they will not be included in the distribution on PyPI! - # 'path/to/data_file', - ] - }, - install_requires=requirements, - license="BSD (3-clause)", - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - ], )