mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
package/python-mpmath: new package
mpmath is a free (BSD licensed) Python library for real and complex floating-point arithmetic with arbitrary precision. https://mpmath.org/ Signed-off-by: Julien Olivain <ju.o@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
a1c4d6c884
commit
b9c09bd3c4
@@ -1781,6 +1781,7 @@ F: support/testing/tests/package/sample_python_gnupg.py
|
|||||||
F: support/testing/tests/package/sample_python_hwdata.py
|
F: support/testing/tests/package/sample_python_hwdata.py
|
||||||
F: support/testing/tests/package/sample_python_midiutil.py
|
F: support/testing/tests/package/sample_python_midiutil.py
|
||||||
F: support/testing/tests/package/sample_python_ml_dtypes.py
|
F: support/testing/tests/package/sample_python_ml_dtypes.py
|
||||||
|
F: support/testing/tests/package/sample_python_mpmath.py
|
||||||
F: support/testing/tests/package/sample_python_pyalsa.py
|
F: support/testing/tests/package/sample_python_pyalsa.py
|
||||||
F: support/testing/tests/package/sample_python_spake2.py
|
F: support/testing/tests/package/sample_python_spake2.py
|
||||||
F: support/testing/tests/package/test_acl.py
|
F: support/testing/tests/package/test_acl.py
|
||||||
@@ -1874,6 +1875,7 @@ F: support/testing/tests/package/test_python_hwdata.py
|
|||||||
F: support/testing/tests/package/test_python_magic_wormhole.py
|
F: support/testing/tests/package/test_python_magic_wormhole.py
|
||||||
F: support/testing/tests/package/test_python_midiutil.py
|
F: support/testing/tests/package/test_python_midiutil.py
|
||||||
F: support/testing/tests/package/test_python_ml_dtypes.py
|
F: support/testing/tests/package/test_python_ml_dtypes.py
|
||||||
|
F: support/testing/tests/package/test_python_mpmath.py
|
||||||
F: support/testing/tests/package/test_python_pyalsa.py
|
F: support/testing/tests/package/test_python_pyalsa.py
|
||||||
F: support/testing/tests/package/test_python_spake2.py
|
F: support/testing/tests/package/test_python_spake2.py
|
||||||
F: support/testing/tests/package/test_rdma_core.py
|
F: support/testing/tests/package/test_rdma_core.py
|
||||||
|
|||||||
@@ -1198,6 +1198,7 @@ menu "External python modules"
|
|||||||
source "package/python-modbus-tk/Config.in"
|
source "package/python-modbus-tk/Config.in"
|
||||||
source "package/python-more-itertools/Config.in"
|
source "package/python-more-itertools/Config.in"
|
||||||
source "package/python-mpd2/Config.in"
|
source "package/python-mpd2/Config.in"
|
||||||
|
source "package/python-mpmath/Config.in"
|
||||||
source "package/python-msgfy/Config.in"
|
source "package/python-msgfy/Config.in"
|
||||||
source "package/python-msgpack/Config.in"
|
source "package/python-msgpack/Config.in"
|
||||||
source "package/python-multidict/Config.in"
|
source "package/python-multidict/Config.in"
|
||||||
|
|||||||
7
package/python-mpmath/Config.in
Normal file
7
package/python-mpmath/Config.in
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
config BR2_PACKAGE_PYTHON_MPMATH
|
||||||
|
bool "python-mpmath"
|
||||||
|
help
|
||||||
|
mpmath is a free (BSD licensed) Python library for real and
|
||||||
|
complex floating-point arithmetic with arbitrary precision.
|
||||||
|
|
||||||
|
https://mpmath.org/
|
||||||
3
package/python-mpmath/python-mpmath.hash
Normal file
3
package/python-mpmath/python-mpmath.hash
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Locally computed sha256 checksums
|
||||||
|
sha256 7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f mpmath-1.3.0.tar.gz
|
||||||
|
sha256 c26cae81da4508e5e249985777a33821f183223ebb74d7f8cfbf90fe7eef2fb7 LICENSE
|
||||||
14
package/python-mpmath/python-mpmath.mk
Normal file
14
package/python-mpmath/python-mpmath.mk
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# python-mpmath
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
PYTHON_MPMATH_VERSION = 1.3.0
|
||||||
|
PYTHON_MPMATH_SOURCE = mpmath-$(PYTHON_MPMATH_VERSION).tar.gz
|
||||||
|
PYTHON_MPMATH_SITE = https://mpmath.org/files
|
||||||
|
PYTHON_MPMATH_SETUP_TYPE = setuptools
|
||||||
|
PYTHON_MPMATH_LICENSE = BSD-3-Clause
|
||||||
|
PYTHON_MPMATH_LICENSE_FILES = LICENSE
|
||||||
|
|
||||||
|
$(eval $(python-package))
|
||||||
16
support/testing/tests/package/sample_python_mpmath.py
Normal file
16
support/testing/tests/package/sample_python_mpmath.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
# Test inspired from example published on the project page:
|
||||||
|
# https://mpmath.org/
|
||||||
|
|
||||||
|
from mpmath import mp
|
||||||
|
|
||||||
|
mp.dps = 50
|
||||||
|
|
||||||
|
result = mp.quad(lambda x: mp.exp(-x**2), [-mp.inf, mp.inf]) ** 2
|
||||||
|
|
||||||
|
# Pi digits can be cross-checked here:
|
||||||
|
# https://www.angio.net/pi/digits.html
|
||||||
|
expected_result = "3.1415926535897932384626433832795028841971693993751"
|
||||||
|
|
||||||
|
assert str(result) == expected_result
|
||||||
12
support/testing/tests/package/test_python_mpmath.py
Normal file
12
support/testing/tests/package/test_python_mpmath.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from tests.package.test_python import TestPythonPackageBase
|
||||||
|
|
||||||
|
|
||||||
|
class TestPythonPy3MpMath(TestPythonPackageBase):
|
||||||
|
__test__ = True
|
||||||
|
|
||||||
|
config = TestPythonPackageBase.config + \
|
||||||
|
"""
|
||||||
|
BR2_PACKAGE_PYTHON3=y
|
||||||
|
BR2_PACKAGE_PYTHON_MPMATH=y
|
||||||
|
"""
|
||||||
|
sample_scripts = ["tests/package/sample_python_mpmath.py"]
|
||||||
Reference in New Issue
Block a user