From cf66c186d615a72aeb978746301579979a095bbe Mon Sep 17 00:00:00 2001 From: Giacomo Galloni Date: Wed, 3 Jun 2026 16:19:03 +0200 Subject: [PATCH 1/3] Trim deps to runtime only + optional --- pyproject.toml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b045155..6f72eb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "cosmpower" +name = "cosmopower" version = "0.2.0" description = "Machine Learning - accelerated Bayesian inference" readme = "README.md" @@ -22,17 +22,26 @@ dependencies = [ "astropy>=3.2", "scikit-learn", "tqdm", - "gdown", - "jupyter", - "mkdocs-material", - "mkdocstrings", "matplotlib", - "pytest", "pyDOE", "h5py", "tensorflow>=2.18", "tensorflow_probability>=0.24", - "tf-keras" + "tf-keras", +] + +[project.optional-dependencies] +docs = [ + "mkdocs-material", + "mkdocstrings", + "pytkdocs[numpy-style]", +] +examples = [ + "jupyter", + "gdown", +] +dev = [ + "pytest", ] [project.urls] From 1cbea1fe4accecb103c23f325036ab8f6506abeb Mon Sep 17 00:00:00 2001 From: Giacomo Galloni Date: Wed, 3 Jun 2026 16:19:17 +0200 Subject: [PATCH 2/3] Avoid extra files --- pyproject.toml | 10 +++++++++- pytest.ini | 7 ------- requirements.txt | 13 ------------- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 pytest.ini delete mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 6f72eb2..94a9929 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools>=64", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -50,3 +50,11 @@ homepage = "https://alessiospuriomancini.github.io/cosmopower/" [tool.setuptools.packages.find] where = ["."] +[tool.pytest.ini_options] +filterwarnings = [ + "error", + "ignore::UserWarning", + "ignore::DeprecationWarning", +] +testpaths = ["cosmopower/tests"] + diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index d6c4dd2..0000000 --- a/pytest.ini +++ /dev/null @@ -1,7 +0,0 @@ -[pytest] -filterwarnings = - error - ignore::UserWarning - ignore::DeprecationWarning -testpaths = - cosmopower/tests diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 25b09ba..0000000 --- a/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -scikit-learn -tqdm -gdown -jupyter -mkdocs-material -mkdocstrings -matplotlib -pytest -pyDOE -h5py -tensorflow>=2.18 -tensorflow_probability>=0.24 -tf-keras \ No newline at end of file From ced3bb8a9af5d05e7410f86ec202264b205af188 Mon Sep 17 00:00:00 2001 From: Giacomo Galloni Date: Wed, 3 Jun 2026 16:22:59 +0200 Subject: [PATCH 3/3] Update readmes and pip invokations --- .github/workflows/ci.yml | 7 +------ README.md | 3 ++- docs/installation.md | 3 ++- setup.py | 3 --- 4 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d16f1ed..43f1ae1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,5 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . - pip install mkdocs-material - pip install mkdocstrings - pip install markdown-include - pip install -q 'setupext-janitor' # - pip install pytkdocs[numpy-style] + pip install .[dev,docs] pytest diff --git a/README.md b/README.md index 84b8e35..c7eb1f6 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ Once inside the environment, you can install ``CosmoPower``: cd cosmopower pip install . - To test the installation, you can use + To run the test suite, install the development extras and use ``pytest``: + pip install .[dev] pytest diff --git a/docs/installation.md b/docs/installation.md index 9f5bec6..6815ccc 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -23,6 +23,7 @@ Once inside the environment, you can install ``CosmoPower``: cd cosmopower pip install . - To test the installation, you can use + To run the test suite, install the development extras and use ``pytest``: + pip install .[dev] pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index fc1f76c..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() \ No newline at end of file