Sfoglia il codice sorgente

add python package for code completion

Oliver Fabel 1 anno fa
parent
commit
29a6f6a6ed
4 ha cambiato i file con 67 aggiunte e 8 eliminazioni
  1. 15 7
      Makefile
  2. 6 0
      flipperzero/README.md
  3. 44 0
      pyproject.toml
  4. 2 1
      requirements.txt

+ 15 - 7
Makefile

@@ -2,24 +2,32 @@
 update:
 update:
 	git submodule update --remote lib/micropython && git add lib/micropython
 	git submodule update --remote lib/micropython && git add lib/micropython
 
 
-.PHONY: build
-build: update
+.PHONY: build-fap
+build-fap: update
 	ufbt build
 	ufbt build
 
 
 .PHONY: launch
 .PHONY: launch
-launch: build
+launch: build-fap
 	ufbt launch
 	ufbt launch
 
 
 .PHONY: clean
 .PHONY: clean
 clean:
 clean:
 	ufbt -c
 	ufbt -c
 
 
-.PHONY: pages
-pages:
+.PHONY: build-pages
+build-pages:
 	rm -rf ./dist/pages ./flipperzero/__init__.py
 	rm -rf ./dist/pages ./flipperzero/__init__.py
 	cat ./flipperzero/_*.py > ./flipperzero/__init__.py
 	cat ./flipperzero/_*.py > ./flipperzero/__init__.py
 	source venv/bin/activate && sphinx-build docs/pages dist/pages
 	source venv/bin/activate && sphinx-build docs/pages dist/pages
 
 
-.PHONY: publish
-publish: pages
+.PHONY: publish-pages
+publish-pages: build-pages
 	./publish.sh pages
 	./publish.sh pages
+
+.PHONY: build-python
+build-python:
+	source venv/bin/activate && hatch build
+
+.PHONY: publish-python
+publish-python: build-python
+	source venv/bin/activate && hatch publish dist/python/*

+ 6 - 0
flipperzero/README.md

@@ -0,0 +1,6 @@
+# MicroPython on Flipper Zero
+
+This package contains the type definitions for the `flipperzero` [MicroPython](https://micropython.org/) module.
+Check out the [website](https://ofabel.github.io/mp-flipper/) for details.
+
+Get the interpreter application on [Flipper Lab](https://lab.flipper.net/apps/upython) to write and run your own Python files.

+ 44 - 0
pyproject.toml

@@ -0,0 +1,44 @@
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[project]
+name = "flipperzero"
+version = "1.3.0"
+authors = [
+    { name = "Oliver Fabel" },
+]
+description = "Python support for Flipper Zero."
+readme = "flipperzero/README.md"
+license = "MIT"
+requires-python = ">=3.8"
+classifiers = [
+    "Programming Language :: Python :: Implementation :: MicroPython",
+    "Development Status :: 5 - Production/Stable",
+    "License :: OSI Approved :: MIT License",
+    "Operating System :: Other OS",
+]
+keywords = [
+    "flipperzero",
+    "Flipper Zero",
+    "MicroPython",
+    "f0",
+    "GPIO",
+    "PWM",
+    "ADC",
+    "Infrared"
+]
+
+[project.urls]
+"Documentation" = "https://ofabel.github.io/mp-flipper/"
+"Source code" = "https://github.com/ofabel/mp-flipper"
+"Issue Tracker" = "https://github.com/ofabel/mp-flipper/issues"
+"Changelog" = "https://github.com/ofabel/mp-flipper/blob/master/CHANGELOG.md"
+
+[tool.hatch.build]
+directory = "dist/python"
+include = [
+    "flipperzero/__init__.py"
+]
+ignore-vcs = true
+only-packages = true

+ 2 - 1
requirements.txt

@@ -1,2 +1,3 @@
 Sphinx==8.0.2
 Sphinx==8.0.2
-myst-parser==4.0.0
+myst-parser==4.0.0
+hatch==1.12.0