commit 76b7a0e23b31ee420f527bf9ec3f1e7a8c8bca39
parent aca96eca05c7a944099bf98717bc025a4829a4cc
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date: Wed, 6 May 2026 10:42:02 +0200
Use pip for installation, fixes metadata missing
Diffstat:
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/main.janet b/src/main.janet
@@ -116,8 +116,8 @@
(file/file-exists? "Makefile") (set state :build/make)
(file/file-exists? "go.mod") (set state :build/go)
(file/file-exists? "Cargo.toml") (set state :build/cargo)
- (file/file-exists? "pyproject.toml") (set state :build/pep517)
- (file/file-exists? "setup.py") (set state :build/setuptools)
+ (or (file/file-exists? "setup.py")
+ (file/file-exists? "pyproject.toml")) (set state :build/pip)
(file/file-exists? "project.janet") (set state :build/jpm)
(utils/some? (libc/glob "*.pro")) (set state :conf/qmake)
(file/file-exists? "CMakeLists.txt") (set state :conf/cmake)
@@ -170,11 +170,11 @@
:build/cargo
(checkrun :install/cargo :cargo "build" "--locked" "--release")
- :build/setuptools
- (checkrun :install/setuptools :python "setup.py" "build")
+ :build/pip
+ (do
+ (set builddir "build")
+ (checkrun :install/pip :pip "wheel" "." "-w" builddir "--no-build-isolation" "--no-deps"))
- :build/pep517
- (checkrun :install/pep517 :python "-m" "build" "--wheel" "--no-isolation")
:build/meson
(checkrun :install/meson :meson "compile" "-C" builddir)
@@ -217,15 +217,18 @@
(set prefix "")
(checkrun :move :cargo "install" "--force" "--offline" "--locked" "--no-track" "--root" destdir "--path" "."))
- :install/pep517
- (utils/letsome wheels (libc/glob "dist/*.whl")
- (checkrun :post/detectprefix :python "-m" "installer" (stropt "--destdir" destdir) (stropt "--prefix" prefix) ;wheels)
+ :install/pip
+ (utils/letsome wheels (libc/glob (path/join builddir "*.whl"))
+ (checkrun :post/detectprefix
+ :pip "install"
+ (stropt "--root" destdir)
+ (stropt "--prefix" prefix)
+ "--no-build-isolation"
+ "--no-deps"
+ "--force-reinstall"
+ ;wheels)
(errexit "No wheels present"))
- :install/setuptools
- (checkrun :post/detectprefix :python "setup.py" "install" (stropt "--root" destdir) (stropt "--prefix" prefix))
-
-
:post/detectprefix
(do
(if (file/dir-exists? (path/join destdir prefix "local")) (set prefix (path/join prefix "local")))
diff --git a/src/tools.janet b/src/tools.janet
@@ -13,6 +13,7 @@
:jpm ["jpm"]
:go ["go"]
:python ["python" "python3"]
+ :pip ["pip" "pip3"]
:cargo ["cargo"]
:meson ["meson"]
:stow ["stow" "xstow"]))