Skip to content

Commit

Permalink
Introduce package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
reemo3dp committed Feb 29, 2024
1 parent 06376f1 commit c736349
Show file tree
Hide file tree
Showing 26 changed files with 793 additions and 424 deletions.
10 changes: 5 additions & 5 deletions install-led_effect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ while getopts "k:c:uh" arg; do
done

# Find SRCDIR from the pathname of this script
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/src/ && pwd )"
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/ && pwd )"

# Verify Klipper has been installed
check_klipper()
Expand Down Expand Up @@ -56,7 +56,7 @@ check_folders()
link_extension()
{
echo -n "Linking extension to Klipper... "
ln -sf "${SRCDIR}/led_effect.py" "${KLIPPER_PATH}/klippy/extras/led_effect.py"
ln -sf "${SRCDIR}/packages/led_effect" "${KLIPPER_PATH}/klippy/extras/led_effect"
echo "[OK]"
}

Expand Down Expand Up @@ -110,13 +110,13 @@ stop_klipper()

uninstall()
{
if [ -f "${KLIPPER_PATH}/klippy/extras/led_effect.py" ]; then
if [ -d "${KLIPPER_PATH}/klippy/extras/led_effect" ]; then
echo -n "Uninstalling... "
rm -f "${KLIPPER_PATH}/klippy/extras/led_effect.py"
rm -f "${KLIPPER_PATH}/klippy/extras/led_effect"
echo "[OK]"
echo "You can now remove the [update_manager led_effect] section in your moonraker.conf and delete this directory. Also remove all led_effect configurations from your Klipper configuration."
else
echo "led_effect.py not found in \"${KLIPPER_PATH}/klippy/extras/\". Is it installed?"
echo "led_effect not found in \"${KLIPPER_PATH}/klippy/extras/\". Is it installed?"
echo "[FAILED]"
fi
}
Expand Down
7 changes: 7 additions & 0 deletions packages/klippermock/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions packages/klippermock/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.poetry]
name = "klippermock"
version = "0.1.0"
authors = ["Julian Schill <[email protected]>"]
description = ""

[tool.poetry.dependencies]
python = "<3.12,>=3.8"
led_effect = {path = "../led_effect", develop = true}


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
print(root)
sys.path.append(str(root))
from pathlib import Path
from src.led_effect import ledEffect, ledFrameHandler
from led_effect import ledEffect, ledFrameHandler

class mockPrinter:
NOW = 0
Expand Down
7 changes: 7 additions & 0 deletions packages/led_effect/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/led_effect/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool.poetry]
name = "led-effect"
version = "0.1.0"
authors = ["Julian Schill <[email protected]>"]
description = ""

[tool.poetry.dependencies]
python = "<3.12,>=3.8"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
File renamed without changes.
250 changes: 250 additions & 0 deletions packages/led_effect_tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions packages/led_effect_tests/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "led-effect-tests"
version = "0.1.0"
authors = ["Julian Schill <[email protected]>"]
description = ""
package-mode = false

[tool.poetry.dependencies]
python = "<3.12,>=3.8"
klippermock = {path = "../klippermock", develop = true}

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.1"
pytest-golden = "^0.2.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import pytest

import sys
from pathlib import Path # if you haven't already done so
file = Path(__file__).resolve()
parent, root = file.parent, file.parents[1]
sys.path.append(str(root))

from simulator.simulator.klippermock import *
from klippermock import *

NUM_FRAMES = 100

Expand Down
File renamed without changes.
Loading

0 comments on commit c736349

Please sign in to comment.