Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Increment the version by updating PACKAGE_VERSION,
# then run "make publish" to update package.json and
# the version string in src/your_package/config.py
# then run "make publish" to update package.json.

PACKAGE_VERSION := v0.1.0
PKG := your_package
PKG := hackberry

DEVICE ?= u0

Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# micropython-template
Template repository for MicroPython-based projects.
Portable keyboard and macropad based on MicroPython.

Use this template to easily create projects that rely on MicroPython. With the help of this template\
you can easily build, deploy and test your application with the included MicroPython toolchain.

This project relies on GNU Make, implementing various automations in the included Makefile to cross-compile,\
and upload your application to a device with mpremote. Check the below steps for more details.

Additionally, you can host your package in the repository itself with the help of ```package.json```, allowing\
you to install the package from GitHub with the mip package manager. Use the ```publish``` rule to cross-compile\
and host modules under the ```dist``` directory.
This project is under development.

# Prerequisites

Expand All @@ -20,7 +12,7 @@ source venv/bin/activate
python3 -m pip install -r requirements.txt
```

# Build and run example application
# Development

## Run on unix port

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"version": "v0.1.0",
"urls": [
[
"your_package/main.mpy",
"github:YourName/your_package/dist/your_package/main.mpy"
"hackberry/main.mpy",
"github:szeka9/HackBerry/dist/hackberry/main.mpy"
],
[
"your_package/__init__.py",
"github:YourName/your_package/dist/your_package/__init__.py"
"hackberry/__init__.py",
"github:szeka9/HackBerry/dist/hackberry/__init__.py"
],
[
"your_package/config.mpy",
"github:YourName/your_package/dist/your_package/config.mpy"
"hackberry/config.mpy",
"github:szeka9/HackBerry/dist/hackberry/config.mpy"
]
],
"deps": []
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def delete_path(path):
pass


delete_path("/lib/your_package")
delete_path("/lib/hackberry")
2 changes: 1 addition & 1 deletion scripts/update_package.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ which jq 1>/dev/null || { echo "jq dependency is missing"; exit 1; }
find "$dist_dir" -type f -printf '%P\n' | jq -Rn --arg version "${version}" '[inputs] |
{
version: $version,
urls: map([., ("github:YourName/your_package/dist/" + .)]),
urls: map([., ("github:szeka9/hackberry/dist/" + .)]),
deps: []
}
' > $package_json
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/your_package/main.py → src/hackberry/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def main():
"""
Main function, used as an example.
"""
print('This is a template, replace "your_package" with your package name.')
return "OK"


Expand Down
5 changes: 3 additions & 2 deletions tests/functional/test_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Functional test module.
"""

from your_package import main as package_main
from hackberry import main as package_main


def test_assert(name, actual, expected):
Expand All @@ -13,8 +13,9 @@ def test_assert(name, actual, expected):
print("Fail")
raise AssertionError(f"{actual} != {expected}")


def test_dummy():
test_assert("main function returns \"OK\"", package_main.main(), "OK")
test_assert('main function returns "OK"', package_main.main(), "OK")


def main():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DummyTest(unittest.TestCase):

@classmethod
def setUpClass(cls):
cls.main_module = load_module("your_package/main.py")
cls.main_module = load_module("hackberry/main.py")

def setUp(self):
pass
Expand Down
Loading