Skip to content

Commit 82361ba

Browse files
committed
add function to install from local repo
1 parent 6989bd5 commit 82361ba

30 files changed

+41
-980
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ lib/rv3028*
1515
lib/adafruit*
1616
lib/asyncio*
1717
lib/neopixel.py
18+
lib/pysquared/

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@ help: ## Display this help.
1313
@$(UV) venv
1414
@$(UV) pip install --requirement pyproject.toml
1515

16+
LOCAL_PYSQUARED ?= ""
17+
1618
.PHONY: download-libraries
1719
download-libraries: .venv ## Download the required libraries
1820
@echo "Downloading libraries..."
19-
@$(UV) pip install --requirement lib/requirements.txt --target lib --no-deps --upgrade --quiet
21+
@$(UV) pip install --requirement lib/requirements.txt --target lib --no-deps --upgrade --quiet; \
22+
23+
@if [ -n "$(LOCAL_PYSQUARED)" ]; then \
24+
$(UV) pip install $(LOCAL_PYSQUARED) --target lib --no-deps --upgrade --quiet; \
25+
else \
26+
$(UV) pip install git+https://github.com/hrfarmer/pysquared --target lib --no-deps --upgrade --quiet; \
27+
fi
28+
2029
@rm -rf lib/*.dist-info
2130
@rm -rf lib/.lock
2231

lib/pysquared/Big_Data.py

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import gc
22

33
import lib.adafruit_tca9548a as adafruit_tca9548a # I2C Multiplexer
4-
from lib.pysquared.logger import Logger
4+
from pysquared.logger import Logger
55

66
try:
77
from typing import Union

lib/pysquared/cdh.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import random
22
import time
33

4-
from lib.pysquared.config.config import Config
5-
from lib.pysquared.hardware.rfm9x.manager import RFM9xManager
6-
from lib.pysquared.hardware.rfm9x.modulation import RFM9xModulation
7-
from lib.pysquared.logger import Logger
8-
from lib.pysquared.pysquared import Satellite
4+
from pysquared.config.config import Config
5+
from pysquared.hardware.rfm9x.manager import RFM9xManager
6+
from pysquared.hardware.rfm9x.modulation import RFM9xModulation
7+
from pysquared.logger import Logger
8+
from pysquared.pysquared import Satellite
99

1010
try:
1111
from typing import Any, Union

lib/pysquared/config/config.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

lib/pysquared/config/radio.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

lib/pysquared/functions.py

100755100644
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
import random
1010
import time
1111

12-
from lib.pysquared.config.config import Config
13-
from lib.pysquared.hardware.rfm9x.manager import RFM9xManager
14-
from lib.pysquared.logger import Logger
15-
from lib.pysquared.packet_manager import PacketManager
16-
from lib.pysquared.packet_sender import PacketSender
17-
from lib.pysquared.pysquared import Satellite
18-
from lib.pysquared.sleep_helper import SleepHelper
12+
from pysquared.config.config import Config
13+
from pysquared.hardware.rfm9x.manager import RFM9xManager
14+
from pysquared.logger import Logger
15+
from pysquared.packet_manager import PacketManager
16+
from pysquared.packet_sender import PacketSender
17+
from pysquared.pysquared import Satellite
18+
from pysquared.sleep_helper import SleepHelper
1919

2020
try:
2121
from typing import List, OrderedDict, Union
@@ -188,7 +188,7 @@ def send_face(self) -> None:
188188
def listen(self) -> bool:
189189
# need to instanciate cdh to feed it the config var
190190
# assigned from the Config object
191-
from lib.pysquared.cdh import CommandDataHandler
191+
from pysquared.cdh import CommandDataHandler
192192

193193
cdh = CommandDataHandler(self.config, self.logger, self.radio_manager)
194194

@@ -240,7 +240,7 @@ def all_face_data(self) -> list:
240240
)
241241

242242
try:
243-
import lib.pysquared.Big_Data as Big_Data
243+
import pysquared.Big_Data as Big_Data
244244

245245
self.logger.debug(
246246
"Free Memory Stat after importing Big_data library",
@@ -302,7 +302,7 @@ def detumble(self, dur: int = 7) -> None:
302302
self.cubesat.rgb = (255, 255, 255)
303303

304304
try:
305-
import lib.pysquared.Big_Data as Big_Data
305+
import pysquared.Big_Data as Big_Data
306306

307307
a: Big_Data.AllFaces = Big_Data.AllFaces(self.cubesat.tca, self.logger)
308308
except Exception as e:
@@ -327,7 +327,7 @@ def actuate(dipole: list[float], duration) -> None:
327327

328328
def do_detumble() -> None:
329329
try:
330-
import lib.pysquared.detumble as detumble
330+
import pysquared.detumble as detumble
331331

332332
for _ in range(3):
333333
data = [self.cubesat.IMU.Gyroscope, self.cubesat.IMU.Magnetometer]

lib/pysquared/hardware/__init__.py

Whitespace-only changes.

lib/pysquared/hardware/busio.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

lib/pysquared/hardware/decorators.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)