From 50ea8d423196ca2fde34287e959b73bc01ab82f0 Mon Sep 17 00:00:00 2001
From: Christoph Alt <christoph.alt@fau.de>
Date: Thu, 14 Sep 2023 17:35:52 +0200
Subject: [PATCH] reworked the build system by using pyproject.toml tox and
 Manifest.in

---
 .gitignore     |  1 +
 .gitlab-ci.yml |  2 +-
 MANIFEST.in    |  1 +
 pyproject.toml | 35 +++++++++++++++++++++++++++++++++++
 tox.ini        |  6 ++++++
 5 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 MANIFEST.in
 create mode 100644 pyproject.toml
 create mode 100644 tox.ini

diff --git a/.gitignore b/.gitignore
index 4d16694..4b53561 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ __pycache__/
 *.pyc
 *.egg-info/
 .env
+.tox
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b3ae2b..0a273d7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,7 +9,7 @@ test:
       - docker
    image: python:3.8
    script:
-      - pip install --user pytest
+      - pip install --user tox
       - pip install --user .
       - python -m pytest
 
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..ad7985f
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include plotting/roofline_data.json
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..3f1c32f
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,35 @@
+[project]
+name="cb-util"
+version="0.1"
+description="Collection of scripts and wrapper of contious benchmarking"
+readme = "README.md"
+requires-python = ">=3.8"
+authors = [
+    { name = "Christoph Alt", email="christoph.alt@fau.de" }
+]
+license = { file = "LICENSE" }
+
+dependencies = [
+    "python-dotenv",
+    "influxdb",
+    "gitpython",
+    "requests",
+    "kadi-apy",
+    "importlib_resources ; python_version<'3.7'",
+]
+
+[project.optional-dependencies]
+plotting = [
+    "plotly",
+    "kaleido",
+]
+dashboard = [
+    "grafanalib",
+]
+test = ["pytest"]
+
+[project.scripts]
+get_frequency = "cbutil.cpu_frequency:main"
+
+[tools.setuptools]
+packages = ["cbutil", "cbutil.postprocessing", "dashboards", "plotting"]
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..1ff1af0
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,6 @@
+[tox]
+envlist = py38
+
+[testenv]
+extras = dashboard, plotting, test
+commands = pytest --junitxml=report.xml
-- 
GitLab