From 0285ae3daaf1f5ec57d2835d10609015a55991ee Mon Sep 17 00:00:00 2001
From: Rob Moss <robm.dev@gmail.com>
Date: Mon, 25 Oct 2021 09:55:56 +1100
Subject: [PATCH] Replace setup.py with pyproject.toml

---
 .gitlab-ci.yml   | 2 +-
 .readthedocs.yml | 2 +-
 pyproject.toml   | 8 ++++++++
 setup.cfg        | 2 --
 setup.py         | 7 -------
 tox.ini          | 1 +
 6 files changed, 11 insertions(+), 11 deletions(-)
 create mode 100644 pyproject.toml
 delete mode 100755 setup.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8c41b44..d83445e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,7 +20,7 @@ tox-36:
     - tox
   artifacts:
     paths:
-      - .tox/dist/pypfilt-*.zip
+      - .tox/dist/pypfilt-*
 
 # Run all of the test activities in tox.ini using Python 3.7.
 tox-37:
diff --git a/.readthedocs.yml b/.readthedocs.yml
index b9b6e25..631de94 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -8,7 +8,7 @@ python:
   install:
     - requirements: requirements.txt
     - requirements: requirements-rtd.txt
-    - method: setuptools
+    - method: pip
       path: .
 
 sphinx:
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..4d37fca
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,8 @@
+# NOTE: setuptools 40.9.0 added support for projects without setup.py.
+
+[build-system]
+requires = [
+    "setuptools >= 40.9",
+    "wheel",
+]
+build-backend = "setuptools.build_meta"
diff --git a/setup.cfg b/setup.cfg
index 7e00eff..ad949bb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -33,8 +33,6 @@ install_requires =
     numpy >= 1.17
     scipy >= 0.11
     toml >= 0.10
-setup_requires =
-    setuptools >= 38.3.0
 
 [options.extras_require]
 plot = matplotlib >= 1.5
diff --git a/setup.py b/setup.py
deleted file mode 100755
index a8c6529..0000000
--- a/setup.py
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env python3
-
-from setuptools import setup
-
-
-if __name__ == "__main__":
-    setup()
diff --git a/tox.ini b/tox.ini
index a0a9ecb..f255e77 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,6 +14,7 @@
 #
 [tox]
 envlist = test,docs
+isolated_build = True
 
 [base]
 pkg = pypfilt
-- 
GitLab