8000 tools/mpremote: Package wheel with github actions. · micropython/micropython@6835ef4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6835ef4

Browse files
committed
tools/mpremote: Package wheel with github actions.
1 parent 4527b8a commit 6835ef4

File tree

5 files changed

+59
-2
lines changed

5 files changed

+59
-2
lines changed

.github/workflows/mpremote.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Package mpremote
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v1
11+
- name: Build mpremote wheel
12+
run: pip install build && cd tools/mpremote && python3 -m build
13+
- name: Archive mpremote wheel
14+
uses: actions/upload-artifact@v2
15+
with:
16+
name: mpremote
17+
path: |
18+
tools/mpremote/dist/*.whl

tools/mpremote/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/mpremote/makemanifest.py
2+
/mpremote/pyboard.py
3+
/mpremote.egg-info

tools/mpremote/build.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import shutil
2+
from pathlib import Path
3+
from setuptools.build_meta import (
4+
get_requires_for_build_wheel,
5+
get_requires_for_build_sdist,
6+
prepare_metadata_for_build_wheel,
7+
build_wheel as real_build_wheel,
8+
build_sdist as real_build_sdist,
9+
)
10+
11+
12+
PACKAGE = Path(__file__).parent / "mpremote"
13+
TOOLS_DIR = Path(__file__).parent / "../../tools"
14+
15+
16+
def copy_tools():
17+
if TOOLS_DIR.exists():
18+
for f in (
19+
TOOLS_DIR / "pyboard.py",
20+
TOOLS_DIR / "makemanifest.py",
21+
):
22+
print("copy {} -> {}".format(f, PACKAGE))
23+
shutil.copy(f, PACKAGE)
24+
25+
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
26+
copy_tools()
27+
return real_build_wheel(wheel_directory, config_settings, metadata_directory)
28+
29+
def build_sdist(sdist_directory, config_settings=None):
30+
copy_tools()
31+
return real_build_sdist(sdist_directory, config_settings)

tools/mpremote/pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[build-system]
22
requires = [
33
"setuptools>=42",
4-
"wheel"
4+
"wheel",
5+
"intreehooks"
56
]
6-
build-backend = "setuptools.build_meta"
7+
build-backend = "intreehooks:loader"
8+
9+
[tool.intreehooks]
10+
build-backend = "build"

tools/mpremote/setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ packages = mpremote
1919
python_requires = >= 3.4
2020
install_requires =
2121
pyserial >= 3.3
22+
include_package_data = True
2223

2324
[options.entry_points]
2425
console_scripts =

0 commit comments

Comments
 (0)
0