12
0
Files
micropython-lib/micropython-lib.spec
Markéta Machová c04d0e0600 - Update to 1.25.0
* inspect: Implement iscoroutinefunction and iscoroutine.
  * inspect: Add basic unit tests.
  * inspect: Fix isgenerator logic.
  * usb-device-cdc: Optimise writing small data so it doesn't require alloc.
  * aiohttp: Allow headers to be passed to a WebSocketClient.
  * aiohttp: Fix header case sensitivity.
  * requests: Use the host in the redirect url, not the one in headers.
  * unix-ffi/machine: Use libc if librt is not present.
  * unix-ffi/json: Accept both str and bytes as arg for json.loads().
  * lora-sx126x: Fix invert_iq_rx / invert_iq_tx behaviour.
  * nrf24l10: Bump minor version.
  * nrf24l01: Optimize status reading.
  * nrf24l01: Properly handle timeout.
  * nrf24l01: Increase startup delay.
  * umqtt.simple: Restore legacy ssl/ssl_params arguments.
  * mip: Make mip.install() skip /rom*/lib directories.
  * github/workflows: Update actions/upload-artifact to v4.
  * mip: Allow relative URLs in package.json.
  * requests: Bump version to 0.10.1.
  * requests: Do not leak header modifications when calling request.
  * unittest: Always use "raise" with an argument.
  * unittest: Allow SkipTest to work within a subTest.
  * tools/ci.sh: Enable unittest tests.
  * aioespnow,webrepl: Use recommended network.WLAN.IF_[AP|STA] constants.
  * umqtt.simple: Add optional socket timeout to connect method.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/micropython-lib?expand=0&rev=7
2025-04-17 13:58:28 +00:00

83 lines
3.2 KiB
RPMSpec

#
# spec file for package micropython-lib
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: micropython-lib
Version: 1.25.0
Release: 0
Summary: Core Python libraries ported to MicroPython
License: MIT AND Python-2.0
Group: Development/Libraries/Python
URL: https://github.com/micropython/micropython-lib
Source: https://github.com/micropython/micropython-lib/archive/v%{version}.tar.gz#/micropython-lib-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/micropython/micropython/refs/tags/v%{version}/tools/manifestfile.py
Source2: https://raw.githubusercontent.com/micropython/micropython/refs/tags/v%{version}/mpy-cross/mpy_cross/__init__.py#/mpy_cross.py
Patch1: access_index_from_local_fs.patch
BuildRequires: fdupes
BuildArch: noarch
BuildRequires: micropython
BuildRequires: mpy-tools
BuildRequires: python3
%description
micropython-lib is a project to develop a non-monolothic standard library for MicroPython.
Each module or package is available as a separate distribution package from PyPI.
Each module is either written from scratch or ported from CPython.
%prep
%autosetup -p1 -n micropython-lib-%{version}
# prepare build.py dependencies
cp %SOURCE1 ./tools/manifestfile.py
mkdir tools/mpy_cross
cp %SOURCE2 ./tools/mpy_cross/__init__.py
# bootstrap mip
mkdir mip
cp -r micropython/mip/mip/* mip/
cp -r micropython/mip-cmdline/mip/* mip/
%build
# build mip index
python3 ./tools/build.py --mpy-cross %{_bindir}/mpy-cross --output ./mip_index
%install
# install all pkgs from index
for pkg in $(python3 -c 'import json;[print(p["name"]) for p in json.load(open("mip_index/index.json"))["packages"]]') ; do
micropython -m mip install --no-mpy -t %{buildroot}%{_prefix}/lib/micropython -i file://mip_index "$pkg"
done
# Fix rpm runtime dependency rpmlint error replace the shebang in all the scripts with %%{_bindir}/python3
find %{buildroot}%{_prefix}/lib/micropython -name "*.py" -exec sed -i 's|#! %{_bindir}/env python3|#!%{_bindir}/python3|' {} ";"
find %{buildroot}%{_prefix}/lib/micropython -name "*.py" -exec sed -i 's|#! %{_prefix}/local/bin/python|#!%{_bindir}/python3|' {} ";"
# Fix permissions
chmod 0755 %{buildroot}%{_prefix}/lib/micropython/{base64,keyword,quopri,uu}.py
# Run fdupes
%fdupes %{buildroot}%{_prefix}/lib/micropython
%check
# check that we can import a module that we just installed and that it actually works
cd %{buildroot}%{_prefix}/lib/micropython
micropython -c 'import hashlib; s=hashlib.sha384("foo").hexdigest(); assert s.startswith("98c11ffdf")'
%files
%license LICENSE
%doc README.md
%{_prefix}/lib/micropython
%changelog