From 9ea9f825d6440489fdcbd6c18e81ad2c0cfba010 Mon Sep 17 00:00:00 2001 From: Gua Guo Date: Fri, 9 Aug 2024 06:52:12 -0600 Subject: [PATCH 1/3] setup: Add dependencies for Windows Windows apparently builds pylibfdt if swig is declared as a dependency in the setup file. Otherwise it must be installed manually and Windows does not sport a package manager, so this is hard for users. This change seems to have no ill effects on Linux, at least. So add a new setup_requires line. Commit-notes: This was picked up from: https://github.com/devicetree-org/pylibfdt/pull/2 END Series-to: dtc Series-cc: Gua Guo , david Signed-off-by: Gua Guo Signed-off-by: Simon Glass --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 52844ce..6efdae6 100755 --- a/setup.py +++ b/setup.py @@ -76,6 +76,7 @@ setup( cmdclass = {'build_py' : BuildPy}, author='Simon Glass', author_email='sjg@chromium.org', + setup_requires = ['swig'], description='Python binding for libfdt', ext_modules=[libfdt_module], package_dir={'': os.path.join(srcdir, 'pylibfdt')}, From 973f755e16ab1ef60c2a31742d2a8f0fb3ce98cc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 13 Aug 2024 13:07:55 -0600 Subject: [PATCH 2/3] github: Add pip as a dependency Allow use of the 'pip' tool within the actions. Signed-off-by: Simon Glass --- .github/workflows/build.yml | 1 + scripts/install-deps.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 200c9b7..c2ea929 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,6 +104,7 @@ jobs: meson:p ninja:p libyaml:p + python-pip:p swig:p python-setuptools-scm:p diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 12507de..38db074 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -12,20 +12,22 @@ fi if [ "$NAME" = "Arch Linux" ] then pacman -Syu --needed --noconfirm bison diffutils flex gcc git libyaml \ - make meson pkgconf python python-setuptools-scm swig valgrind which + make meson pkgconf python python-setuptools-scm python-pip swig valgrind \ + which elif [ "$NAME" = "Alpine Linux" ] then apk add build-base bison coreutils flex git yaml yaml-dev python3-dev \ - meson py3-setuptools_scm swig valgrind + py3-pip meson py3-setuptools_scm swig valgrind elif [ "$NAME" = "Fedora Linux" ] then dnf install -y bison diffutils flex gcc git libyaml libyaml-devel \ - make meson python3-devel python3-setuptools swig valgrind which + make meson python3-devel python3-pip python3-setuptools swig valgrind which elif [ "$NAME" = "Ubuntu" ] then apt update apt install -yq build-essential bison flex git libyaml-dev pkg-config \ - meson python3-dev python3-setuptools python3-setuptools-scm swig valgrind + meson python3-dev python3-pip python3-setuptools python3-setuptools-scm \ + swig valgrind else echo "ERROR: OS name is not provided." exit 1 From 6bf7773a58d46e4cccdaff8535c9abfd5a832319 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 15 Aug 2024 09:29:48 -0600 Subject: [PATCH 3/3] wip --- pyproject.toml | 3 +++ setup.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8ad2c6e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools","setuptools_scm", "swig"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 6efdae6..52844ce 100755 --- a/setup.py +++ b/setup.py @@ -76,7 +76,6 @@ setup( cmdclass = {'build_py' : BuildPy}, author='Simon Glass', author_email='sjg@chromium.org', - setup_requires = ['swig'], description='Python binding for libfdt', ext_modules=[libfdt_module], package_dir={'': os.path.join(srcdir, 'pylibfdt')},