Skip to content

Commit

Permalink
Updating dependencies to run with more recent versions of python (#7)
Browse files Browse the repository at this point in the history
* first commit

* wip

* change python versions and poetry

* change cmake version

* change python version

* change python version

* tf version for build

* tf version

* tf version

* debugging with gpt

* debugging with gpt v2

* debugging with gpt v3

* update mypy

* forgot the lock

* black changes

* versioning

* update pyproject

* ignore banded mypy

* temporary fix: skip test

* black

* putting header back

* poetry task fix / rm setup.py / more python tested upon push

* minor

* change tensorflow version range

* forgot the lock

* changing tf version

* update poetry

* update worflow to force the lock to be regenerate

* update worflow to force the lock to be regenerate v2

* set matching python / tf

* set matching python / tf

* set looser dependencies for np / tf / py

* set looser dependencies for np / tf / py

* set looser dependencies for np / tf / py v2

* set looser dependencies for np / tf / py v3

* reduce range and change tf/py version

* workflow adding quotes to versions

* exception for python 3.8

* exception for python 3.8 v2

* looser version for mypy

* now numpy

* Revert "black"

This reverts commit ccd3c82.

* revert to ccd3c82

* playing with versions

* reintroducing matrix python

* version fix

* fixing versions tf

* black + version

* 3.11

* markers

* markers weird py3.7

* py3.11 tf2.16

* test

* test back

* remove 3.11 from list

* fix black

* fix: john comments

* py3.7

* simplifying github workflow

* gh worflow: add back manual build

* gh worflow: revert to what works

* updating release file

* update version (#8)

---------

Co-authored-by: Vincent Adam <[email protected]>
  • Loading branch information
vincentadam87 and thevincentadam authored Apr 22, 2024
1 parent 114ec0d commit 3a765fc
Show file tree
Hide file tree
Showing 23 changed files with 1,867 additions and 1,072 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/quality-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,53 @@ on:
types:
- created


jobs:
check-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
poetry-version: [1.1.6]
python-version: ["3.7", "3.8.12", "3.9.12", "3.10.4"]
poetry-version: [1.1.12]
name: Python-${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# ------------ Install poetry

- name: Setup pip/poetry
run: |
pip install -U pip poetry twine
poetry config virtualenvs.create false
# ------------ install tools
- name: Install Python dependencies
run: poetry install

- name: Configure environment variables for CMake
run: |
echo "PYTHON_BIN=$(which python)" >> $GITHUB_ENV
- name: Install building tools
run: |
sudo apt-get install build-essential
sudo apt-get install cmake g++-11
# ------------ build and install package
sudo apt-get update
sudo apt-get install -y build-essential cmake g++-14
- name: Configure and Build C++ Library
run: |
mkdir -p banded_matrices/build
cd banded_matrices/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
- name: Install package
run: poetry install
# ------------ run tests

- name: Set environment variables for tests
run: |
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/banded_matrices/build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run tests
run: poetry run task test

77 changes: 57 additions & 20 deletions .github/workflows/upload-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,59 @@ jobs:
check-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
poetry-version: [1.1.6]
python-version: ["3.7", "3.8.12", "3.9.12", "3.10.4"]
poetry-version: [1.1.12]
name: Python-${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# ------------ Install poetry

- name: Setup pip/poetry
run: |
pip install -U pip poetry twine
poetry config virtualenvs.create false
# ------------ install tools
- name: Install Python dependencies
run: poetry install

- name: Configure environment variables for CMake
run: |
echo "PYTHON_BIN=$(which python)" >> $GITHUB_ENV
- name: Install building tools
run: |
sudo apt-get install build-essential
sudo apt-get install cmake g++-11
# ------------ build and install package
sudo apt-get update
sudo apt-get install -y build-essential cmake g++-14
- name: Configure and Build C++ Library
run: |
mkdir -p banded_matrices/build
cd banded_matrices/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
- name: Install package
run: poetry install
# ------------ run tests

- name: Set environment variables for tests
run: |
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/banded_matrices/build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run tests
run: poetry run task test

pypi:
# needs: check-and-test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
poetry-version: [1.1.6]
python-version: ["3.7", "3.8.12", "3.9.12", "3.10.4"]
poetry-version: [1.1.12]
name: Release PyPi package
steps:
- uses: actions/checkout@v2
Expand All @@ -68,26 +89,42 @@ jobs:
run: |
VERSION="v$(cat VERSION | tr -d '\t\r\n ')"
TAG="${GITHUB_REF/refs\/tags\//}"
# if [ "$VERSION" != "$TAG" ]; then
# echo "The package version ($VERSION) and the latest tag version ($TAG) are different"
# exit 1
# fi
# ------------ Install poetry
if [ "$VERSION" != "$TAG" ]; then
echo "The package version ($VERSION) and the latest tag version ($TAG) are different"
exit 1
fi
- name: Setup pip/poetry
run: |
pip install -U pip poetry twine
poetry config virtualenvs.create false
# ------------ install tools
- name: Install Python dependencies
run: poetry install

- name: Configure environment variables for CMake
run: |
echo "PYTHON_BIN=$(which python)" >> $GITHUB_ENV
- name: Install building tools
run: |
sudo apt-get install build-essential
sudo apt-get install cmake g++-11
# ------------ build and install package
sudo apt-get update
sudo apt-get install -y build-essential cmake g++-14
- name: Configure and Build C++ Library
run: |
mkdir -p banded_matrices/build
cd banded_matrices/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
- name: Install package
run: |
poetry install
poetry build
# ------------ publish to pypi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.7
0.1.0
2 changes: 1 addition & 1 deletion banded_matrices/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if(TF_LINK_FLAGS_NOT_FOUND)
endif()

# Set the standard compilation and linking flags
set(CMAKE_CXX_FLAGS "-g -std=c++11 -Wall -Wextra -Wfloat-equal -Wshadow -Wconversion ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-g -std=c++14 -Wall -Wextra -Wfloat-equal -Wshadow -Wconversion ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${TF_COMPILE_FLAGS} ${CMAKE_CXX_FLAGS}")

set(LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TF_LINK_FLAGS}")
Expand Down
30 changes: 30 additions & 0 deletions banded_matrices/cc/googletest.CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2021 The banded_matrices Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

cmake_minimum_required(VERSION 3.10)
project(googletest-download NONE)

include(ExternalProject)
# Download and install GoogleTest
ExternalProject_Add(
gtest
URL https://downloads.piointernal.prowler.io/googletest/googletest-release-1.8.1.zip
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
# Disable install step
INSTALL_COMMAND ""
)
Loading

0 comments on commit 3a765fc

Please sign in to comment.