Skip to content

pip-package. MPV. MME #16

Merged
merged 42 commits into from Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ab26242
manylinux-wheel
achains Dec 8, 2021
9345eb4
Set build tests OFF by default
achains Dec 8, 2021
84d659d
Added dependency to map_metrics_cpp target
achains Dec 8, 2021
c22341f
[quickfix] Allowed git to run scripts from /scripts
achains Dec 8, 2021
f7152c5
Added chmod line in workflow
achains Dec 8, 2021
38cebbd
Specified cpp standard in script
achains Dec 8, 2021
68c9944
quickfix syntax error
achains Dec 8, 2021
9621a6a
Removed parallel jobs
achains Dec 8, 2021
fa36c0a
Explicitly set std=c++17 flag
achains Dec 8, 2021
69804f0
Updated gcc in script
achains Dec 8, 2021
fe56934
Try to pass init value into reduce
achains Dec 8, 2021
a30b117
Replaced reduce with std::accumulate
achains Dec 8, 2021
6de585c
configured setup.py
achains Dec 8, 2021
fa901d4
fixed name in setup.cfg
achains Dec 8, 2021
6b0e8b4
Fixes in setup.py
achains Dec 9, 2021
fcc6cf2
Try to specify package_data lib
achains Dec 9, 2021
c763b0d
__init__.py workaround
achains Dec 10, 2021
f4bfd8f
set build shared cilantro off
achains Dec 10, 2021
4daf567
MORE workaround setup.py
achains Dec 10, 2021
f355ad4
Filled init.py and fixed path to data in python tests
achains Dec 10, 2021
2ef72e8
quickfix initpy
achains Dec 10, 2021
c0e7396
quickfix for quickfix
achains Dec 10, 2021
9316e0c
Fixed tests
achains Dec 10, 2021
5140640
I will squash. Every. Commit. In this branch.
achains Dec 10, 2021
cf4637c
v0.0.3 linux
achains Dec 10, 2021
68748fd
Added windows and osx into wheels.yml
achains Dec 11, 2021
566b7bb
Added build wheels scripts for windows and osx
achains Dec 11, 2021
961af66
Modified setup.py
achains Dec 11, 2021
a467e6d
macos fix build whee;
achains Dec 11, 2021
00254af
Specified std=c++17 for macos
achains Dec 11, 2021
d4b09b1
quickfix wheels.yml
achains Dec 11, 2021
169c4b4
fixed typo in cmake_cxx_standard_required
achains Dec 11, 2021
c2a0c00
try to specify cxx flag in script
achains Dec 11, 2021
16e66ce
changed macosx deployment target 10.14
achains Dec 11, 2021
102e995
Set root_is_pure=False for OSX
achains Dec 11, 2021
1cf614f
Added auditwheel into macOS script, try to repair
achains Dec 12, 2021
003938c
once again try mrob setup.py
achains Dec 12, 2021
812751e
fixed setup error
achains Dec 12, 2021
c37eb39
Fixed macos target version in test_wheel_macos
achains Dec 12, 2021
d8203a9
Returned linux build tests
achains Dec 12, 2021
882b9fa
Returned windows build tests
achains Dec 12, 2021
9320911
Fixed readme
achains Dec 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
284 changes: 284 additions & 0 deletions .github/workflows/wheels.yml
@@ -0,0 +1,284 @@
# # # # # # # # #
# Source: https://github.com/miloserdova-l/mrob/blob/feature/windows-wheel/.github/workflows/wheels.yml
# # # # # # # # #
name: Build wheels

on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: Build map_metrics project
runs-on: ubuntu-latest
env:
PYTHONPATH: ./lib
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: Install required packages from distro
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git build-essential g++ cmake python3-distutils python3-dev python3-numpy python3-pip
python3 -m pip install pytest

- name: Configure and build native map_metrics library with Python bindings
run: |
mkdir -p build
cmake -S $PWD -B $PWD/build \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$PWD/bin \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$PWD/lib \
-DCMAKE_BUILD_TYPE=RELEASE \
&& cmake --build build -j $(nproc)

build_wheel_linux:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
container: quay.io/pypa/manylinux2010_x86_64
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Install additional utils
run: yum install -y git openssh-clients

- uses: actions/checkout@v1

- name: Install fresh CMake into ManyLinux container
run: |
env pybin=$(LANG=C ls -d1r /opt/python/cp3*/bin | head -n 1) bash -c '$pybin/python -m pip install cmake && mkdir -p /usr/local/bin && ln -svf $pybin/cmake /usr/local/bin/cmake'
cmake --version
- name: Build Python wheel
run: |
chmod -R +x scripts/* \
&& scripts/build-wheels-linux.sh

- uses: actions/upload-artifact@v1
with:
name: artifact
path: ./wheelhouse

build_wheel_macOS:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build
strategy:
fail-fast: false
matrix:
os: [ macos-10.15 ]
steps:
- uses: actions/checkout@v2

- name: Git fetch
run: git fetch --prune --unshallow --recurse-submodules=no

- name: Install packages
run: |
brew install coreutils \
&& brew install gcc

- name: Build wheel
run: ./scripts/build-wheels-macOS.sh

- uses: actions/upload-artifact@v2
with:
path: ./dist

build_wheel_windows:
name: Build wheel on ${{ matrix.os }} ${{ matrix.arch }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-2019 ]
arch: [ x64, x86 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Git fetch
run: git fetch --prune --unshallow --recurse-submodules=no

- name: Setup Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
architecture: ${{ matrix.arch }}
- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: ${{ matrix.arch }}
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: ${{ matrix.arch }}
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: ${{ matrix.arch }}
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: ${{ matrix.arch }}

- name: Build wheel
run: .\scripts\build-wheels-windows.cmd ${{ matrix.arch }}
- uses: actions/upload-artifact@v2
with:
path: .\dist

test_wheel_linux:
name: Test Python ${{ matrix.python }} wheel on Linux
runs-on: ubuntu-latest
needs: build_wheel_linux
strategy:
fail-fast: false
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Install map_metrics & numpy
run: |
python -m pip install ./artifact/map_metrics-*-manylinux*.whl numpy pytest
- name: "Python unit tests"
run: |
python -m pytest python

test_wheel_macos:
name: Test Python ${{ matrix.python }} wheel on macOS
runs-on: macos-latest
needs: build_wheel_macos
strategy:
fail-fast: false
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Install map_metrics & numpy
run: |
python -m pip install ./artifact/map_metrics-*-macosx_10_14_x86_64.whl numpy pytest
- name: "Python unit tests"
run: |
python -m pytest python
test_wheel_windows64:
name: Test Python ${{ matrix.python }} wheel on Windows 64bit
runs-on: windows-latest
needs: build_wheel_windows
strategy:
fail-fast: false
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Install map_metrics & numpy
run: |
python -m pip install .\artifact\$(dir artifact -Name | findstr map_metrics-.*-win_amd64.whl) numpy pytest
- name: "Python unit tests"
run: |
python -m pytest python
test_wheel_windows32:
name: Test Python ${{ matrix.python }} wheel on Windows 32bit
runs-on: windows-latest
needs: build_wheel_windows
strategy:
fail-fast: false
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x86

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Install map_metrics & numpy
run: |
python -m pip install .\artifact\$(dir artifact -Name | findstr map_metrics-.*-win32.whl) numpy
- name: "Python unit tests"
run: |
$files = Get-ChildItem -Path python_examples -Include *.py
foreach ($f in $files){
python $f.FullName || EXIT /B !ERRORLEVEL!
}

publish_pypi:
name: Publish wheels to PyPI
needs:
- test_wheel_linux
- test_wheel_macos
- test_wheel_windows64
- test_wheel_windows32
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: artifact/

publish-github-release:
name: Publish wheels to GitHub Releases
needs:
- test_wheel_linux
- test_wheel_macos
- test_wheel_windows64
- test_wheel_windows32
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2

- uses: softprops/action-gh-release@v1
with:
files: artifact/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion AUTHORS.rst
Expand Up @@ -10,4 +10,4 @@ Development Lead
Contributors
------------

None yet. Why not be the first?
* Arthur Saliou a.k.a. "achains" <arthur.salio@gmail.com>
10 changes: 5 additions & 5 deletions CMakeLists.txt
Expand Up @@ -3,12 +3,12 @@ project(map-metrics)

# Compiler prerequisites
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# # # # # # OPTIONS # # # # # #
option(GLIBCXX_USE_CXX11_ABI "Set -D_GLIBCXX_USE_CXX11_ABI=1" OFF)
# Set this flag ON if you want to build tests
option(BUILD_TESTS "Build an executable with tests" ON)
option(BUILD_TESTS "Build an executable with tests" OFF)
# Set this flag ON if you want to build Python library interface
option(BUILD_PYTHON_MODULE "Build the python module" ON)

Expand All @@ -18,10 +18,10 @@ if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()

# By default select Debug build
# By default select Release build
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No CMAKE_BUILD_TYPE specified, default to Debug.")
set(CMAKE_BUILD_TYPE "Debug")
message(STATUS "No CMAKE_BUILD_TYPE specified, default to Release.")
set(CMAKE_BUILD_TYPE "Release")
endif()

# If Build type is Release, then turn on optimizations
Expand Down
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -35,7 +35,7 @@ Features
Our toolkit provides implementation of the next metrics:

* Mean Map Entropy (MME), Mean Plane Variance(MPV) [#]_ [#]_
* Mutually Orthogonal Metric (MOM) [#]_ -- has strong correlation with RPE
* Mutually Orthogonal Metric (MOM) [#]_ -- has strong correlation with RPE **(IN PROGRESS, SEE PREVIOUS VERSIONS)**


Citation
Expand Down