File: 001.use-local-bats-repository.patch

package info (click to toggle)
pyenv 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 8,176 kB
  • sloc: sh: 4,727; python: 402; makefile: 70; ansic: 60
file content (41 lines) | stat: -rw-r--r-- 1,279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: Avoid repeated download from BATS repository, using local repository if available
Author: Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com>
Forwarded: not-needed
Last-Update: 2024-12-10

Index: pyenv/Makefile
===================================================================
--- pyenv.orig/Makefile
+++ pyenv/Makefile
@@ -6,12 +6,20 @@ unexport PYTHON_CONFIGURE_OPTS
 
 test: test-unit test-plugin
 
-test-unit: bats
-	PATH="./bats/bin:$$PATH" test/run
-	
-test-plugin: bats
-	cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+--tap} test
+test-unit:
+	@which $(BATS_PATH)/bats > /dev/null
+	PATH="$(BATS_PATH):$$PATH" $(TEST_UNIT_DIR)/run
 
+
+test-plugin:
+	@which $(BATS_PATH)/bats > /dev/null
+	PATH="$(BATS_PATH):$$PATH" $(BATS_PATH)/bats $${CI:+--tap} $(TEST_PLUGIN_DIR)
+
+
+BATS_PATH ?= /usr/bin
+BATS_LIB_PATH ?= /usr/lib/bats-core
+TEST_UNIT_DIR ?= test
+TEST_PLUGIN_DIR ?= plugins/python-build/test
 PYTHON_BUILD_ROOT := $(CURDIR)/plugins/python-build
 PYTHON_BUILD_OPTS ?= --verbose
 PYTHON_BUILD_VERSION ?= 3.8-dev
@@ -26,4 +34,4 @@ test-build:
 	$(PYTHON_BUILD_TEST_PREFIX)/bin/pip -V
 
 bats:
-	git clone --depth 1 --branch v1.2.0 https://github.com/bats-core/bats-core.git bats
+	@echo "Using existing bats installation in $(BATS_PATH)"