Repository: pkeilbach/pylsci (language: python)

Issue:
Move from setup.py to pyproject.toml 
according to [PEP 621](https://peps.python.org/pep-0621/)

Useful links:

http://ivory.idyll.org/blog/2021-transition-to-pyproject.toml-example.html

https://www.google.com/search?channel=fs&client=ubuntu&q=pyproject+toml+vs+setup.py

https://packaging.python.org/en/latest/tutorials/

https://stackoverflow.com/questions/62983756/what-is-pyproject-toml-file-for

https://ianhopkinson.org.uk/2022/02/understanding-setup-py-setup-cfg-and-pyproject-toml-in-python/

https://realpython.com/python-toml/

https://realpython.com/pypi-publish-python-package/


Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index 268bfcc..feab76e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,16 @@
-pre_commit: requirements
+# twine upload dist/*
+# twine upload --repository testpypi dist/*
+
+build: pre_commit
+	rm -rf dist/
+	python3.9 -m build
+
+pre_commit: pyproject
 	.venv/bin/pre-commit install
 	.venv/bin/pre-commit autoupdate
 
-requirements: .venv
-	.venv/bin/pip install -r requirements.txt
+pyproject: .venv
+	.venv/bin/pip install --upgrade pylsci[dev]
 
 .venv:
 	python3.9 -m venv --upgrade-deps .venv
diff --git a/build.sh b/build.sh
deleted file mode 100755
index bdacf01..0000000
--- a/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-rm -rf build/ dist/ py_redis.egg-info/
-python setup.py sdist bdist_wheel
-twine upload dist/*
-
-# twine upload --repository testpypi dist/*
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..c75ea1d
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,37 @@
+[build-system]
+requires      = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "pylsci"
+version = "1.1.0"
+description = "Python Package for Laser Speckle Contrast Imaging"
+readme = "README.md"
+authors = [{ name = "Pascal Keilbach", email = "dev@pk17.org" }]
+license = { file = "LICENSE" }
+classifiers = [
+    "License :: OSI Approved :: MIT License",
+    "Programming Language :: Python :: 3",
+    "Operating System :: OS Independent",
+]
+keywords = ["pylsci", "numpy", "laser", "speckle", "contrast", "imaging"]
+dependencies = [
+    "numpy~=1.23.1",
+]
+requires-python = ">=3.6"
+
+[project.optional-dependencies]
+dev = [
+    "black~=22.6.0",
+    "build~=0.8.0",
+    "jupyter~=1.0.0",
+    "matplotlib~=3.5.2",
+    "pre-commit~=2.20.0",
+    "twine~=4.0.1",
+    "wheel~=0.37.1",
+]
+
+[project.urls]
+"Homepage" = "https://github.com/pkeilbach/pylsci"
+"Bug Tracker" = "https://github.com/pkeilbach/pylsci/issues"
+"Example Notebook" = "https://mybinder.org/v2/gh/pkeilbach/pylsci/HEAD?labpath=binder%2Fdemo.ipynb"
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index e75a692..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# requirements for package development
-
-black~=22.6.0
-jupyter~=1.0.0
-matplotlib~=3.5.2
-numpy~=1.23.1
-pre-commit~=2.20.0
-twine~=4.0.1
-wheel~=0.37.1
diff --git a/setup.py b/setup.py
index 7d696a5..d99c188 100644
--- a/setup.py
+++ b/setup.py
@@ -1,26 +1,9 @@
-import setuptools
+"""
+this is only for editable installs
 
+https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#
+"""
 
-with open("README.md", "r", encoding="utf-8") as f:
-    long_description = f.read()
+from setuptools import setup
 
-
-setuptools.setup(
-    name="pylsci",
-    version="1.0.4",
-    author="Pascal Keilbach",
-    author_email="dev@pk17.org",
-    description="Python Package for Laser Speckle Contrast Imaging",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    url="https://github.com/pkeilbach/pylsci",
-    packages=["pylsci"],
-    package_dir={"": "src"},
-    install_requires=["numpy"],
-    classifiers=[
-        "Programming Language :: Python :: 3",
-        "License :: OSI Approved :: MIT License",
-        "Operating System :: OS Independent",
-    ],
-    python_requires=">=3.6",
-)
+setup()


Test patch:
diff --git a/test.py b/tests/test.py
similarity index 100%
rename from test.py
rename to tests/test.py