From 9f9b59fee02389494c7596cfce218947dc727a53 Mon Sep 17 00:00:00 2001 From: Caroline Malin-Mayor Date: Tue, 13 Feb 2024 21:17:34 -0500 Subject: [PATCH] Add pyproject.toml --- pyproject.toml | 157 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..ae31e029d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,157 @@ +# https://peps.python.org/pep-0517/ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +# https://peps.python.org/pep-0621/ +[project] +name = "dacapo-ml" +description = "Framework for easy composition of volumetric machine learning jobs." +readme = "README.md" +requires-python = ">=3.8" +# license = { text = "BSD 3-Clause License" } +authors = [ + { email = "rhoadesj@hhmi.org", name = "Jeff Rhoades" }, + { email = "pattonw@janelia.hhmi.org", name = "Will Patton" }, + { email = "zouinkhim@hhmi.org", name = "Marwan Zouinkhi" }, + { email = "funkej@janelia.hhmi.org", name = "Jan Funke" }, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Typing :: Typed", +] +dynamic = ["version"] +dependencies = [ + "numpy==1.22.3", + "pyyaml", + "zarr", + "cattrs", + "pymongo", + "tqdm", + "simpleitk", + "lazy-property", + "neuroglancer", + "torch", + "fibsem_tools", + "attrs", + "bokeh", + "numpy-indexed>=0.3.7", + "daisy>=1.0", + "funlib.math>=0.1", + "funlib.geometry>=0.2", + "mwatershed>=0.1", + "funlib.persistence @ git+https://github.com/janelia-cellmap/funlib.persistence", + "funlib.evaluate @ git+https://github.com/pattonw/funlib.evaluate", + "gunpowder>=1.3", + # "lsds>=0.1.3", + "lsds @ git+https://github.com/funkelab/lsd", + "xarray", + "cattrs", + "numpy-indexed", + "click",] + +# extras +# https://peps.python.org/pep-0621/#dependencies-optional-dependencies +[project.optional-dependencies] +test = ["pytest==7.4.4", "pytest-cov", "pytest-lazy-fixture"] +dev = [ + "black", + "ipython", + "mypy", + "pdbpp", + "pre-commit", + "pytest-cov", + "pytest", + "rich", + "ruff", +] + +[project.urls] +homepage = "https://github.com/janelia-cellmap/dacapo" +repository = "https://github.com/janelia-cellmap/dacapo" + +# https://hatch.pypa.io/latest/config/metadata/ +[tool.hatch.version] +source = "vcs" + +# https://hatch.pypa.io/latest/config/build/#file-selection +# [tool.hatch.build.targets.sdist] +# include = ["/src", "/tests"] +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +only-include = ["dacapo"] +sources = ["dacapo"] + +# https://github.com/charliermarsh/ruff +[tool.ruff] +line-length = 88 +target-version = "py38" +src = ["dacapo"] +# https://beta.ruff.rs/docs/rules/ +select = [ + "E", # style errors + "W", # style warnings + "F", # flakes + "D", # pydocstyle + "I", # isort + "UP", # pyupgrade + "C4", # flake8-comprehensions + "B", # flake8-bugbear + "A001", # flake8-builtins + "RUF", # ruff-specific rules +] + +[tool.ruff.per-file-ignores] +"tests/*.py" = ["D", "S"] + +# https://docs.pytest.org/en/6.2.x/customize.html +[tool.pytest.ini_options] +minversion = "6.0" +testpaths = ["tests"] +filterwarnings = ["error"] + +# https://mypy.readthedocs.io/en/stable/config_file.html +[tool.mypy] +files = "dacapo/**/" +strict = true +disallow_any_generics = false +disallow_subclassing_any = false +show_error_codes = true +pretty = true + +# # module specific overrides +# [[tool.mypy.overrides]] +# module = ["numpy.*",] +# ignore_errors = true + + +# https://coverage.readthedocs.io/en/6.4/config.html +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "@overload", + "except ImportError", + "\\.\\.\\.", + "raise NotImplementedError()", +] +[tool.coverage.run] +source = ["dacapo"] + +# https://github.com/mgedmin/check-manifest#configuration +[tool.check-manifest] +ignore = [ + ".github_changelog_generator", + ".pre-commit-config.yaml", + ".ruff_cache/**/*", + "tests/**/*", +]