add stub test, add pyproject.toml, add basic structure

This commit is contained in:
2026-05-11 23:57:27 +03:00
parent eae3533d55
commit d631b0ef68
9 changed files with 87 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# nexus-sync
a utility that allows you to manage your computers.
*Main Idea*
server can send to every client "what to do". Centralized control for all clients.
## Server-side
- (to future) works in docker container
- accept connections on _some_ port with correct uuid from client
- works via API requests
- use _some_ database
## Client-side
- with _some_ period of time, send info to the server
- if server want client to execute some command
- decrease fetch time period
- execute command
- send result back to the server
+28
View File
@@ -0,0 +1,28 @@
[build-system]
requires = ["setuptools>=75.0"]
build-backend = "setuptools.build_meta"
[project]
name = "nexus_sync"
version = "0.1.0"
description = "A utility that allows you to manage your computers from a centralized server."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
dependencies = []
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"black>=24.0",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.black]
line-length = 100
target-version = ["py311"]
[tool.pytest.ini_options]
testpaths = ["tests"]
+25
View File
@@ -0,0 +1,25 @@
import shlex
import subprocess
from typing import Dict, Optional
def run(command: str, stdin: Optional[str] = None) -> Dict[str, str]:
process = _execute(command, stdin)
return {
"stdout": process.stdout,
"stderr": process.stderr,
}
def _parse_command(command: str) -> list[str]:
# return command.split()
return shlex.split(command)
def _execute(command: str, stdin: Optional[str] = None) -> subprocess.CompletedProcess:
parsed_command = _parse_command(command)
result = subprocess.run(
parsed_command, input=stdin, text=True, capture_output=True, shell=True
)
return result
+6
View File
@@ -0,0 +1,6 @@
def main() -> None:
print("nexus-sync server")
if __name__ == "__main__":
main()
+7
View File
@@ -0,0 +1,7 @@
"""
foobuzz test
"""
def test_foo():
pass