Skip to content

Commit

Permalink
Merge pull request #43 from anubhav-cs/master
Browse files Browse the repository at this point in the history
Multi python build
  • Loading branch information
anubhav-cs authored Mar 2, 2022
2 parents bd62761 + fc2727b commit 50735f9
Show file tree
Hide file tree
Showing 11 changed files with 571 additions and 189 deletions.
130 changes: 97 additions & 33 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -28,12 +31,13 @@ jobs:
- name: Install platform specific requirements
run: |
sudo apt-get install -y flex bison python3-dev python3 libfl-dev
sudo apt-get install -y flex bison libfl-dev
# python3-dev python3 libfl-dev

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "${{ matrix.py_version }}"

- name: Print GLIBC version
run: ldd --version
Expand Down Expand Up @@ -63,6 +67,7 @@ jobs:
-DCMAKE_SPHINX_DOCS=ON
-DCMAKE_STATIC_BOOST=ON
-DCMAKE_TESTING_ENABLED=ON
-DPY_VERSION="${{ matrix.py_version }}"
- name: Build
# Build your program with the given configuration
Expand All @@ -78,10 +83,16 @@ jobs:
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- uses: jungwinter/split@v2
id: split
with:
msg: ${{ matrix.py_version }}
separator: '.'

- name: Build Pypi Python Package
run: |
cd ${{github.workspace}}/${{env.BUILD_TYPE}}/_package
python3 setup.py bdist_wheel --plat-name=manylinux_2_31_x86_64
python3 setup.py bdist_wheel --python-tag=cp${{ steps.split.outputs._0 }}${{ steps.split.outputs._1 }} --plat-name=manylinux_2_31_x86_64
- name: Pytest
working-directory: ${{github.workspace}}
Expand All @@ -102,6 +113,9 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-18.04
strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -113,12 +127,13 @@ jobs:
- name: Install platform specific requirements
run: |
sudo apt-get install -y flex bison python3-dev python3 libfl-dev
sudo apt-get install -y flex bison libfl-dev
# python3-dev python3

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "${{ matrix.py_version }}"

- name: Print GLIBC version
run: ldd --version
Expand Down Expand Up @@ -150,6 +165,7 @@ jobs:
-DCMAKE_SPHINX_DOCS=OFF
-DCMAKE_STATIC_BOOST=ON
-DCMAKE_TESTING_ENABLED=ON
-DPY_VERSION="${{ matrix.py_version }}"
- name: Build
# Build your program with the given configuration
Expand All @@ -165,10 +181,16 @@ jobs:
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- uses: jungwinter/split@v2
id: split
with:
msg: ${{ matrix.py_version }}
separator: '.'

- name: Build Pypi Python Package
run: |
cd ${{github.workspace}}/${{env.BUILD_TYPE}}/_package
python3 setup.py bdist_wheel --plat-name=manylinux_2_27_x86_64
python3 setup.py bdist_wheel --python-tag=cp${{ steps.split.outputs._0 }}${{ steps.split.outputs._1 }} --plat-name=manylinux_2_27_x86_64
- name: Pytest
working-directory: ${{github.workspace}}
Expand All @@ -189,14 +211,19 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-2019
strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
exclude:
- py_version: "3.6"

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "${{ matrix.py_version }}"

- name: Install pip dependencies
run: |
Expand All @@ -223,6 +250,7 @@ jobs:
-DCMAKE_SPHINX_DOCS=OFF
-DCMAKE_STATIC_BOOST=ON
-DCMAKE_TESTING_ENABLED=ON
-DPY_VERSION="${{ matrix.py_version }}"
- name: Build
# Build your program with the given configuration
Expand All @@ -238,30 +266,43 @@ jobs:
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- name: Split version code
uses: xom9ikk/split@v1
id: split
with:
string: ${{ matrix.py_version }}
separator: .
limit: -1

- name: Build Pypi Python Package
run: |
cd ${{github.workspace}}/${{env.BUILD_TYPE}}/_package
py setup.py bdist_wheel --plat-name=win_amd64
py setup.py bdist_wheel --python-tag=cp${{ steps.split.outputs._0 }}${{ steps.split.outputs._1 }} --plat-name=win_amd64
- name: Pytest
working-directory: ${{github.workspace}}
run: |
pytest
py -m pytest
- name: Lint with flake8
run: |
# DON'T[ANU: To be changed later] stop the build if there are Python syntax errors or undefined names
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
py -m flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
py -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# --------------------------------------------------------------------------- #

build-macos-latest:
build-macos-11:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-latest
runs-on: macos-11
strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
exclude:
- py_version: "3.8"

steps:
- uses: actions/checkout@v2
Expand All @@ -271,14 +312,14 @@ jobs:
rm -rf ${{github.workspace}}/build
rm -rf ${{github.workspace}}/${{env.BUILD_TYPE}}
- name: Install platform specific dependencies
run: |
brew install flex bison python3 libffi
# - name: Install platform specific dependencies
# run: |
# brew install flex bison python3 libffi

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "${{ matrix.py_version }}"

- name: Install pip dependencies
run: |
Expand Down Expand Up @@ -309,6 +350,7 @@ jobs:
-DCMAKE_SPHINX_DOCS=OFF
-DCMAKE_STATIC_BOOST=ON
-DCMAKE_TESTING_ENABLED=ON
-DPY_VERSION="${{ matrix.py_version }}"
- name: Build
# Build your program with the given configuration
Expand All @@ -318,16 +360,24 @@ jobs:
- name: Install Python Package
run: python3 -m pip install ${{github.workspace}}/${{env.BUILD_TYPE}}/_package

# - name: CTest
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest
- name: CTest
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- name: Split version code
uses: xom9ikk/split@v1
id: split
with:
string: ${{ matrix.py_version }}
separator: .
limit: -1

- name: Build Pypi Python Package
run: |
cd ${{github.workspace}}/${{env.BUILD_TYPE}}/_package
python3 setup.py bdist_wheel --plat-name=macosx_11_0_x86_64
python3 setup.py bdist_wheel --python-tag=cp${{ steps.split.outputs._0 }}${{ steps.split.outputs._1 }} --plat-name=macosx_11_0_x86_64
- name: Pytest
working-directory: ${{github.workspace}}
Expand All @@ -348,6 +398,11 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-10.15
strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
exclude:
- py_version: "3.8"

steps:
- uses: actions/checkout@v2
Expand All @@ -357,14 +412,14 @@ jobs:
rm -rf ${{github.workspace}}/build
rm -rf ${{github.workspace}}/${{env.BUILD_TYPE}}
- name: Install platform specific dependencies
run: |
brew install flex bison python3 libffi
# - name: Install platform specific dependencies
# run: |
# brew install flex bison python3 libffi

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "${{ matrix.py_version }}"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -395,6 +450,7 @@ jobs:
-DCMAKE_SPHINX_DOCS=OFF
-DCMAKE_STATIC_BOOST=ON
-DCMAKE_TESTING_ENABLED=ON
-DPY_VERSION="${{ matrix.py_version }}"
- name: Build
# Build your program with the given configuration
Expand All @@ -410,10 +466,18 @@ jobs:
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest

- name: Split version code
uses: xom9ikk/split@v1
id: split
with:
string: ${{ matrix.py_version }}
separator: .
limit: -1

- name: Build Pypi Python Package
run: |
cd ${{github.workspace}}/${{env.BUILD_TYPE}}/_package
python3 setup.py bdist_wheel --plat-name=macosx_10_15_x86_64
python3 setup.py bdist_wheel --python-tag=cp${{ steps.split.outputs._0 }}${{ steps.split.outputs._1 }} --plat-name=macosx_10_15_x86_64
- name: Pytest
working-directory: ${{github.workspace}}
Expand Down
Loading

0 comments on commit 50735f9

Please sign in to comment.