Skip to content

Commit 1d2d22f

Browse files
committed
change package to mpy-cross-v6.1
MicroPython v1.20 bumped the MPY minor version to v6.1 so we need a new package to allow targeting both MPY v6 and v6.1 at the same time.
1 parent 9bdd60c commit 1d2d22f

File tree

11 files changed

+26
-23
lines changed

11 files changed

+26
-23
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: Build and upload to PyPI
33
on:
44
push:
55
branches:
6-
- mpy-cross-v6
6+
- mpy-cross-v6.1
77
tags:
8-
- mpy-cross-v6/*
8+
- mpy-cross-v6.1/*
99
pull_request:
1010
branches:
11-
- mpy-cross-v6
11+
- mpy-cross-v6.1
1212

1313
jobs:
1414
build_wheels:
@@ -68,4 +68,4 @@ jobs:
6868
- uses: pypa/[email protected]
6969
with:
7070
user: __token__
71-
password: ${{ secrets.PYPI_TOKEN2 }}
71+
password: ${{ secrets.PYPI_TOKEN3 }}

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "micropython"]
22
path = micropython
33
url = https://github.com/pybricks/micropython.git
4-
branch = python-mpy-cross-v6
4+
branch = python-mpy-cross-v6.1

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"[python]": {
33
"editor.defaultFormatter": "ms-python.python",
44
"editor.formatOnSave": true
5-
}
5+
},
6+
"python.formatting.provider": "black"
67
}

MANIFEST.in

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
recursive-include micropython py/** mpy-cross/** shared/** tools/**
22
include micropython/docs/conf.py
3-
exclude micropython/mpy-cross/mpy-cross*
4-
include micropython/mpy-cross/mpy-cross.vcxproj
53
prune micropython/mpy-cross/build*
64
prune micropython/ports*
7-
exclude src/mpy_cross_v6/mpy-cross*
8-
prune src/mpy_cross_v6.egg-info
5+
exclude src/mpy_cross_v6.1/mpy-cross*
6+
prune src/mpy_cross_v6.1.egg-info

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ For MicroPython 1.12 to 1.18:
1010

1111
pip install mpy-cross-v5
1212

13-
For MicroPython 1.19+:
13+
For MicroPython 1.19:
1414

1515
pip install mpy-cross-v6
16+
17+
For MicroPython 1.20+:
18+
19+
pip install mpy-cross-v6.1

micropython

Submodule micropython updated 1607 files

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "mpy-cross-v6"
7-
version = "1.0.1"
6+
name = "mpy-cross-v6.1"
7+
version = "1.0.0"
88
description = "Python wrapper for the mpy-cross tool from MicroPython."
99
readme = "README.md"
1010

1111
[project.scripts]
12-
mpy-cross-v6 = "mpy_cross_v6:_run"
12+
"mpy-cross-v6.1" = "mpy_cross_v6_1:_run"
1313

1414
[tool.setuptools.packages.find]
1515
where = ["src"]
1616

1717
[tool.setuptools.package-data]
18-
mpy_cross_v6 = ["mpy-cross*"]
18+
mpy_cross_v6_1 = ["mpy-cross*"]
1919

2020
[tool.pytest.ini_options]
2121
pythonpath = ["build/lib"]

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
PROJECT_DIR = pathlib.Path(__file__).parent
1212
MPY_CROSS_DIR = PROJECT_DIR / "micropython" / "mpy-cross"
13-
MPY_CROSS_EXE = (MPY_CROSS_DIR / "mpy-cross").with_suffix(
14-
".exe" if platform.system() == "Windows" else ""
15-
)
1613

1714
# map of distutils platform id to compiler target triple
1815
PLAT_TO_CLANG_TARGET = {
@@ -27,9 +24,13 @@ class custom_build(build):
2724
def run(self):
2825
super().run()
2926

27+
mpy_cross_exe = (
28+
MPY_CROSS_DIR / f"build-{self.plat_name}" / "mpy-cross"
29+
).with_suffix(".exe" if platform.system() == "Windows" else "")
30+
3031
# all builds put exe in the same place, so we have to remove to avoid
3132
# make not rebuilding for different arch
32-
MPY_CROSS_EXE.unlink(missing_ok=True)
33+
mpy_cross_exe.unlink(missing_ok=True)
3334

3435
make_command = [
3536
"make",
@@ -51,7 +52,7 @@ def run(self):
5152

5253
subprocess.check_call(make_command)
5354

54-
shutil.copy(str(MPY_CROSS_EXE), self.build_lib + "/mpy_cross_v6")
55+
shutil.copy(str(mpy_cross_exe), self.build_lib + "/mpy_cross_v6_1")
5556

5657

5758
class custom_install(install):
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)