Commit Graph

23 Commits

Author SHA1 Message Date
Trevor Gamblin
90bae3f54c
distutils: remove classes
distutils is no longer in Python as of 3.12. Nothing seems to be using
these classes in the layer, so remove them.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-05-22 17:39:10 -07:00
Electric Worry
3ae9254730
meta-python: missing closing brace
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-04-15 21:01:19 -07:00
Tim Orling
94c20e1ef4
meta-python: drop ${PYTHON_PN}
python 2 is long unsupported, so we no longer need this variable.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-02-19 23:22:24 -08:00
Tim Orling
68d898a0cb
python_mesonpy.bbclass: move to oe-core
This is now the declared PEP-517 build-backend for python3-numpy

Move the support into oe-core

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-02-19 23:22:23 -08:00
Zoltán Böszörményi
1baf66e09b python_mesonpy: New class
This is a new PEP517 compatible build class for python modules
that use pyproject.toml and this:

[build-system]
build-backend = 'mesonpy'

The new class uses python3-meson-python-native.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-06-14 09:50:28 -07:00
Ross Burton
b21eb2b93f python3-hatchling: remove (now in oe-core)
As of 846e80 this is now in oe-core.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-07-02 11:37:03 -04:00
Ross Burton
4aebf7e4b2 python3-hatchling: add new recipe and build class
Hatchling is the build backend used by the Hatch tool.  Add the recipe
and a pep517 build class.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-05-29 06:39:14 -07:00
Alejandro Enedino Hernandez Samaniego
bb9d3688f1 meta-python: Clean up recipes and classes that were moved to oe-core
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@linux.microsoft.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: tgamblin <trevor.gamblin@windriver.com>
2022-03-16 09:25:28 -04:00
Ross Burton
3d93230c3e poetry_core: update for renamed class pip_install_wheel to python_pep517
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-14 09:15:03 -07:00
Ross Burton
62af27a57a poetry-core: clean up class
There's been a lot of work on this class so clean it up a bit.

Rationalise imports, python3-dir is already included in python3native.

Don't write a helper script in do_configure, just call the API in
do_compile.  In the long term this should be using pypa/build instead
of calling the API directly.

Stub out do_configure as the base configure isn't useful.

Write the wheel to PIP_INSTALL_DIST_PATH instead of hard-coding S/dist,
and clean it.

Use EXPORT_FUNCTIONS on the tasks.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-10 07:31:21 -08:00
Tim Orling
d740ecb8c4 poetry_core: add helper class
poetry.core.masonry.api is one of the common PEP-517 build backends.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-03 08:50:19 -08:00
Tim Orling
d6dcffc754 distutils*.bbclass: move from oe-core
distutils has been deprecated in Python 3.10 and will be removed in
Python 3.12 (predicted release date October 2023). For now, move these
classes from oe-core to allow users to migrate.

A deprecation warning has been added to each class.

Documentation is also being dropped in oe-core, but users can refer to
3.4 documentation for the legacy variables and classes.

[YOCTO #14610]

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-01 09:13:42 -08:00
Tim Orling
0e59a23901 setuptools3_rust.bbclass: setuptoools Rust plugin
setuptools-rust is a plugin for setuptools to build Rust Python extensions
implemented with PyO3 or rust-cpython.

Compile and distribute Python extensions written in Rust as easily as if
they were written in C.

This class inherits pyo3.bbclass (and therefore cargo.bbclass) and
setuptools3.bbclass to make it easier to build Python modules with Rust
extensions.

Need to call pyo3_do_configure to properly setup the PyO3 environment
for cross-compiling.

Need to call cargo_common_do_configure to setup cargo_home/config so
that the linker properly finds e.g. crti.o and crtbeginS.o

It is strongly recommended to provide crates needed for your recipe
using the crate:// fetcher. This can be helped with the cargo-bitbake
command [1].

If you choose not to use the crate fetcher, bitbake vendoring will not
work with setuptools-rust, as it errors out immediately because it cannot
find pyo3 or some other crate. The (strongly discouraged) workaround for
this is to set:

CARGO_DISABLE_BITBAKE_VENDORING = "1"

[1] https://crates.io/crates/cargo-bitbake

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
2022-01-18 12:53:38 -08:00
Tim Orling
5c7d63a437 pyo3.bbclass: add class for PyO3 cross-compilation
PyO3 provides Rust bindings for Python, including tools for creating native
Python extension modules. Running and interacting with Python code from a
Rust binary is also supported.

This class sets up the cross-compilation environment.

Export PYO3_CROSS, PYO3_CROSS_LIB_DIR, PYO3_CROSS_INCLUDE_DIR and CARGO_BUILD_TARGET
to inform tools like setuptools-rust we are cross-compiling.

Export RUSTFLAGS so cargo can find 'std' and 'core' for target

Dynamically generate PyO3 config file and export PYO3_CONFIG_FILE
absolute path. This is the trick that finally made pyo3 work.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
2022-01-18 12:53:38 -08:00
Ross Burton
23acce81f4 bandit: add class to perform Bandit scans
Add a class to perform security scans of Python code using Bandit.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-11-27 11:05:22 -08:00
Derek Straka
73dfaca93b pypi: remove class that was added to oe-core
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2018-01-16 21:33:04 -08:00
Derek Straka
3d383cce9a pypi: add default values for UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-12-13 11:19:34 +01:00
Joshua Lock
efd3696e70 remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
2016-12-02 09:16:17 +01:00
Derek Straka
7edad4def4 pypi: update the base pypi url to use the package info without requiring the hash
* Things have finally settled on a URL structure without needing the hash
     (See https://bitbucket.org/pypa/pypi/issues/438/backwards-compatible-un-hashed-package)

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-07-11 15:16:04 +02:00
Derek Straka
e62215ef4e pypi: update the pypi class to support the updated URL scheme
pypi has changed the url scheme to use the blake2b rather than names

http://permalink.gmane.org/gmane.linux.distributions.nixos/20158

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-05-10 20:18:57 +02:00
Derek Straka
1fadd754cc Update pypi classes to avoid setuptools inherit to be more flexible
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-02-25 17:45:47 +01:00
Sven Ebenfeld
1ec43c1e4f add pypi3 bbclass to make python3 recipe creation easier as well
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
2016-02-01 15:51:15 +01:00
Andreas Oberritter
0f568c5441 pypi.bbclass: new class to ease writing pypi recipes
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2015-04-13 12:55:48 +02:00