uv build local project dev

This commit is contained in:
2025-09-06 15:43:58 +02:00
parent 2929064f4d
commit 6902f07161
6 changed files with 30 additions and 17 deletions

View File

@@ -60,11 +60,13 @@ class AgilitySphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None: def __init__(self, x_pos: int, y_pos: int) -> None:
super().__init__(x_pos, y_pos, Qt.GlobalColor.darkYellow) super().__init__(x_pos, y_pos, Qt.GlobalColor.darkYellow)
class EmptySphereGraphicsItem(SphereGraphicsItem): class EmptySphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None: def __init__(self, x_pos: int, y_pos: int) -> None:
self.SPHERE_WIDTH = 20 self.SPHERE_WIDTH = 20
super().__init__(x_pos, y_pos, Qt.GlobalColor.black) super().__init__(x_pos, y_pos, Qt.GlobalColor.black)
@staticmethod @staticmethod
def random_sphere_factory(x_pos: int, y_pos: int) -> SphereGraphicsItem: def random_sphere_factory(x_pos: int, y_pos: int) -> SphereGraphicsItem:
rand = random.random() rand = random.random()
@@ -78,6 +80,7 @@ def random_sphere_factory(x_pos: int, y_pos: int) -> SphereGraphicsItem:
obj = EmptySphereGraphicsItem(x_pos, y_pos) obj = EmptySphereGraphicsItem(x_pos, y_pos)
return obj return obj
class ArcGraphicsItem(QGraphicsItem): class ArcGraphicsItem(QGraphicsItem):
"""Circle arc.""" """Circle arc."""
@@ -111,7 +114,7 @@ class ArcGraphicsItem(QGraphicsItem):
# must a more elegant way but it works # must a more elegant way but it works
if angle_end == 0: if angle_end == 0:
angle_end = 360 angle_end = 360
self.draw_angle_end = int(abs(angle_end-angle_start) * 16) self.draw_angle_end = int(abs(angle_end - angle_start) * 16)
logging.debug( logging.debug(
"arc from %s:%s of %s from %s° to %s°", "arc from %s:%s of %s from %s° to %s°",
self.x_pos, self.x_pos,

View File

@@ -112,8 +112,8 @@ class LargeUltimaPattern(Pattern):
y_pos=self.center_y, y_pos=self.center_y,
width=self.SPACE_BETWEEN_SPHERE * 2, width=self.SPACE_BETWEEN_SPHERE * 2,
angle_start=(i * 360 / sphere_on_circle) % 360, angle_start=(i * 360 / sphere_on_circle) % 360,
#angle_end=((i + 1) * 360 / sphere_on_circle) % 360, # angle_end=((i + 1) * 360 / sphere_on_circle) % 360,
angle_end=(360 / sphere_on_circle ), angle_end=(360 / sphere_on_circle),
parent=self, parent=self,
) )
) )

View File

@@ -1,9 +1,5 @@
import logging
import sys
from PySide6.QtGui import QPainter from PySide6.QtGui import QPainter
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QApplication,
QGraphicsScene, QGraphicsScene,
QGraphicsView, QGraphicsView,
QHBoxLayout, QHBoxLayout,
@@ -34,12 +30,3 @@ class Window(QWidget):
self.setLayout(vbox) self.setLayout(vbox)
self.show() self.show()
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
app = QApplication(sys.argv)
w = Window()
app.exec()

19
main.py Normal file
View File

@@ -0,0 +1,19 @@
import logging
import sys
from grid.ui.window import Window
from PySide6.QtWidgets import QApplication
def main():
print("Hello from sphere-grid!")
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
app = QApplication(sys.argv)
w = Window() # noqa: F841
app.exec()
if __name__ == "__main__":
main()

View File

@@ -9,3 +9,7 @@ dependencies = [
"pytest==8.3.3", "pytest==8.3.3",
"ruff==0.12.10", "ruff==0.12.10",
] ]
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

2
uv.lock generated
View File

@@ -142,7 +142,7 @@ wheels = [
[[package]] [[package]]
name = "sphere-grid" name = "sphere-grid"
version = "0.1.0" version = "0.1.0"
source = { virtual = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "pyside6" }, { name = "pyside6" },
{ name = "pytest" }, { name = "pytest" },