From f7e7930359359fdd0d8f27f2bd700957fa7faf7b Mon Sep 17 00:00:00 2001 From: Sebastiaan la Fleur Date: Wed, 11 Dec 2024 11:32:57 +0100 Subject: [PATCH] 36: Update to latest python template. --- .github/workflows/ci.yml | 2 +- ci/linux/create_venv.sh | 7 +++++-- ci/linux/gen_protocol.sh | 2 +- ci/linux/install_dependencies.sh | 8 ++++++-- ci/linux/update_dependencies.sh | 12 +++++++---- dev-requirements.txt | 23 +++++++-------------- pyproject.toml | 12 +++++++---- python/ci/linux/build_python_package.sh | 7 +++++-- python/ci/linux/create_venv.sh | 7 +++++-- python/ci/linux/install_dependencies.sh | 7 +++++-- python/ci/linux/update_dependencies.sh | 12 +++++++---- python/dev-requirements.txt | 27 +++++++++---------------- python/pyproject.toml | 18 ++++++++++------- python/requirements.txt | 6 +++--- 14 files changed, 82 insertions(+), 68 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06dcb6f..f8ffb14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.11"] + python-version: ["3.9", "3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/ci/linux/create_venv.sh b/ci/linux/create_venv.sh index b6345ed..e2a60fa 100755 --- a/ci/linux/create_venv.sh +++ b/ci/linux/create_venv.sh @@ -1,5 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash python3.11 -m venv ./.venv -. .venv/bin/activate +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi pip3 install pip-tools diff --git a/ci/linux/gen_protocol.sh b/ci/linux/gen_protocol.sh index 1beeb51..2a6865c 100755 --- a/ci/linux/gen_protocol.sh +++ b/ci/linux/gen_protocol.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then . .venv/bin/activate diff --git a/ci/linux/install_dependencies.sh b/ci/linux/install_dependencies.sh index 0447bed..e00b897 100755 --- a/ci/linux/install_dependencies.sh +++ b/ci/linux/install_dependencies.sh @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi -. .venv/bin/activate pip-sync ./dev-requirements.txt ./requirements.txt diff --git a/ci/linux/update_dependencies.sh b/ci/linux/update_dependencies.sh index 0d5bb9a..fea6566 100755 --- a/ci/linux/update_dependencies.sh +++ b/ci/linux/update_dependencies.sh @@ -1,5 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. .venv/bin/activate -pip-compile --output-file=requirements.txt pyproject.toml -pip-compile --extra=dev -c requirements.txt --output-file=dev-requirements.txt pyproject.toml +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . .venv/bin/activate +fi + +pip-compile --upgrade --output-file=requirements.txt pyproject.toml +pip-compile --upgrade --extra=dev -c requirements.txt --output-file=dev-requirements.txt pyproject.toml diff --git a/dev-requirements.txt b/dev-requirements.txt index 2d9d995..c894fe0 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,31 +4,22 @@ # # pip-compile --constraint=requirements.txt --extra=dev --output-file=dev-requirements.txt pyproject.toml # -build==1.0.3 - # via - # omotes_sdk_protocol_generation (pyproject.toml) - # pip-tools -click==8.1.7 - # via pip-tools +build==1.2.2.post1 + # via omotes_sdk_protocol_generation (pyproject.toml) mypy-protobuf==3.5.0 # via omotes_sdk_protocol_generation (pyproject.toml) -packaging==23.2 +packaging==24.2 # via # build # setuptools-git-versioning -pip-tools==7.3.0 - # via omotes_sdk_protocol_generation (pyproject.toml) -protobuf==4.25.2 +protobuf==5.29.1 # via mypy-protobuf -pyproject-hooks==1.0.0 +pyproject-hooks==1.2.0 # via build -setuptools-git-versioning==1.13.5 +setuptools-git-versioning==2.0.0 # via omotes_sdk_protocol_generation (pyproject.toml) -types-protobuf==4.24.0.20240106 +types-protobuf==5.29.1.20241207 # via mypy-protobuf -wheel==0.42.0 - # via pip-tools # The following packages are considered to be unsafe in a requirements file: -# pip # setuptools diff --git a/pyproject.toml b/pyproject.toml index e9277b7..951c285 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,10 +26,9 @@ dependencies = [ [project.optional-dependencies] dev = [ - "pip-tools~=7.3.0", "mypy-protobuf ~= 3.5.0", - "build ~= 1.0.3", - "setuptools-git-versioning < 2" + "build ~= 1.2.2", + "setuptools-git-versioning >= 2.0, < 3" ] [project.urls] @@ -40,7 +39,12 @@ changelog = "https://github.com/Project-OMOTES/omotes_sdk_protocol/blob/main/CHA [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools ~= 69.0.3", "wheel ~= 0.40.0", "setuptools-git-versioning<2"] +requires = [ + "setuptools ~= 75.6.0", + "wheel ~= 0.45.1", + "setuptools-git-versioning >= 2.0, < 3", +] [tool.setuptools-git-versioning] enabled = true +starting_version = "0.0.1" diff --git a/python/ci/linux/build_python_package.sh b/python/ci/linux/build_python_package.sh index 7277145..d778e12 100755 --- a/python/ci/linux/build_python_package.sh +++ b/python/ci/linux/build_python_package.sh @@ -1,5 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. ./python/.venv/bin/activate +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . ./python/.venv/bin/activate +fi cd ./python/ python -m build diff --git a/python/ci/linux/create_venv.sh b/python/ci/linux/create_venv.sh index 5e4489e..708a0d7 100755 --- a/python/ci/linux/create_venv.sh +++ b/python/ci/linux/create_venv.sh @@ -1,5 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash python3 -m venv ./python/.venv -. ./python/.venv/bin/activate +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . ./python/.venv/bin/activate +fi pip3 install pip-tools diff --git a/python/ci/linux/install_dependencies.sh b/python/ci/linux/install_dependencies.sh index 7e059a5..bbdcce2 100755 --- a/python/ci/linux/install_dependencies.sh +++ b/python/ci/linux/install_dependencies.sh @@ -1,4 +1,7 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. ./python/.venv/bin/activate +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . ./python/.venv/bin/activate +fi pip-sync ./python/dev-requirements.txt ./python/requirements.txt diff --git a/python/ci/linux/update_dependencies.sh b/python/ci/linux/update_dependencies.sh index 0584ba6..59af054 100755 --- a/python/ci/linux/update_dependencies.sh +++ b/python/ci/linux/update_dependencies.sh @@ -1,5 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -. ./python/.venv/bin/activate -pip-compile --output-file=./python/requirements.txt ./python/pyproject.toml -pip-compile --extra=dev -c ./python/requirements.txt --output-file=./python/dev-requirements.txt ./python/pyproject.toml +if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then + echo "Activating .venv first." + . ./python/.venv/bin/activate +fi + +pip-compile --upgrade --output-file=./python/requirements.txt ./python/pyproject.toml +pip-compile --upgrade --extra=dev -c ./python/requirements.txt --output-file=./python/dev-requirements.txt ./python/pyproject.toml diff --git a/python/dev-requirements.txt b/python/dev-requirements.txt index fefee86..0f970fa 100644 --- a/python/dev-requirements.txt +++ b/python/dev-requirements.txt @@ -1,32 +1,23 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --constraint=./python/requirements.txt --extra=dev --output-file=./python/dev-requirements.txt ./python/pyproject.toml # -build==1.0.3 - # via - # omotes_sdk_protocol (./python/pyproject.toml) - # pip-tools -click==8.1.7 - # via pip-tools -packaging==23.2 +build==1.2.2.post1 + # via omotes-sdk-protocol (python/pyproject.toml) +packaging==24.2 # via # build # setuptools-git-versioning -pip-tools==7.3.0 - # via omotes_sdk_protocol (./python/pyproject.toml) -protobuf==4.25.2 +protobuf==5.29.1 # via # -c ./python/requirements.txt - # omotes_sdk_protocol (./python/pyproject.toml) -pyproject-hooks==1.0.0 + # omotes-sdk-protocol (python/pyproject.toml) +pyproject-hooks==1.2.0 # via build -setuptools-git-versioning==1.13.5 - # via omotes_sdk_protocol (./python/pyproject.toml) -wheel==0.42.0 - # via pip-tools +setuptools-git-versioning==2.0.0 + # via omotes-sdk-protocol (python/pyproject.toml) # The following packages are considered to be unsafe in a requirements file: -# pip # setuptools diff --git a/python/pyproject.toml b/python/pyproject.toml index 2eb0662..31254fe 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "omotes-sdk-protocol" -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = ["version"] authors = [ { name = "Sebastiaan la Fleur", email = "sebastiaan.lafleur@tno.nl" }, @@ -23,15 +23,14 @@ classifiers = [ ] dependencies = [ - "protobuf ~= 4.25.2" + "protobuf ~= 5.29.1" ] [project.optional-dependencies] dev = [ - "pip-tools ~= 7.3.0", - "build ~= 1.0.3", - "setuptools-git-versioning < 2", - "setuptools ~= 69.0.3" + "build ~= 1.2.2", + "setuptools-git-versioning >= 2.0, < 3", + "setuptools ~= 75.6.0", ] [project.urls] @@ -42,10 +41,15 @@ changelog = "https://github.com/Project-OMOTES/omotes_sdk_protocol/blob/main/CHA [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools ~= 69.0.3", "wheel ~= 0.40.0", "setuptools-git-versioning<2"] +requires = [ + "setuptools ~= 75.6.0", + "wheel ~= 0.45.1", + "setuptools-git-versioning >= 2.0, < 3", +] [tool.setuptools.package-data] "omotes_sdk_protocol" = ["py.typed"] [tool.setuptools-git-versioning] enabled = true +starting_version = "0.0.1" diff --git a/python/requirements.txt b/python/requirements.txt index 2808acc..104bd5e 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=./python/requirements.txt ./python/pyproject.toml # -protobuf==4.25.2 - # via omotes_sdk_protocol (./python/pyproject.toml) +protobuf==5.29.1 + # via omotes-sdk-protocol (python/pyproject.toml)