diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 1ddcc2c8c..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include CITATION.cff -include pyproject.toml -include docs/*.md -include flopy/mf6/data/dfn/*.dfn -include flopy/plot/mplstyle/*.mplstyle diff --git a/pyproject.toml b/pyproject.toml index 639db8ecf..cc557a575 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,6 @@ [build-system] -requires = [ - "setuptools >=61", -] -build-backend = "setuptools.build_meta" +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" [project] name = "flopy" @@ -36,9 +34,8 @@ dependencies = [ dynamic = ["version", "readme"] [project.optional-dependencies] -dev = ["flopy[build,lint,test,optional,doc]", "tach"] -build = ["build", "twine"] -lint = ["cffconvert", "codespell[toml] >=2.2.2", "ruff"] +dev = ["flopy[lint,test,optional,doc]", "tach"] +lint = ["ruff"] test = [ "flopy[lint]", "coverage !=7.6.5", @@ -100,20 +97,28 @@ Documentation = "https://flopy.readthedocs.io" "Bug Tracker" = "https://github.com/modflowpy/flopy/issues" "Source Code" = "https://github.com/modflowpy/flopy" -[tool.setuptools] -include-package-data = true -zip-safe = false +[tool.hatch.build.targets.sdist] +only-include = [ + "CITATION.cff", + "README.md", + "docs", + "flopy", +] + +[tool.hatch.build.targets.wheel] +packages = ["flopy"] + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" -[tool.setuptools.dynamic] -version = {attr = "flopy.version.__version__"} -readme = {file = ["docs/PyPI_release.md", "LICENSE.md"], content-type = "text/markdown"} +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "docs/PyPI_release.md" -[tool.setuptools.packages.find] -include = ["flopy", "flopy.*"] +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "LICENSE.md" -[tool.setuptools.package-data] -"flopy.mf6.data" = ["dfn/*.dfn"] -"flopy.plot" = ["mplstyle/*.mplstyle"] +[tool.hatch.version] +path = "flopy/version.py" [tool.ruff] line-length = 88