diff --git a/.gitignore b/.gitignore index 7b77f4a..f07d212 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ venv/ ENV/ env.bak/ venv.bak/ +.hatch # Test/config quick.py diff --git a/obsws_python/__init__.py b/obsws_python/__init__.py index d54af06..49b9f1a 100644 --- a/obsws_python/__init__.py +++ b/obsws_python/__init__.py @@ -1,3 +1,4 @@ +from .version import version as __version__ from .enum import Subs from .events import EventClient from .reqs import ReqClient diff --git a/obsws_python/version.py b/obsws_python/version.py new file mode 100644 index 0000000..1350d4e --- /dev/null +++ b/obsws_python/version.py @@ -0,0 +1 @@ +version = "1.2.0" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..812c68a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "obsws-python" +dynamic = ["version"] +description = "A Python SDK for OBS Studio WebSocket v5.0" +readme = "README.md" +license = "GPL-3.0-only" +requires-python = ">=3.10" +authors = [ + { name = "Adem Atikturk", email = "aatikturk@gmail.com" }, +] +dependencies = [ + "tomli >= 2.0.1;python_version < '3.11'", + "websocket-client", +] + +[project.optional-dependencies] +dev = [ + "black", + "isort", + "pytest", + "pytest-randomly", +] + +[project.urls] +Homepage = "https://github.com/aatikturk/obsws-python" + +[tool.hatch.version] +path = "obsws_python/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/obsws_python", +] + +[tool.hatch.envs.e.scripts] +events = "py {root}\\examples\\events\\." +hotkeys = "py {root}\\examples\\hotkeys\\." +levels = "py {root}\\examples\\levels\\." +scene_rotate = "py {root}\\examples\\scene_rotate\\." diff --git a/setup.py b/setup.py index 48cd041..4b369e1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,16 @@ from setuptools import find_packages, setup HERE = pathlib.Path(__file__).parent -VERSION = "1.2.0" +def get_version(): + versionpath = pathlib.Path(HERE) / "obsws_python" / "version.py" + with open(versionpath) as f: + for line in f: + if line.startswith("version"): + versionstring = line.split('"')[1] + return versionstring + + +VERSION = get_version() PACKAGE_NAME = "obsws-python" AUTHOR = "Adem Atikturk" AUTHOR_EMAIL = "aatikturk@gmail.com"