From 1122a7308a7cb0c9321d3fe2b8badc7552c38d94 Mon Sep 17 00:00:00 2001
From: Andre Mayoraz <andre.mayoraz@idiap.ch>
Date: Mon, 13 Feb 2023 15:51:00 +0100
Subject: [PATCH] [ci] changed ci process to new configuration

---
 .gitlab-ci.yml   |  5 ++-
 pyproject.toml   | 97 +++++++++++++++++++++++++++++++++++++++++++++++-
 requirements.txt |  8 ----
 setup.py         | 57 +---------------------------
 version.txt      |  1 -
 5 files changed, 102 insertions(+), 66 deletions(-)
 delete mode 100644 requirements.txt
 delete mode 100644 version.txt

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 845b719..9a47970 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1 +1,4 @@
-include: 'https://gitlab.idiap.ch/bob/bob.devtools/raw/master/bob/devtools/data/gitlab-ci/single-package.yaml'
+include:
+  - project: bob/dev-profile
+    ref: main
+    file: gitlab/python.yml
diff --git a/pyproject.toml b/pyproject.toml
index b738dc8..8485c20 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,90 @@
 [build-system]
-    requires = ["setuptools", "wheel", "bob.extension"]
+    requires = ["setuptools>=61.0.0", "wheel"]
     build-backend = "setuptools.build_meta"
 
+[project]
+    name = "bob.fusion.base"
+    version = "0.1.5b0"
+    requires-python = ">=3.9"
+    description = "Score fusion in biometric and pad experiments"
+    dynamic = ["readme"]
+    license = {text = "GPLv3 License"}
+    authors = [
+    {name = "Amir Mohammadi", email = "amir.mohammadi@idiap.ch"},
+    ]
+    keywords = ["bob", "score fusion", "evaluation", "biometric"]
+
+    classifiers=[
+        "Framework :: Bob",
+        "Development Status :: 3 - Alpha",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
+        "Natural Language :: English",
+        "Programming Language :: Python",
+        "Topic :: Scientific/Engineering :: Artificial Intelligence",
+    ]
+    dependencies = [
+        "setuptools",
+        "numpy",
+        "bob.extension",
+        "bob.measure",
+        "bob.learn.em",
+        "bob.bio.base",
+        "scikit-learn",
+        "matplotlib",
+    ]
+
+[project.urls]
+    documentation = "https://www.idiap.ch/software/bob/docs/bob/bob.fusion.base/stable/"
+    homepage      = "https://pypi.org/project/bob.fusion.base/"
+    repository    = "https://gitlab.idiap.ch/bob/bob.fusion.base"
+    changelog     = "https://gitlab.idiap.ch/bob/bob.fusion.base/-/releases"
+
+[project.optional-dependencies]
+    qa = ["pre-commit"]
+    doc = [
+        "sphinx",
+        "sphinx_rtd_theme",
+        "sphinx-autodoc-typehints",
+        "auto-intersphinx",
+        "sphinxcontrib-programoutput",
+        ]
+    test = [
+        "pytest",
+        "pytest-cov",
+        "coverage",
+        ]
+
+[tool.setuptools]
+    zip-safe = false
+    package-dir = {"" = "src"}
+
+[tool.setuptools.dynamic]
+    readme = {file = "README.rst"}
+
+[project.entry-points."bob.cli"]
+    fusion = "bob.fusion.base.script.fusion:fusion"
+
+[project.entry-points."bob.fusion.cli"]
+    fuse     = "bob.fusion.base.script.fuse:fuse"
+    resource = "bob.fusion.base.script.resource:resource"
+    boundary = "bob.fusion.base.script.boundary:boundary"
+
+[project.entry-points."bob.fusion.algorithm"]
+    mean       = "bob.fusion.base.config.algorithm.mean:algorithm"
+    mean-tanh  = "bob.fusion.base.config.algorithm.mean:algorithm_tanh"
+    llr        = "bob.fusion.base.config.algorithm.llr_skl:algorithm"
+    llr-tanh   = "bob.fusion.base.config.algorithm.llr_skl:algorithm_tanh"
+    plr-2      = "bob.fusion.base.config.algorithm.plr_2:algorithm"
+    plr-2-tanh = "bob.fusion.base.config.algorithm.plr_2:algorithm_tanh"
+    plr-3      = "bob.fusion.base.config.algorithm.plr_3:algorithm"
+    plr-3-tanh = "bob.fusion.base.config.algorithm.plr_3:algorithm_tanh"
+    gmm        = "bob.fusion.base.config.algorithm.gmm:algorithm"
+    gmm-tanh   = "bob.fusion.base.config.algorithm.gmm:algorithm_tanh"
+
+[tool.distutils.bdist_wheel]
+    universal = true
+
 [tool.isort]
     profile = "black"
     line_length = 80
@@ -10,3 +93,15 @@
 
 [tool.black]
     line-length = 80
+
+[tool.coverage.run]
+    relative_files = true
+
+[tool.pytest.ini_options]
+    addopts = [
+        "--import-mode=append",
+        "--cov-report=term-missing",
+        "--cov=bob.fusion.base",
+    ]
+    junit_logging = "all"
+    junit_log_passing_tests = false
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index dca2c71..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-setuptools
-numpy
-bob.extension
-bob.measure
-bob.learn.em
-bob.bio.base
-scikit-learn # Used for classifiers and pre-processors.
-matplotlib   # for plotting
diff --git a/setup.py b/setup.py
index ffa14e5..3a3aaad 100644
--- a/setup.py
+++ b/setup.py
@@ -1,59 +1,6 @@
 #!/usr/bin/env python
 # vim: set fileencoding=utf-8 :
 
-from setuptools import dist, setup
+from setuptools import setup
 
-dist.Distribution(dict(setup_requires=["bob.extension"]))
-
-from bob.extension.utils import find_packages, load_requirements
-
-install_requires = load_requirements()
-
-setup(
-    name="bob.fusion.base",
-    version=open("version.txt").read().rstrip(),
-    description="Score fusion in biometric and pad experiments",
-    url="https://gitlab.idiap.ch/bob/bob.fusion.base",
-    license="GPLv3",
-    author="Amir Mohammadi",
-    author_email="amir.mohammadi@idiap.ch",
-    keywords="bob, score fusion, evaluation, biometric",
-    long_description=open("README.rst").read(),
-    packages=find_packages(),
-    include_package_data=True,
-    zip_safe=False,
-    install_requires=install_requires,
-    entry_points={
-        # main entry for bob fusion cli
-        "bob.cli": [
-            "fusion = bob.fusion.base.script.fusion:fusion",
-        ],
-        # bob fusion scripts
-        "bob.fusion.cli": [
-            "fuse = bob.fusion.base.script.fuse:fuse",
-            "resource = bob.fusion.base.script.resource:resource",
-            "boundary = bob.fusion.base.script.boundary:boundary",
-        ],
-        "bob.fusion.algorithm": [
-            "mean         = bob.fusion.base.config.algorithm.mean:algorithm",
-            "mean-tanh    = bob.fusion.base.config.algorithm.mean:algorithm_tanh",
-            "llr          = bob.fusion.base.config.algorithm.llr_skl:algorithm",
-            "llr-tanh     = bob.fusion.base.config.algorithm.llr_skl:algorithm_tanh",
-            "plr-2        = bob.fusion.base.config.algorithm.plr_2:algorithm",
-            "plr-2-tanh   = bob.fusion.base.config.algorithm.plr_2:algorithm_tanh",
-            "plr-3        = bob.fusion.base.config.algorithm.plr_3:algorithm",
-            "plr-3-tanh   = bob.fusion.base.config.algorithm.plr_3:algorithm_tanh",
-            "gmm          = bob.fusion.base.config.algorithm.gmm:algorithm",
-            "gmm-tanh     = bob.fusion.base.config.algorithm.gmm:algorithm_tanh",
-        ],
-    },
-    classifiers=[
-        "Framework :: Bob",
-        "Development Status :: 3 - Alpha",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
-        "Natural Language :: English",
-        "Programming Language :: Python",
-        "Topic :: Scientific/Engineering :: Artificial Intelligence",
-    ],
-)
+setup()
diff --git a/version.txt b/version.txt
deleted file mode 100644
index ccf6dfd..0000000
--- a/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.1.5b0
-- 
GitLab