-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(setup): convert project to use pyproject.toml
- Loading branch information
Showing
9 changed files
with
88 additions
and
200 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,89 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
requires = [ | ||
"setuptools >= 61", | ||
#"wheel" | ||
#'tomli; python_version < "3.11"', | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "modflow-setup" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name = "Andrew Leaf", email = "[email protected]" }, | ||
{ name = "Mike Fienen", email = "[email protected]" }, | ||
] | ||
description = "Rapid and robust construction of MODFLOW groundwater flow models" | ||
readme = "Readme.md" | ||
keywords = ["MODFLOW", "groundwater", "hydrogeology"] | ||
license = {file = "LICENSE.md"} | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Scientific/Engineering :: Hydrology", | ||
] | ||
requires-python = ">=3.11" | ||
dependencies = [ | ||
"geopandas", | ||
"gis-utils", | ||
"fiona", | ||
"flopy", | ||
"modflow-export", | ||
"netcdf4", | ||
"numpy", | ||
"pandas", | ||
"pyproj", | ||
"pyyaml", | ||
"rasterio", | ||
"rasterstats", | ||
"rtree", | ||
"scipy", | ||
"sfrmaker", | ||
"shapely", | ||
"xarray", | ||
] | ||
|
||
[project.optional-dependencies] | ||
optional = [ | ||
"matplotlib", | ||
|
||
] | ||
test = [ | ||
"codecov", | ||
"coverage", | ||
"pytest", | ||
"pytest-timeout" | ||
] | ||
docs = [ | ||
"matplotlib", | ||
"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://doi-usgs.github.io/modflow-setup/latest/" | ||
repository = "https://github.com/doi-usgs/modflow-setup" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["mfsetup", "mfsetup.*"] | ||
|
||
[tool.versioneer] | ||
VCS = "git" | ||
style = "pep440-post" | ||
versionfile_source = "mfsetup/_version.py" | ||
versionfile_build = "mfsetup/_version.py" | ||
tag_prefix = "v" | ||
parentdir_prefix = "mfsetup-" | ||
|
||
[tool.isort] | ||
default_section = "THIRDPARTY" | ||
known_first_party = ["xarray"] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,18 @@ | ||
import os | ||
import sys | ||
from os import path | ||
|
||
from setuptools import find_packages, setup | ||
from setuptools import setup | ||
|
||
# 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(path.dirname(__file__)) | ||
|
||
import versioneer # noqa: E402 | ||
|
||
# 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-setup 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: | ||
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('#')] | ||
sys.path.append(os.path.dirname(__file__)) | ||
|
||
import versioneer | ||
|
||
# see pyproject.toml for static project metadata | ||
setup( | ||
name='modflow-setup', | ||
version=versioneer.get_version(), | ||
cmdclass=versioneer.get_cmdclass(), | ||
description="Robust automation of MODFLOW model construction.", | ||
long_description=readme, | ||
long_description_content_type='text/markdown', | ||
author="USGS MAP Project", | ||
author_email='[email protected]', | ||
url='https://github.com/aleaf/modflow-setup', | ||
python_requires='>={}'.format('.'.join(str(n) for n in min_version)), | ||
packages=find_packages(exclude=['docs', 'tests']), | ||
entry_points={ | ||
'console_scripts': [ | ||
# 'some.module:some_function', | ||
], | ||
}, | ||
include_package_data=True, | ||
package_data={ | ||
'modflow-setup': [ | ||
# 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', | ||
], | ||
) |