From 10d30fd9a8da16fd60dbc3954dfd3cdc51e62fe0 Mon Sep 17 00:00:00 2001 From: AllSeeingEyeTolledEweSew Date: Wed, 16 Dec 2020 19:57:47 +0000 Subject: [PATCH] Unify python setuptools workflow. --- .github/workflows/linux.yml | 26 -------------------------- .github/workflows/macos.yml | 30 +++--------------------------- .github/workflows/python.yml | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c4a5d964574..7b5a7726254 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -165,32 +165,6 @@ jobs: cd simulation b2 -j2 debug-iterators=on invariant-checks=full asserts=on picker-debugging=on - - - python: - name: Python bindings - runs-on: ubuntu-20.04 - - steps: - - name: checkout - uses: actions/checkout@v2.3.3 - with: - submodules: recursive - - - name: install dependencies - run: | - sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev python3 - - - name: build python module - run: | - cd bindings/python - python3 setup.py build_ext --libtorrent-link=static install --user - - - name: run python tests - run: | - cd bindings/python - python3 test.py - dist: name: build dist runs-on: ubuntu-20.04 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4b64b521573..119f7f2d669 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -83,8 +83,8 @@ jobs: b2 ${{ matrix.config }} -j2 -l400 cxxstd=11 - python_setuptools: - name: Python bindings (setup.py) + python: + name: Python bindings runs-on: macos-latest steps: @@ -93,31 +93,7 @@ jobs: with: submodules: recursive - - name: install dependencies - run: | - brew install boost-build boost boost-python3 python@3.9 - - - name: build and install python module - run: | - cd bindings/python - /usr/local/opt/python@3.9/bin/python3.9 setup.py build_ext -j3 --libtorrent-link=static install - - - name: run python tests - run: | - cd bindings/python - /usr/local/opt/python@3.9/bin/python3.9 test.py - - python_b2: - name: Python bindings (boost-build) - runs-on: macos-latest - - steps: - - name: checkout - uses: actions/checkout@v2.3.3 - with: - submodules: recursive - - - name: install dependencies + - name: install boost run: | brew install boost-build boost boost-python3 python@3.9 export PYTHON_INCLUDE=`echo /usr/local/Cellar/python@3.9/*/Frameworks/Python.framework/Versions/3.9/include/python3.9` ; diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000000..4d3779b52b9 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,36 @@ +name: Python bindings +on: [push, pull_request] + +jobs: + build: + name: build and test python bindings using setuptools + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: install dependencies (mac) + if: runner.os == 'macOS' + run: | + brew install boost-build boost boost-python3 python@3.9 + + - name: install dependencies (linux) + if: runner.os == 'Linux' + run: | + sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev python3 python3-setuptools + + - name: build and install python module + run: | + cd bindings/python + python3 setup.py build_ext -j3 --libtorrent-link=static install --user + + - name: run python tests + run: | + cd bindings/python + python3 test.py