Skip to content

Commit

Permalink
Moved pydp folder under src (#332)
Browse files Browse the repository at this point in the history
* added installation for clang-format in docker file

* moved pydp folver under src

* moved pydp folver under src

* moved pydp folver under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* moved pydp folder under src

* Explicitly tell pybind which python to use

* Fix CI tests

* removed bin files

* Install and test wheel in a different job

* Split py35 tests

* Include package from src

* Add macos wheel fix

Co-authored-by: Alejandro Sánchez Medina <[email protected]>
  • Loading branch information
siddhesh1598 and alejandrosame authored Dec 18, 2020
1 parent dbf75ee commit b423675
Show file tree
Hide file tree
Showing 27 changed files with 416 additions and 91 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pypipublish_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ jobs:
run: |
bazel build --config Linux src/python:bindings_test --verbose_failures
rm -f _pydp.so
cp -f ./bazel-bin/src/bindings/_pydp.so ./pydp
cp -f ./bazel-bin/src/bindings/_pydp.so ./src/pydp
- name: Build wheel
run: |
python setup.py bdist_wheel
- name: Check the wheel
run: |
twine check dist/*
- name: Renaming wheel
run: |
find . -name '*linux*.whl' -type f -exec bash -c 'mv "$1" "${1/linux/manylinux1}"' -- {} \;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypipublish_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
bazel build --config macOS src/python:bindings_test --verbose_failures
rm -f _pydp.so
cp -f ./bazel-bin/src/bindings/_pydp.so ./pydp
cp -f ./bazel-bin/src/bindings/_pydp.so ./src/pydp
- name: Build wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypipublish_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build PyDP
run: |
bazel build --cxxopt='/std:c++17' src/python:bindings_test --verbose_failures
copy bazel-bin\src\bindings\_pydp.so pydp\_pydp.pyd
copy bazel-bin\src\bindings\_pydp.so src\pydp\_pydp.pyd
python setup.py bdist_wheel
$version=(python -c "import pydp; print(pydp.__version__)")
echo "::set-output name=version::$version"
Expand Down
169 changes: 169 additions & 0 deletions .github/workflows/tests-py35.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Tests-py35

on:
push:
branches:
- master, dev
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# max-parallel: 6
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.5]

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Setup Bazel
uses: abhinavsingh/setup-bazel@v3

- name: Set up packages
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel pytest gcovr coverage twine==1.15.0
- name: Build PyDP with coverage (Unix)
if: runner.os != 'Windows'
# --expunge is needed as there is an intermittent error on macOS for which this seems to be the solution
# Ref: https://github.com/bazelbuild/rules_go/issues/2221
run: |
bazel clean --expunge
./build_PyDP.sh
- name: Build PyDP with coverage (Windows)
if: runner.os == 'Windows'
run: |
bazel clean --expunge
$PYTHONHOME=$(python -c 'import sys; print(sys.executable);').Replace('\', '/')
$PYTHONPATH=$(python -c "import sys; print([x for x in sys.path if 'site-packages' in x][0]);").Replace('\', '/')
echo "PYTHONHOME=$PYTHONHOME"
echo "PYTHONPATH=$PYTHONPATH"
bazel build src/python:bindings_test `
--config Windows `
--verbose_failures `
--action_env=PYTHON_BIN_PATH=$PYTHONHOME `
--action_env=PYTHON_LIB_PATH=$PYTHONPATH
copy bazel-bin\src\bindings\_pydp.so src\pydp\_pydp.pyd
- name: Make wheel (linux and windows)
if: runner.os != 'macOS'
run: |
python setup.py sdist
python setup.py bdist_wheel
- name: Make wheel (macOS)
if: runner.os == 'macOS'
run: |
python setup.py sdist
python setup.py bdist_wheel --plat-name macosx_10_15_x86_64
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v2
with:
name: dist-${{matrix.os}}-${{matrix.python-version}}
path: dist
retention-days: 3

- name: Upload test folder as artifact
uses: actions/upload-artifact@v2
with:
name: tests-${{matrix.os}}-${{matrix.python-version}}
path: tests
retention-days: 3

- name: Mypy test
run: |
python -m pip install mypy
mypy tests/ src/pydp/
mypy examples/Tutorial_1-carrots_demo
mypy examples/Tutorial_2-restaurant_demo
####################################################################
#####
####################################################################

# Currently failing
# poetry run mypy examples/Tutorial_3-Titanic_demo

# Need to see how to run the c++ code coverage
# - name: Check C++ code coverage
# if: runner.os == 'Linux' # Coverage will be the same on all systems so only running the check on Linux
# run: |
# make check-coverage-cpp

fresh-wheel-install:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.5]
timeout-minutes: 35

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install needed packages
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel pytest gcovr coverage twine==1.15.0
python -m pip install matplotlib
python -m pip install seaborn
python -m pip install coverage
- name: Download dist folder as artifact
uses: actions/download-artifact@v1
with:
name: dist-${{matrix.os}}-${{matrix.python-version}}
path: dist

- name: Download test folder as artifact
uses: actions/download-artifact@v1
with:
name: tests-${{matrix.os}}-${{matrix.python-version}}
path: tests

- name: Install PyDP wheel (Unix)
if: runner.os != 'Windows'
run: |
python -m pip install --upgrade --force-reinstall ./dist/*.whl
- name: Install PyDP wheel (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade --force-reinstall (get-item .\dist\*.whl)
- name: Run tests
run: |
coverage run -m pytest tests
- name: Check Python code coverage
if: runner.os == 'Linux' # Coverage will be the same on all systems so only running the check on Linux
run: |
coverage report --fail-under ${MIN_COVERAGE}
env:
MIN_COVERAGE: 75
Loading

0 comments on commit b423675

Please sign in to comment.