From a653781dd5fb70d52760df508ddd137af182803d Mon Sep 17 00:00:00 2001 From: Cunliang Geng Date: Mon, 25 Mar 2024 17:11:08 +0100 Subject: [PATCH] move dependencies to pyproject.toml file Major changes - move dependencies to pyproject.toml file - remove files `requirements.txt` and `requirements.dev.txt` --- pyproject.toml | 74 ++++++++++++++++++++++++++++++++------------ requirements.dev.txt | 23 -------------- requirements.txt | 12 ------- setup.py | 1 - 4 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 requirements.dev.txt delete mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml index acf50b91..a4ff4d48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,7 @@ -# We use setup.cfg to set project metadata and setuptools configs. -# All the other configs (e.g. pytest, coverage) are set in this file. # see https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] @@ -26,42 +24,80 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "beautifulsoup4", + "biopython", + "deprecated", + "dynaconf", + "httpx", + "jsonschema", + "numpy", + "pandas", + "pyteomics", + "scipy", + "sortedcontainers", + "tqdm", ] -dynamic = ["dependencies", "optional-dependencies"] -[tool.setuptools.dynamic] -dependencies = { file = ["requirements.txt"] } -optional-dependencies.dev = { file = ["requirements.dev.txt"] } +[project.optional-dependencies] +dev = [ + # packaging + "build", + "bump2version", + "wheel", + # formatting and linting + "ruff", + # testing + "pytest", + "pytest-cov", + "pytest-xdist", + "coverage[toml]", + # static typing + "mypy", + "types-toml", + "types-Deprecated", + "typing_extensions", + # docs + "mkdocs", + "mkdocs-material", + "mkdocs-exclude", + "mkdocs-redirects", + "mkdocstrings-python", + "mike", +] [project.urls] -"Homepage" = "https://github.com/NPLinker/nplinker" -"Bug Tracker" = "https://github.com/NPLinker/nplinker/issues" +"Documentation" = "https://nplinker.github.io/nplinker" +"Repository" = "https://github.com/NPLinker/nplinker" +"Issues" = "https://github.com/NPLinker/nplinker/issues" [tool.setuptools.packages.find] -where = ["src"] -namespaces = true # enable data directory to be identified +where = ["src"] +namespaces = true # enable data directory to be identified [tool.setuptools.package-data] -"nplinker.data" = ["*"] +"nplinker.data" = ["*"] "nplinker.schemas" = ["*"] "nplinker" = ["nplinker_default.toml"] [tool.pytest.ini_options] minversion = "6.0" -addopts = "-ra -n auto" # -ra: show summary info for all test outcomes; -n auto: run tests in parallel -testpaths = ["tests/unit"] +addopts = "-ra -n auto" # -ra: show summary info for all test outcomes; -n auto: run tests in parallel +testpaths = ["tests/unit"] [tool.coverage.run] -branch = true -source = ["src"] +branch = true +source = ["src"] command_line = "-m pytest" # Mypy: to check static type # see https://mypy.readthedocs.io/en/stable/config_file.html#example-pyproject-toml [tool.mypy] -python_version = "3.10" -warn_return_any = true -warn_unused_configs = true +python_version = "3.10" +warn_return_any = true +warn_unused_configs = true ignore_missing_imports = true [tool.ruff] diff --git a/requirements.dev.txt b/requirements.dev.txt deleted file mode 100644 index 68b381fd..00000000 --- a/requirements.dev.txt +++ /dev/null @@ -1,23 +0,0 @@ -# packaging -build -bump2version -wheel -# formatting and linting -ruff -# testing -pytest -pytest-cov -pytest-xdist -coverage[toml] -# static typing -mypy -types-toml -types-Deprecated -typing_extensions -# docs -mkdocs -mkdocs-material -mkdocs-exclude -mkdocs-redirects -mkdocstrings-python -mike diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1d4e512f..00000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -beautifulsoup4 -biopython -deprecated -dynaconf -httpx -jsonschema -numpy -pandas -pyteomics -scipy -sortedcontainers -tqdm diff --git a/setup.py b/setup.py index 81a328bd..d00a42cc 100644 --- a/setup.py +++ b/setup.py @@ -6,5 +6,4 @@ if sys.version_info[:2] < (3, 9): raise RuntimeError("Python version >= 3.9 required.") -# see setup.cfg setup(scripts=["bin/install-nplinker-deps"])