From 427076bf1d9f7f047565e0859e570207f9c0a15c Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 25 Sep 2021 23:44:19 +0300
Subject: [PATCH] Local development using setuptools and pip.

Need to document it, but I'm sure about this whole setup yet.
---
 .envrc                  | 2 ++
 .pre-commit-config.yaml | 3 ---
 pyproject.toml          | 4 ++--
 setup.py                | 4 ++++
 4 files changed, 8 insertions(+), 5 deletions(-)
 create mode 100644 .envrc
 create mode 100644 setup.py

diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..5b35739
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,2 @@
+PYTHON_VERSION="$(python3 -c 'from sys import version_info as v; print(f"{v[0]}.{v[1]}")')"
+export PYTHONPATH="$PWD/__pypackages__/$PYTHON_VERSION:${PYTHONPATH:-}"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4c64421..069664e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -71,8 +71,6 @@ repos:
         args:
           - |-
             --max-line-length=79
-          - |-
-            --with-tool=pyroma
           - |-
             --with-tool=bandit
           - |-
@@ -89,7 +87,6 @@ repos:
             --no-autodetect
         additional_dependencies:
           - bandit
-          - pyroma
 
   - repo: https://gitlab.com/pycqa/flake8.git
     rev: 3.9.2
diff --git a/pyproject.toml b/pyproject.toml
index cf96161..26a9f29 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [build-system]
-requires = ["setuptools", "wheel"]
-build-backend = "setuptools:build_meta"
+requires = ["setuptools>=40.9.0", "wheel"]
+build-backend = "setuptools.build_meta"
 
 [project]
 name = "transmission_feeder"
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..1abbd06
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,4 @@
+import setuptools
+
+if __name__ == "__main__":
+    setuptools.setup()
-- 
GitLab