"git@developer.sourcefind.cn:OpenDAS/tilelang.git" did not exist on "0fa033989f40cb54903c53a59efaaada686170a7"
Commit f55defac authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[WHL] Support whl building for different python versions via tox (#83)

* bump version into v0.1.0

* [Enhancement] Add custom develop command for editable installs and update .gitignore

* [Documentation] Update README to include system dependencies installation instructions

* [Build] Update setup.py to support library file copying for both release and develop modes

* [Build] Refactor library file copying logic in setup.py

* [Documentation] Remove unnecessary install section header in Installation.md

* [Build] Add tox configuration and local distribution script for multi-Python version support

* [Build] Improve git submodule update function with better error handling
parent b43ab2dd
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
multi_python_version=("3.8","3.9","3.10" "3.11", "3.12")
for python_version in "${multi_python_version[@]}"; do
echo "Installing Python ${python_version}..."
apt-get install -y python${python_version}
done
pip install -r requirements-build.txt
# if dist and build directories exist, remove them
if [ -d dist ]; then
rm -r dist
fi
# Build source distribution (disabled for now)
# python setup.py sdist --formats=gztar,zip
# Build wheels for different Python versions
echo "Building wheels for multiple Python versions..."
tox -e py38,py39,py310,py311,py312
if [ $? -ne 0 ]; then
echo "Error: Failed to build the wheels."
exit 1
else
echo "Wheels built successfully."
fi
\ No newline at end of file
...@@ -4,3 +4,4 @@ packaging ...@@ -4,3 +4,4 @@ packaging
setuptools>=61 setuptools>=61
torch torch
wheel wheel
tox
...@@ -160,7 +160,21 @@ EXTRACT_PATH = "3rdparty" # Default extraction path ...@@ -160,7 +160,21 @@ EXTRACT_PATH = "3rdparty" # Default extraction path
def update_submodules(): def update_submodules():
"""Updates git submodules.""" """Updates git submodules if in a git repository."""
def is_git_repo():
try:
# Check if current directory is a git repository
subprocess.check_output(["git", "rev-parse", "--is-inside-work-tree"],
stderr=subprocess.STDOUT)
return True
except (subprocess.CalledProcessError, FileNotFoundError):
return False
if not is_git_repo():
print("Info: Not a git repository, skipping submodule update.")
return
try: try:
subprocess.check_call(["git", "submodule", "update", "--init", "--recursive"]) subprocess.check_call(["git", "submodule", "update", "--init", "--recursive"])
except subprocess.CalledProcessError as error: except subprocess.CalledProcessError as error:
......
[tox]
envlist = py38,py39,py310,py311,py312
isolated_build = True
[testenv]
deps =
wheel
build
commands =
python -m build --wheel -o {toxinidir}/dist
[testenv:py38]
basepython = python3.8
[testenv:py39]
basepython = python3.9
[testenv:py310]
basepython = python3.10
[testenv:py311]
basepython = python3.11
[testenv:py312]
basepython = python3.12
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment