-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(setup): prefer setup.cfg for package metadata, and other cha…
…nges * Assign one author and one maintainer, which is expected by PyPI * Expand a few classifiers, add keywords and project URLs * Use python_requires, auto-find packages, and set zip_safe=False * Add pyproject.toml with black configuration, with default "-l 79" * Remove pypandoc dependency, specify 'text/markdown' content type * Change default sdist format to zip
- Loading branch information
Showing
9 changed files
with
101 additions
and
104 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[build-system] | ||
# Minimum requirements for the build system to execute | ||
requires = ["setuptools>=40.8.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.black] | ||
line-length = 79 | ||
target_version = ["py37"] |
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
[metadata] | ||
name = flopy | ||
version = attr: flopy.version.__version__ | ||
description = FloPy is a Python package to create, run, and post-process MODFLOW-based models | ||
long_description = file: docs/PyPi_release.md | ||
long_description_content_type = text/markdown | ||
author = USGS MODFLOW Team | ||
author_email = modflow@usgs.gov | ||
maintainer = Joseph D. Hughes | ||
maintainer_email = jdhughes@usgs.gov | ||
license = CC0 | ||
license_files = LICENSE, LICENSE.md | ||
platform = Windows, Mac OS-X, Linux | ||
keywords = MODFLOW, groundwater, hydrogeology | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Science/Research | ||
License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 :: Only | ||
Topic :: Scientific/Engineering :: Hydrology | ||
url = https://github.com/modflowpy/flopy | ||
download_url = https://pypi.org/project/flopy | ||
project_urls = | ||
Documentation = https://flopy.readthedocs.io | ||
Release Notes = https://github.com/modflowpy/flopy/blob/develop/docs/version_changes.md | ||
Bug Tracker = https://github.com/modflowpy/flopy/issues | ||
Source Code = https://github.com/modflowpy/flopy | ||
|
||
[options] | ||
include_package_data = True # includes files listed in MANIFEST.in | ||
zip_safe = False | ||
packages = find: | ||
python_requires = >=3.7 | ||
install_requires = | ||
numpy >= 1.15.0 | ||
matplotlib >= 1.4.0 | ||
|
||
[options.package_data] | ||
flopy.export = longnames.json, unitsformat.json | ||
flopy.mf6.data = dfn/*.dfn | ||
flopy.plot = mplstyle/*.mplstyle | ||
|
||
[sdist] | ||
formats = zip | ||
|
||
[flake8] | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
examples, | ||
autotest | ||
ignore = | ||
# https://flake8.pycqa.org/en/latest/user/error-codes.html | ||
F401, # 'module' imported but unused | ||
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes | ||
E121, # continuation line under-indented for hanging indent | ||
E122, # continuation line missing indentation or outdented | ||
E126, # continuation line over-indented for hanging indent | ||
E127, # continuation line over-indented for visual indent | ||
E128, # continuation line under-indented for visual indent | ||
E203, # whitespace before | ||
E221, # multiple spaces before operator | ||
E222, # multiple spaces after operator | ||
E226, # missing whitespace around arithmetic operator | ||
E231, # missing whitespace after ',' | ||
E241, # multiple spaces after ',' | ||
E402, # module level import not at top of file | ||
E501, # line too long (> 79 characters) | ||
E502, # backslash is redundant between brackets | ||
E722, # do not use bare 'except' | ||
E741, # ambiguous variable name | ||
W291, # trailing whitespace | ||
W292, # no newline at end of file | ||
W293, # blank line contains whitespace | ||
W391, # blank line at end of file | ||
W503, # line break before binary operator | ||
W504 # line break after binary operator | ||
statistics = True |
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,58 +1,4 @@ | ||
import os | ||
import sys | ||
from setuptools import setup | ||
|
||
# ensure minimum version of Python is running | ||
if sys.version_info[0:2] < (3, 7): | ||
raise RuntimeError("Flopy requires Python >= 3.7") | ||
|
||
# local import of package variables in flopy/version.py | ||
# imports __version__, __pakname__, __author__, __author_email__ | ||
exec(open(os.path.join("flopy", "version.py")).read()) | ||
|
||
try: | ||
import pypandoc | ||
|
||
fpth = os.path.join("docs", "PyPi_release.md") | ||
long_description = pypandoc.convert(fpth, "rst") | ||
except ImportError: | ||
long_description = "" | ||
|
||
setup( | ||
name=__pakname__, | ||
description="FloPy is a Python package to create, run, and " | ||
+ "post-process MODFLOW-based models.", | ||
long_description=long_description, | ||
author=__author__, | ||
author_email=__author_email__, | ||
url="https://github.com/modflowpy/flopy/", | ||
license="CC0", | ||
platforms="Windows, Mac OS-X, Linux", | ||
install_requires=[ | ||
"numpy>=1.15.0", | ||
"matplotlib>=1.4.0", | ||
], | ||
packages=[ | ||
"flopy", | ||
"flopy.modflow", | ||
"flopy.modflowlgr", | ||
"flopy.mfusg", | ||
"flopy.modpath", | ||
"flopy.mt3d", | ||
"flopy.seawat", | ||
"flopy.utils", | ||
"flopy.plot", | ||
"flopy.pest", | ||
"flopy.export", | ||
"flopy.discretization", | ||
"flopy.mf6", | ||
"flopy.mf6.coordinates", | ||
"flopy.mf6.data", | ||
"flopy.mf6.modflow", | ||
"flopy.mf6.utils", | ||
], | ||
include_package_data=True, # includes files listed in MANIFEST.in | ||
# use this version ID if .svn data cannot be found | ||
version=__version__, | ||
classifiers=["Topic :: Scientific/Engineering :: Hydrology"], | ||
) | ||
setup() |