Skip to content

Commit 9548ddb

Browse files
committed
cleanup clean_code, remove repo_dir, checkout OpenBLAS commit in ci-before-build.sh
1 parent d386f0e commit 9548ddb

File tree

7 files changed

+17
-40
lines changed

7 files changed

+17
-40
lines changed

.github/workflows/posix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
- cron: '0 0 * * 0'
1111

1212
env:
13-
REPO_DIR: OpenBLAS
1413
OPENBLAS_COMMIT: "v0.3.30"
1514
MACOSX_DEPLOYMENT_TARGET: 10.9
1615

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ env:
33
# The archive that gets built has name from ``git describe`` on this
44
# commit.
55
- OPENBLAS_COMMIT: "v0.3.30"
6-
- REPO_DIR=OpenBLAS
76

87
dist: jammy
98
services: docker
@@ -43,9 +42,9 @@ install:
4342
# Maybe get and clean and patch source
4443
- |
4544
if [ ${TRAVIS_EVENT_TYPE} == "cron" ]; then
46-
clean_code_local $REPO_DIR develop
45+
clean_code develop
4746
else
48-
clean_code_local $REPO_DIR $OPENBLAS_COMMIT
47+
clean_code $OPENBLAS_COMMIT
4948
fi
5049
echo done install step
5150

build-openblas.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,14 @@ source tools/build_steps.sh
4747
echo "------ BEFORE BUILD ---------"
4848
before_build
4949

50-
function clean_code {
51-
local repo_dir=${1:-$REPO_DIR}
52-
local build_commit=${2:-$BUILD_COMMIT}
53-
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
54-
[ -z "$build_commit" ] && echo "build_commit not defined" && exit 1
55-
# The package $repo_dir may be a submodule. git submodules do not
56-
# have a .git directory. If $repo_dir is copied around, tools like
57-
# Versioneer which require that it be a git repository are unable
58-
# to determine the version. Give submodule proper git directory
59-
(cd $repo_dir \
60-
&& git fetch origin --tags \
61-
&& git checkout $build_commit \
62-
&& git clean -fxd \
63-
&& git reset --hard \
64-
&& git submodule update --init --recursive)
65-
}
66-
67-
6850
if [[ "$NIGHTLY" = "true" ]]; then
6951
echo "------ CLEAN CODE --------"
70-
clean_code $REPO_DIR develop
52+
clean_code develop
7153
echo "------ BUILD LIB --------"
7254
build_lib "$PLAT" "$INTERFACE64" "1"
7355
else
7456
echo "------ CLEAN CODE --------"
75-
clean_code $REPO_DIR $OPENBLAS_COMMIT
57+
clean_code $OPENBLAS_COMMIT
7658
echo "------ BUILD LIB --------"
7759
build_lib "$PLAT" "$INTERFACE64" "0"
7860
fi

ci-before-build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
set -xe
4848

4949
if [[ "$NIGHTLY" = "true" ]]; then
50+
pushd OpenBLAS
51+
git checkout develop
5052
# Set the pyproject.toml version: convert v0.3.24-30-g138ed79f to 0.3.34.30
51-
version=$(cd OpenBLAS && git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g")
53+
version=$(git describe --tags --abbrev=8 | sed -e "s/^v\(.*\)-g.*/\1/" | sed -e "s/-/./g")
54+
popd
5255
sed -e "s/^version = .*/version = \"${version}\"/" -i.bak pyproject.toml
5356
fi
5457

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "scipy-openblas64"
1111
# v0.3.30
12-
version = "0.3.30.0.4"
12+
version = "0.3.30.0.5"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"
@@ -45,7 +45,6 @@ before-build = "bash ci-before-build.sh"
4545
repair-wheel-command = "bash ci-repair-wheel.sh {dest_dir} {wheel}"
4646
test-command = "cd {package} && bash ci-test.sh "
4747
environment-pass = [
48-
"REPO_DIR",
4948
"OPENBLAS_COMMIT",
5049
"MACOSX_DEPLOYMENT_TARGET",
5150
"NIGHTLY",

tools/build_steps.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,18 @@ function before_build {
4848
fi
4949
}
5050

51-
function clean_code_local {
51+
function clean_code {
5252
set -ex
5353
# Copied from common_utils.sh, with added debugging
54-
local repo_dir=${1:-$REPO_DIR}
55-
local build_commit=${2:-$BUILD_COMMIT}
56-
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
54+
local build_commit=$1
5755
[ -z "$build_commit" ] && echo "build_commit not defined" && exit 1
58-
pushd $repo_dir
59-
echo in $repo_dir
56+
pushd OpenBLAS
6057
git fetch origin --tags
6158
echo after git fetch origin
6259
git checkout $build_commit
6360
echo after git checkout $build_commit
6461
git clean -fxd
6562
echo after git clean
66-
git reset --hard
67-
echo after git reset
6863
git submodule update --init --recursive
6964
echo after git submodule update
7065
popd

tools/local_build.sh

100644100755
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ else
2323
# export PLAT=arm64
2424
export SUFFIX=gf_c469a42
2525
fi
26-
export REPO_DIR=OpenBLAS
27-
export OPENBLAS_COMMIT="develop"
26+
export OPENBLAS_COMMIT="v0.3.30"
2827

2928
# export MB_ML_LIBC=musllinux
3029
# export MB_ML_VER=_1_2
3130
# export MB_ML_VER=2014
3231
export INTERFACE64=1
33-
# export BUILD_PREFIX=/tmp/openblas
34-
# mkdir -p $BUILD_PREFIX
32+
export BUILD_PREFIX=/tmp/openblas
33+
mkdir -p $BUILD_PREFIX
3534

36-
bash ./build-openblas.sh
35+
ROOT_DIR=$(dirname $(dirname $0))
36+
bash ${ROOT_DIR}/build-openblas.sh

0 commit comments

Comments
 (0)