Compare commits
2 Commits
raylib-uni
...
acados/v0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9dd627e57 | ||
|
|
058ed3c076 |
@@ -43,9 +43,14 @@ class InstallPrebuilt(build_py):
|
||||
if plat is None:
|
||||
raise RuntimeError(f"unsupported platform: {key}")
|
||||
|
||||
whl_name = f"{MODULE}-{VERSION}-py3-none-{plat}.whl"
|
||||
url = f"{REPO_URL}/releases/download/{TAG}/{whl_name}"
|
||||
whl_names = [
|
||||
f"{MODULE}-{VERSION}-py3-none-{plat}.whl",
|
||||
f"{MODULE}-{VERSION}-py3-none-any.whl",
|
||||
]
|
||||
|
||||
raw = None
|
||||
for whl_name in whl_names:
|
||||
url = f"{REPO_URL}/releases/download/{TAG}/{whl_name}"
|
||||
print(f"Downloading {url} ...")
|
||||
for attempt in range(3):
|
||||
try:
|
||||
@@ -53,10 +58,14 @@ class InstallPrebuilt(build_py):
|
||||
break
|
||||
except (URLError, OSError) as e:
|
||||
if attempt == 2:
|
||||
if whl_name == whl_names[-1]:
|
||||
raise
|
||||
break
|
||||
wait = 2 ** attempt
|
||||
print(f"Download failed ({e}), retrying in {wait}s ...")
|
||||
time.sleep(wait)
|
||||
if raw is not None:
|
||||
break
|
||||
|
||||
print(f"Extracting {DATADIR} ...")
|
||||
with zipfile.ZipFile(BytesIO(raw)) as zf:
|
||||
|
||||
22
catch2/build.sh
Executable file
22
catch2/build.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
cd "$DIR"
|
||||
|
||||
VERSION="v2.13.10"
|
||||
INSTALL_DIR="$DIR/catch2/install"
|
||||
|
||||
if [ ! -d "catch2-src/.git" ]; then
|
||||
rm -rf catch2-src
|
||||
git clone --depth 1 https://github.com/catchorg/Catch2.git catch2-src
|
||||
fi
|
||||
git -C catch2-src fetch --depth 1 origin "$VERSION"
|
||||
git -C catch2-src checkout --force FETCH_HEAD
|
||||
|
||||
rm -rf "$INSTALL_DIR"
|
||||
mkdir -p "$INSTALL_DIR/include"
|
||||
cp -r catch2-src/single_include/catch2 "$INSTALL_DIR/include/"
|
||||
|
||||
echo "Installed catch2 to $INSTALL_DIR"
|
||||
du -sh "$INSTALL_DIR"
|
||||
9
catch2/catch2/__init__.py
Normal file
9
catch2/catch2/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import os
|
||||
|
||||
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||
LIB_DIR = DIR # header-only; no libraries
|
||||
|
||||
|
||||
def smoketest():
|
||||
assert os.path.isfile(os.path.join(INCLUDE_DIR, "catch2", "catch.hpp")), "catch2/catch.hpp not found"
|
||||
16
catch2/pyproject.toml
Normal file
16
catch2/pyproject.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=64", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "catch2"
|
||||
version = "2.13.10"
|
||||
description = "Catch2 C++ test framework headers"
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["catch2*"]
|
||||
exclude = ["catch2-src*"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
catch2 = ["install/**/*"]
|
||||
28
catch2/setup.py
Normal file
28
catch2/setup.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from setuptools.command.build_py import build_py
|
||||
|
||||
|
||||
class BuildCatch2(build_py):
|
||||
"""Run build.sh to download Catch2 headers before collecting package data."""
|
||||
|
||||
def run(self):
|
||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
build_script = os.path.join(pkg_dir, "build.sh")
|
||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||
|
||||
super().run()
|
||||
|
||||
|
||||
cmdclass = {"build_py": BuildCatch2}
|
||||
|
||||
|
||||
def setup():
|
||||
from setuptools import setup as _setup
|
||||
|
||||
_setup(cmdclass=cmdclass)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup()
|
||||
@@ -2,6 +2,7 @@
|
||||
members = [
|
||||
"bzip2",
|
||||
"capnproto",
|
||||
"catch2",
|
||||
"cppcheck",
|
||||
"eigen",
|
||||
"ffmpeg",
|
||||
|
||||
Reference in New Issue
Block a user