Skip to content

Commit

Permalink
Merge branch 'vb/pypi_release' into develop, bump version to v1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pvl-bot committed Dec 20, 2024
2 parents 1af97fd + be0b143 commit 7744dc9
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 25 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Build & Release

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main

jobs:
build_sdist_purepy:
name: Build source/pure python wheels
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build source/pure python wheels
run: |
python -m pip install build
python -m build --outdir=wheelhouse
env:
INFINIGEN_MINIMAL_INSTALL: "True"

- name: Upload to github
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*
if-no-files-found: error

build_wheels:
name: Build wheel on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# we skip Windows since that results in pure Python wheels
# anyway; (compile_terrain.sh is not supported on Windows)
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-latest
cibw_archs: "aarch64"
- os: macos-13
cibw_archs: "x86_64"
- os: macos-latest
cibw_archs: "arm64"

steps:
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install libomp
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV
- name: Set CXXFLAGS and LDFLAGS for macOS
if: matrix.os == 'macos-13'
run: |
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
echo "CXXFLAGS=-I/usr/local/opt/libomp/include" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp" >> $GITHUB_ENV
- name: Set CXXFLAGS and LDFLAGS for macOS
if: matrix.os == 'macos-latest'
run: |
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
echo "CXXFLAGS=-I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: "cp311-*"
# `bpy` is not easily pip-installable on manylinux (no sdists either),
# so we skip tests
CIBW_TEST_COMMAND: ""
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT:
CXXFLAGS="${{ env.CXXFLAGS }}"
LDFLAGS="${{ env.LDFLAGS }}"

- name: Upload artifacts to github
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.cibw_archs }}
path: ./wheelhouse/*.whl
if-no-files-found: error

publish_to_pypi:
name: Publish wheels to PyPi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [build_sdist_purepy, build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- name: Upload wheels to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install --upgrade twine
twine upload dist/*
13 changes: 12 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,15 @@ v1.11.2

v1.11.3
- Increase max camera / object animation random walk trials
- Fix scenetype gin recognition causing crashes for underwater.gin / kelpforest.gin
- Fix scenetype gin recognition causing crashes for underwater.gin / kelpforest.gin

v1.11.4
- Fix circular / segfaulting imports when modules imported individually
- Fix ordering-dependence in unit tests
- Fix scenetype.gin crashes for underwater/kelpforest
- Increase integration test timelimit
- Add `analyze_crash_reasons` crash summary script
- Improve success rate of camera / creature animations via increased retry attempts

v1.12.0
- Publish to PyPi
2 changes: 1 addition & 1 deletion infinigen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
from pathlib import Path

__version__ = "1.11.4"
__version__ = "1.12.0"


def repo_root():
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ keywords = [
"procedural"
]
classifiers = [
"Framework :: Blender",
"Programming Language :: Python :: 3",
]

Expand Down
40 changes: 19 additions & 21 deletions scripts/install/compile_terrain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,26 @@ fi
OS=$(uname -s)
ARCH=$(uname -m)

if [ "${OS}" = "Linux" ]; then
alias gx1="g++ -O3 -c -fpic -fopenmp "
alias gx2="g++ -O3 -shared -fopenmp "
elif [ "${OS}" = "Darwin" ]; then
if [ "${ARCH}" = "arm64" ]; then
compiler="/opt/homebrew/opt/llvm/bin/clang++"
if [ -n "$CXX" ]; then
compiler="$CXX"
else
if [ "${OS}" = "Linux" ]; then
compiler="g++"
elif [ "${OS}" = "Darwin" ]; then
if [ "${ARCH}" = "arm64" ]; then
compiler="/opt/homebrew/opt/llvm/bin/clang++"
else
compiler="/usr/local/opt/llvm/bin/clang++"
fi
else
compiler="/usr/local/opt/llvm/bin/clang++"
echo "Unsupported OS"
exit -1
fi
alias gx1="${compiler} -O3 -c -fpic -fopenmp "
alias gx2="${compiler} -O3 -shared -fopenmp "
alias gx="${compiler} -O3 -fpic -shared -fopenmp "
else
echo "Unsupported OS"
exit -1
fi

alias gx1="${compiler} \$CXXFLAGS -O3 -c -fpic -fopenmp "
alias gx2="${compiler} \$LDFLAGS -O3 -shared -fopenmp "

mkdir -p lib/cpu/utils
gx1 -o lib/cpu/utils/FastNoiseLite.o source/cpu/utils/FastNoiseLite.cpp
gx2 -o lib/cpu/utils/FastNoiseLite.so lib/cpu/utils/FastNoiseLite.o
Expand Down Expand Up @@ -121,16 +124,11 @@ gx2 -o lib/cpu/meshing/utils.so lib/cpu/meshing/utils.o
echo "compiled lib/cpu/meshing/utils.so"

if [ "${OS}" = "Darwin" ]; then
if [ "${ARCH}" = "arm64" ]; then
alias gx1="CPATH=/opt/homebrew/include:${CPATH} g++ -O3 -c -fpic -std=c++17"
alias gx2="CPATH=/opt/homebrew/include:${CPATH} g++ -O3 -shared -std=c++17"
else
alias gx1="CPATH=/usr/local/include:${CPATH} g++ -O3 -c -fpic -std=c++17"
alias gx2="CPATH=/usr/local/include:${CPATH} g++ -O3 -shared -std=c++17"
fi
alias gx1="CPATH=/opt/homebrew/include:${CPATH} ${compiler} -O3 -c -fpic -std=c++17"
alias gx2="CPATH=/opt/homebrew/include:${CPATH} ${compiler} -O3 -shared -std=c++17"
fi
mkdir -p lib/cpu/soil_machine
gx1 -o lib/cpu/soil_machine/SoilMachine.o source/cpu/soil_machine/SoilMachine.cpp
gx1 -I../datagen/customgt/dependencies/glm -o lib/cpu/soil_machine/SoilMachine.o source/cpu/soil_machine/SoilMachine.cpp
gx2 -o lib/cpu/soil_machine/SoilMachine.so lib/cpu/soil_machine/SoilMachine.o
echo "compiled lib/cpu/soil_machine/SoilMachine.so"

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def ensure_submodules():
)


ensure_submodules()
if not MINIMAL_INSTALL:
ensure_submodules()

# inspired by https://github.com/pytorch/pytorch/blob/161ea463e690dcb91a30faacbf7d100b98524b6b/setup.py#L290
# theirs seems to not exclude dist_info but this causes duplicate compiling in my tests
Expand Down

0 comments on commit 7744dc9

Please sign in to comment.