Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependencies for Enhanced Compatibility with Newer Python Versions #5

Merged
merged 61 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2f250cf
wip
vincentadam87 Apr 10, 2024
67cfd46
change python versions and poetry
vincentadam87 Apr 10, 2024
760779e
change cmake version
vincentadam87 Apr 10, 2024
0a99a56
change python version
vincentadam87 Apr 10, 2024
1bcd32c
change python version
vincentadam87 Apr 10, 2024
0547e27
tf version for build
vincentadam87 Apr 10, 2024
76c5cce
tf version
vincentadam87 Apr 10, 2024
1df5d4b
tf version
vincentadam87 Apr 10, 2024
3a11b16
debugging with gpt
vincentadam87 Apr 18, 2024
04f417e
debugging with gpt v2
vincentadam87 Apr 18, 2024
d2c28f5
debugging with gpt v3
vincentadam87 Apr 18, 2024
98783c2
update mypy
vincentadam87 Apr 18, 2024
d4feeab
forgot the lock
vincentadam87 Apr 18, 2024
c9e8add
black changes
vincentadam87 Apr 18, 2024
e7997d0
versioning
vincentadam87 Apr 18, 2024
804e0d0
update pyproject
vincentadam87 Apr 18, 2024
3de7817
ignore banded mypy
vincentadam87 Apr 18, 2024
9790b57
temporary fix: skip test
vincentadam87 Apr 18, 2024
ccd3c82
black
vincentadam87 Apr 18, 2024
a93f64b
putting header back
vincentadam87 Apr 18, 2024
cd2740b
poetry task fix / rm setup.py / more python tested upon push
vincentadam87 Apr 18, 2024
45ed248
minor
vincentadam87 Apr 18, 2024
17f2914
change tensorflow version range
vincentadam87 Apr 18, 2024
99a6b31
forgot the lock
vincentadam87 Apr 18, 2024
dbcd088
changing tf version
vincentadam87 Apr 18, 2024
9c442e7
update poetry
vincentadam87 Apr 18, 2024
74e98be
update worflow to force the lock to be regenerate
vincentadam87 Apr 18, 2024
0e86957
update worflow to force the lock to be regenerate v2
vincentadam87 Apr 18, 2024
973048a
set matching python / tf
vincentadam87 Apr 18, 2024
ad19bb3
set matching python / tf
vincentadam87 Apr 18, 2024
2b980ca
set looser dependencies for np / tf / py
vincentadam87 Apr 18, 2024
1a9b267
set looser dependencies for np / tf / py
vincentadam87 Apr 18, 2024
55005cc
set looser dependencies for np / tf / py v2
vincentadam87 Apr 18, 2024
7406902
set looser dependencies for np / tf / py v3
vincentadam87 Apr 18, 2024
2e1cb69
reduce range and change tf/py version
vincentadam87 Apr 18, 2024
20401b8
workflow adding quotes to versions
vincentadam87 Apr 18, 2024
e6b7557
exception for python 3.8
vincentadam87 Apr 18, 2024
0862983
exception for python 3.8 v2
vincentadam87 Apr 18, 2024
9b2e8c5
looser version for mypy
vincentadam87 Apr 18, 2024
b314d35
now numpy
vincentadam87 Apr 18, 2024
fc58b05
Revert "black"
vincentadam87 Apr 19, 2024
47f9c03
revert to ccd3c822897cbfcb6e12c1257db2e32c69aee18c
vincentadam87 Apr 19, 2024
f061bf6
playing with versions
vincentadam87 Apr 20, 2024
14dd006
reintroducing matrix python
vincentadam87 Apr 20, 2024
aa38bff
version fix
vincentadam87 Apr 20, 2024
2ab1ae3
fixing versions tf
vincentadam87 Apr 20, 2024
7e403e0
black + version
vincentadam87 Apr 20, 2024
0ef525e
3.11
vincentadam87 Apr 20, 2024
9cbe714
markers
vincentadam87 Apr 20, 2024
a5390fe
markers weird py3.7
vincentadam87 Apr 20, 2024
8e5bf22
py3.11 tf2.16
vincentadam87 Apr 20, 2024
b271037
test
vincentadam87 Apr 20, 2024
2d7bf30
test back
vincentadam87 Apr 20, 2024
1b7e05e
remove 3.11 from list
vincentadam87 Apr 20, 2024
ccfa00c
fix black
vincentadam87 Apr 20, 2024
a5f0860
fix: john comments
vincentadam87 Apr 20, 2024
6080db1
py3.7
vincentadam87 Apr 21, 2024
6a1cd04
simplifying github workflow
vincentadam87 Apr 21, 2024
883f64a
gh worflow: add back manual build
vincentadam87 Apr 21, 2024
10f566a
gh worflow: revert to what works
vincentadam87 Apr 21, 2024
c3f80fb
updating release file
vincentadam87 Apr 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +46 to +48

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to define the environment variable in a build step specifically: https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you mean here!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having a separate step to define a new environment variable and piping it into the global environment, the link describes how to add an env statement to the step in the github action definition for defining contextual environment variables.

- 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
Comment on lines +58 to +60

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading