Repository: AppDaemon/appdaemon

Issue:
Improve packaging system
The `requirements.txt` file is used in a bit confusing way. It it usual practice for this file to contain all the dependencies present in the project virtualenv, created using `pip freeze > requirements.txt`, so that the virtualenv can be easily re-created by any developer locally using `pip install -r requirements.txt.`
But this file is also used as the `install_requires` inside `setup.py`, creating a bit of a conflict.
If one installs the appdaemon locally with `pip install .`, then run `pip freeze > requirements.txt`, the `requirements.txt` file is modified, since all the transitive dependencies are also loaded, as is expected. So the question is: shouldn't the declaration of the project dependencies be moved in a more appropriate place, separate from `requirements.txt`?

## Proposed solution
I propose to more crealry declare the project dependencies, by upgrading the way we use the Python packaging system.
At the moment the package is created from the `setup.py`, read by `setuptools` when building the package.
The way to package applications has changed a lot over the years. Nowadays if one were to follow the official [Python packaging guide](https://packaging.python.org/en/latest/tutorials/packaging-projects/), the recommended setup is to use a `pyproject.toml` to describe all the metadata of the project, including the build tool and the project dependencies.
I suggest we move from the current `setup.py` to a more modern and "standard" solution, by migrating to a `pyproject.toml` file to contain all the project dependencies.



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
deleted file mode 100755
--- a/setup.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from setuptools import setup, find_packages
-
-from appdaemon.version import __version__
-
-# sudo apt-get install python3-aiohttp-dbg
-
-with open("requirements.txt") as f:
-    install_requires = [x for x in f.read().split("\n") if x]
-
-with open("README.md") as f:
-    long_description = f.read()
-
-setup(
-    name="appdaemon",
-    version=__version__,
-    description="Apps for the Home Assistant home automation package.",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    author="Andrew I Cockburn",
-    author_email="appdaemon@acockburn.com",
-    url="https://github.com/home-assistant/appdaemon.git",
-    packages=find_packages(exclude=["contrib", "docs", "tests*"]),
-    include_package_data=True,
-    install_requires=install_requires,
-    license="Apache License 2.0",
-    python_requires=">=3.7",
-    zip_safe=False,
-    keywords=["appdaemon", "home", "automation"],
-    entry_points={"console_scripts": ["appdaemon = appdaemon.__main__:main"]},
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "Intended Audience :: Developers",
-        "License :: OSI Approved :: Apache Software License",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3.7",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Topic :: Home Automation",
-    ],
-)


Test patch: