From b677c00da247b35d615e7149133009c77db387c7 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Wed, 7 Sep 2022 10:10:59 +0200
Subject: [PATCH] Start build system transitioning

---
 .gitignore     |  3 ++-
 .gitlab-ci.yml |  4 ----
 pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++
 setup.py       | 25 -------------------------
 4 files changed, 47 insertions(+), 30 deletions(-)
 create mode 100644 pyproject.toml

diff --git a/.gitignore b/.gitignore
index eeb09a4f..7d2fcdc4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,4 +113,5 @@ _b_asic_debug_log.txt
 *.pyproject
 ui_*.py
 TODO.txt
-*.log
\ No newline at end of file
+*.log
+b_asic/_version.py
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ebfd7754..fa868840 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,10 +22,6 @@ before_script:
           coverage_format: cobertura
           path: cov.xml
 
-run-test-3.6:
-  image: python:3.6
-  extends: ".run-test"
-
 run-test-3.7:
   image: python:3.7
   extends: ".run-test"
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..286a49d0
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,45 @@
+[project]
+name = "b-asic"
+description = "Better ASIC Toolbox"
+readme = "README.md"
+maintainers = [
+    { name = "Oscar Gustafsson", email = "oscar.gustafsson@gmail.com" },
+]
+license = { file = "LICENSE" }
+requires-python = ">=3.7"
+dependencies = [
+    "numpy",
+    "pybind11>=2.3.0",
+    "pyside2",
+    "qtpy",
+    "graphviz<=0.17",
+    "matplotlib",
+    "scipy",
+]
+classifiers = [
+    "Intended Audience :: Science/Research",
+    "Programming Language :: Python :: 3",
+    "License :: OSI Approved :: MIT License",
+    "Operating System :: OS Independent",
+]
+dynamic = ["version", "authors"]
+
+[tool.setuptools]
+zip-safe = false
+
+[tool.setuptools.packages.find]
+include = ["b_asic*"]
+
+[build-system]
+requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools_scm]
+write_to = "b_asic/_version.py"
+version_scheme = "release-branch-semver"
+local_scheme = "node-and-date"
+fallback_version = "0.0+UNKNOWN"
+
+[project.urls]
+homepage = "https://gitlab.liu.se/da/B-ASIC"
+documenation = "https://da.gitlab-pages.liu.se/B-ASIC/"
diff --git a/setup.py b/setup.py
index ff3ba72b..9bd76330 100644
--- a/setup.py
+++ b/setup.py
@@ -63,8 +63,6 @@ class CMakeBuild(build_ext):
 
 
 setuptools.setup(
-    name="b-asic",
-    version="1.0.1-beta",
     author="Adam Jakobsson, Angus Lothian, Arvid Westerlund, Felix Goding, "
         "Ivar Härnqvist, Jacob Wahlman, Kevin Scott, Rasmus Karlsson, "
         "Oscar Gustafsson, Andreas Bolin",
@@ -73,29 +71,6 @@ setuptools.setup(
         "ivaha717@student.liu.se, jacwa448@student.liu.se, "
         "kevsc634@student.liu.se, raska119@student.liu.se, "
         "oscar.gustafsson@liu.se, andbo467@student.liu.se",
-    description="Better ASIC Toolbox",
-    long_description=open("README.md", "r").read(),
-    long_description_content_type="text/markdown",
-    url="https://gitlab.liu.se/da/B-ASIC",
-    license="MIT",
-    classifiers=[
-        "Programming Language :: Python :: 3",
-        "License :: OSI Approved :: MIT License",
-        "Operating System :: OS Independent",
-    ],
-    python_requires=">=3.6",
-    install_requires=[
-        "numpy",
-        "pybind11>=2.3.0",
-        "pyside2",
-        "qtpy",
-        "graphviz<=0.17",
-        "matplotlib",
-        "scipy"
-    ],
-    packages=["b_asic", "b_asic/GUI", "b_asic/scheduler_gui"],
     ext_modules=[CMakeExtension("_b_asic")],
     cmdclass={"build_ext": CMakeBuild},
-    zip_safe=False,
-    include_package_data=True
 )
-- 
GitLab