Skip to content

Commit

Permalink
Update Dependencies for Enhanced Compatibility with Newer Python Vers…
Browse files Browse the repository at this point in the history
…ions (#5)

* 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
  • Loading branch information
vincentadam87 authored Apr 21, 2024
1 parent abf6661 commit db0ef35
Show file tree
Hide file tree
Showing 21 changed files with 1,835 additions and 1,070 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 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
Loading

0 comments on commit db0ef35

Please sign in to comment.