diff --git a/.github/actions/build-manylinux/python2.7/build_alembic.sh b/.github/actions/build-manylinux/python2.7/build_alembic.sh index 510b749a..dd1cbc14 100644 --- a/.github/actions/build-manylinux/python2.7/build_alembic.sh +++ b/.github/actions/build-manylinux/python2.7/build_alembic.sh @@ -12,7 +12,7 @@ cd /home/ # Download and build dependencies of alembic # Download, build and install python -wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz +wget --no-check-certificate https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz tar -xzf Python-2.7.18.tgz cd Python-2.7.18 ./configure --enable-optimizations --enable-shared --enable-unicode=ucs4 @@ -23,7 +23,7 @@ python2.7 get-pip.py python2.7 -m pip install numpy # Boost 1.55 -wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download -O boost.tar.gz +wget --no-check-certificate https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download -O boost.tar.gz tar -xzf boost.tar.gz cd boost_1_55_0 ./bootstrap.sh --with-libraries=program_options,python --with-python=/usr/local/bin/python2.7 @@ -31,7 +31,7 @@ cd boost_1_55_0 cd .. && rm -rf boost_1_55_0 boost.tar.gz # Ilmbase -wget http://download.savannah.gnu.org/releases/openexr/ilmbase-2.2.0.tar.gz +wget --no-check-certificate http://download.savannah.gnu.org/releases/openexr/ilmbase-2.2.0.tar.gz tar -xzf ilmbase-2.2.0.tar.gz cd ilmbase-2.2.0 ./configure @@ -39,7 +39,7 @@ make install -j 4 cd .. && rm -rf ilmbase-2.2.0 ilmbase.2.2.0.tar.gz # PyIlmBase -wget http://download.savannah.gnu.org/releases/openexr/pyilmbase-2.2.0.tar.gz +wget --no-check-certificate http://download.savannah.gnu.org/releases/openexr/pyilmbase-2.2.0.tar.gz tar -xzf pyilmbase-2.2.0.tar.gz cd pyilmbase-2.2.0 PYTHON=/usr/local/bin/python2.7 ./configure @@ -47,7 +47,7 @@ make -j 4 && make install cd .. && rm -rf pyilmbase-2.2.0 pyilmbase.2.2.0.tar.gz # Build cmake 3.20 -wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz +wget --no-check-certificate https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz tar -xzf cmake-3.20.0.tar.gz cd cmake-3.20.0 ./bootstrap @@ -61,7 +61,7 @@ python2.7 setup.py bdist_wheel find . -type f -iname "*-linux*.whl" -execdir sh -c "auditwheel repair '{}' -w ./ --plat '${PLAT}' || { echo 'Repairing wheels failed.'; auditwheel show '{}'; exit 1; }" \; # Install our wheel -WHEEL=$(find . -type f -iname "*-manylinux*.whl") +WHEEL=$(find . -type f -iname "*-linux*.whl") echo "Successfully built wheel, running a test pip install: $WHEEL" python2.7 -m pip install "$WHEEL" diff --git a/.github/actions/build-manylinux/python3.7/build_alembic.sh b/.github/actions/build-manylinux/python3.7/build_alembic.sh index 3c372bac..5a31fc23 100644 --- a/.github/actions/build-manylinux/python3.7/build_alembic.sh +++ b/.github/actions/build-manylinux/python3.7/build_alembic.sh @@ -8,11 +8,21 @@ cd /github/workspace/ # Default location of packages in docker action python3.7 setup.py bdist_wheel python3.7 -m pip show alembic +# Patchelf 0.14.5 +wget --no-check-certificate https://github.com/NixOS/patchelf/releases/download/0.14.5/patchelf-0.14.5.tar.gz +tar -xzf patchelf-0.14.5.tar.gz +cd patchelf-0.14.5 +./configure +make -j 4 && make install + +# Return to default location docker action +cd /github/workspace/ + # Bundle external shared libraries into the wheels find . -type f -iname "*-linux*.whl" -execdir sh -c "auditwheel repair '{}' -w ./ --plat '${PLAT}' || { echo 'Repairing wheels failed.'; auditwheel show '{}'; exit 1; }" \; # Install our wheel -WHEEL=$(find . -type f -iname "*-manylinux*.whl") +WHEEL=$(find . -type f -iname "*-linux*.whl") echo "Successfully built wheel, running a test pip install: $WHEEL" python3.7 -m pip install --force-reinstall "$WHEEL" diff --git a/.github/actions/build-manylinux/python3.9/Dockerfile b/.github/actions/build-manylinux/python3.9/Dockerfile new file mode 100644 index 00000000..1defdf98 --- /dev/null +++ b/.github/actions/build-manylinux/python3.9/Dockerfile @@ -0,0 +1,22 @@ +FROM aswf/ci-usd:2022.4 + +# install auditwheel and dependency +RUN yum install -y patchelf +RUN pip install auditwheel + +# build imath dependency (although this comes with ci-usd so should be unnecessary) +RUN git clone --depth 1 --branch v3.0.4 https://github.com/AcademySoftwareFoundation/Imath.git /Imath +RUN mkdir /imathbuild +RUN cd /imathbuild +RUN cmake /Imath -DPYTHON=ON +RUN make +RUN make install + +# Setup dev environment +ENV PLAT manylinux_2_17_x86_64 + +# Copy build script and build +COPY build_alembic.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/.github/actions/build-manylinux/python3.9/build-manylinux.yml b/.github/actions/build-manylinux/python3.9/build-manylinux.yml new file mode 100644 index 00000000..0a41c239 --- /dev/null +++ b/.github/actions/build-manylinux/python3.9/build-manylinux.yml @@ -0,0 +1,7 @@ +# action.yml +name: 'Python 3.9 Manylinux Wheel' +author: 'Stefan Jeske, Max Last' +description: 'Build manylinux wheels for a Python package' +runs: + using: 'docker' + image: 'Dockerfile' \ No newline at end of file diff --git a/.github/actions/build-manylinux/python3.9/build_alembic.sh b/.github/actions/build-manylinux/python3.9/build_alembic.sh new file mode 100644 index 00000000..64b4c190 --- /dev/null +++ b/.github/actions/build-manylinux/python3.9/build_alembic.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Debugging options +set -e -x + +# Build Alembic +cd /github/workspace/ # Default location of packages in docker action +python3.9 setup.py bdist_wheel +python3.9 -m pip show alembic + +# Patchelf 0.14.5 +wget --no-check-certificate https://github.com/NixOS/patchelf/releases/download/0.14.5/patchelf-0.14.5.tar.gz +tar -xzf patchelf-0.14.5.tar.gz +cd patchelf-0.14.5 +./configure +make -j 4 && make install + +# Return to default location docker action +cd /github/workspace/ + +# Bundle external shared libraries into the wheels +find . -type f -iname "*-linux*.whl" -execdir sh -c "auditwheel repair '{}' -w ./ --plat '${PLAT}' || { echo 'Repairing wheels failed.'; auditwheel show '{}'; exit 1; }" \; + +# Install our wheel +WHEEL=$(find . -type f -iname "*-linux*.whl") +echo "Successfully built wheel, running a test pip install: $WHEEL" +python3.9 -m pip install --force-reinstall "$WHEEL" + +python3.9 -m pip show alembic + +echo "$PYTHONPATH" + +# make sure python has access to the alembic libraries +export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.9/site-packages + +# Run tests before releasing build +cd ./python/PyAlembic/Tests +python3.9 -m unittest discover \ No newline at end of file diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b0d112ba..79c2c387 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -20,4 +20,13 @@ jobs: - uses: actions/upload-artifact@v2 with: name: python3.7wheel + path: dist/*-manylinux*.whl + py39: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/build-manylinux/python3.9 + - uses: actions/upload-artifact@v2 + with: + name: python3.9wheel path: dist/*-manylinux*.whl \ No newline at end of file diff --git a/setup.py b/setup.py index e05ba205..7b91ff3f 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,7 @@ def build_extension(self, ext): if missing_packages: error = "Unable to find packages: %s" % missing_packages - raise Exception(error) + # raise Exception(error) # build cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,