use python instead of python3

This commit is contained in:
blueloveTH 2024-02-23 01:34:24 +08:00
parent 0599130c0d
commit 035886b655
6 changed files with 21 additions and 29 deletions

View File

@ -19,7 +19,7 @@ jobs:
- name: Compile
shell: powershell
run: |
python3 amalgamate.py
python amalgamate.py
cd amalgamated
cl.exe /std:c++17 /EHsc /utf-8 /O2 /I. /DPK_ENABLE_OS=1 main.cpp /link /out:pkpy.exe
- uses: actions/upload-artifact@v3
@ -34,16 +34,16 @@ jobs:
shell: bash
run: |
mkdir -p output/windows/x86_64
python3 cmake_build.py
python cmake_build.py
cp main.exe output/windows/x86_64
cp pocketpy.dll output/windows/x86_64
- uses: actions/upload-artifact@v3
with:
path: output
- name: Unit Test
run: python3 scripts/run_tests.py
run: python scripts/run_tests.py
- name: Benchmark
run: python3 scripts/run_tests.py benchmark
run: python scripts/run_tests.py benchmark
build_linux:
runs-on: ubuntu-20.04
steps:
@ -66,7 +66,7 @@ jobs:
- name: Compile
run: |
mkdir -p output/linux/x86_64
python3 cmake_build.py
python cmake_build.py
cp main output/linux/x86_64
cp libpocketpy.so output/linux/x86_64
env:
@ -76,7 +76,7 @@ jobs:
with:
path: output
- name: Benchmark
run: python3 scripts/run_tests.py benchmark
run: python scripts/run_tests.py benchmark
- name: C Binding Test
run: bash run_c_binding_test.sh
build_linux_x86:
@ -91,23 +91,24 @@ jobs:
branch: v3.15
- name: Build and Test
run: |
ln -s /usr/bin/python3 /usr/bin/python
uname -m
python3 cmake_build.py
python3 scripts/run_tests.py
python3 scripts/run_tests.py benchmark
shell: alpine.sh {0}
python cmake_build.py
python scripts/run_tests.py
python scripts/run_tests.py benchmark
shell: alpine.sh --root {0}
build_darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Compile and Test
run: |
python3 cmake_build.py
python3 scripts/run_tests.py
python cmake_build.py
python scripts/run_tests.py
- name: Benchmark
run: python3 scripts/run_tests.py benchmark
run: python scripts/run_tests.py benchmark
- run: |
python3 amalgamate.py
python amalgamate.py
cd plugins/macos/pocketpy
mkdir -p output/macos
xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

View File

@ -1,12 +1,5 @@
#!/bin/bash
# Check if python3 is installed
if ! type -P python3 >/dev/null 2>&1; then
echo "python3 is required and not installed. Kindly install it."
echo "Run: sudo apt install python3"
exit 1
fi
# Check if clang++ is installed
if ! type -P clang++ >/dev/null 2>&1; then
echo "clang++ is required and not installed. Kindly install it."
@ -14,12 +7,11 @@ if ! type -P clang++ >/dev/null 2>&1; then
exit 1
fi
echo "Requirements satisfied: python3 and clang are installed."
echo "It takes a moment to finish building."
echo ""
echo "> Running prebuild.py... "
python3 prebuild.py
python prebuild.py
if [ $? -ne 0 ]; then
echo "prebuild.py failed."

View File

@ -1,4 +1,4 @@
python3 prebuild.py
python prebuild.py
rm -rf web/lib
mkdir web/lib

View File

@ -1,4 +1,4 @@
python3 prebuild.py
python prebuild.py
SRC=$(find src/ -name "*.cpp")
clang++ -pg -O1 -std=c++17 -stdlib=libc++ -Wfatal-errors -o main $SRC src2/main.cpp -Iinclude
time ./main benchmarks/fib.py

View File

@ -1,9 +1,8 @@
python3 prebuild.py
python prebuild.py
SRC=$(find src/ -name "*.cpp")
clang++ -std=c++17 --coverage -O1 -stdlib=libc++ -Wfatal-errors -o main src2/main.cpp $SRC -Iinclude -DPK_ENABLE_OS=1
python3 scripts/run_tests.py
# python3 scripts/run_tests.py benchmarks/
python scripts/run_tests.py
# if prev error exit
if [ $? -ne 0 ]; then

View File

@ -18,7 +18,7 @@ def test_file(filepath, cpython=False):
if cpython:
x, y = os.path.split(filepath)
with WorkDir(x):
return os.system("python3 " + y) == 0
return os.system("python " + y) == 0
if sys.platform == 'win32':
return os.system("main.exe " + filepath) == 0
else: