-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from setuptools setup.py to pyproject.toml, hatch and uv
- Loading branch information
Showing
19 changed files
with
943 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
*.egg-info/ | ||
.coverage | ||
.eggs/ | ||
.venv/ | ||
.coverage* | ||
__pycache__/ | ||
build/ | ||
dist/ | ||
coverage.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from aiohttp import web | ||
from autodesk.api import setup_app | ||
from autodesk.application.autodeskservicefactory import AutoDeskServiceFactory | ||
from autodesk.hardware import create_pin_factory | ||
from contextlib import closing | ||
from pandas import Timedelta | ||
import logging | ||
import os | ||
import yaml | ||
|
||
|
||
def main(): | ||
logging.basicConfig( | ||
level=logging.INFO, format="%(asctime)s %(name)s %(levelname)s %(message)s" | ||
) | ||
|
||
logger = logging.getLogger("program") | ||
|
||
config_path = os.getenv("AUTODESK_CONFIG", "config/testing.yml") | ||
database = os.getenv("AUTODESK_DATABASE", ":memory:") | ||
address = os.getenv("AUTODESK_ADDRESS", "127.0.0.1") | ||
port = int(os.getenv("AUTODESK_PORT", "8080")) | ||
|
||
logger.info('Reading config "%s"', config_path) | ||
|
||
config = None | ||
with open(config_path, "r") as file: | ||
config = yaml.load(file, Loader=yaml.SafeLoader) | ||
|
||
with closing(create_pin_factory(config["hardware"])) as pin_factory: | ||
button_pin = pin_factory.create_input(config["button_pin"]) | ||
factory = AutoDeskServiceFactory( | ||
database, | ||
pin_factory, | ||
( | ||
Timedelta(seconds=config["limits"]["down"]), | ||
Timedelta(seconds=config["limits"]["up"]), | ||
), | ||
config["delay"], | ||
( | ||
config["motor_pins"]["down"], | ||
config["motor_pins"]["up"], | ||
), | ||
( | ||
config["light_pins"]["desk"], | ||
config["light_pins"]["session"], | ||
), | ||
) | ||
app = setup_app(button_pin, factory) | ||
web.run_app(app, host=address, port=port) | ||
|
||
main() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[project] | ||
name = "autodesk" | ||
version = "1.0.0" | ||
description = "Automatic standing desk controller." | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Daniel Oom", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3", | ||
] | ||
dependencies = [ | ||
"aiohttp-jinja2==1.6", | ||
"aiohttp==3.9.5", | ||
"matplotlib==3.9.0", | ||
"numpy==1.26.4", | ||
"pandas==2.2.2", | ||
"pyftdi==0.55.4", | ||
"pyyaml==6.0.1", | ||
] | ||
requires-python = ">=3.12" | ||
|
||
[project.urls] | ||
homepage = "https://github.com/daoo/autodesk" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"mock==5.1.0", | ||
"pyright>=1.1.382.post1", | ||
"pytest-aiohttp==1.0.5", | ||
"pytest-asyncio==0.23.7", | ||
"pytest-cov==5.0.0", | ||
"pytest-mock==3.14.0", | ||
"pytest==8.2.1", | ||
"requests==2.32.3", | ||
"ruff>=0.6.8", | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.