diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2eece243..c93f3a5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: hooks: - id: clang-format - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.287 + rev: v0.0.290 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -39,11 +39,11 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.12.0 hooks: - id: pyupgrade args: [--py37-plus] diff --git a/CHANGELOG.md b/CHANGELOG.md index f3286a9f..472c6ebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,11 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- +- Allow passing third-party dependency version from environment variable by [@XuehaiPan](https://github.com/XuehaiPan) in [#80](https://github.com/metaopt/optree/pull/80). ### Changed -- +- Bump `abseil-cpp` version to 20230802.1 by [@XuehaiPan](https://github.com/XuehaiPan) in [#80](https://github.com/metaopt/optree/pull/80). ### Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index ed2abefa..631cea10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,20 @@ cmake_minimum_required(VERSION 3.11) # for FetchContent project(optree LANGUAGES CXX) include(FetchContent) -set(PYBIND11_VERSION v2.11.1) -set(ABSEIL_CPP_VERSION 20230802.0) + set(THIRD_PARTY_DIR "${CMAKE_SOURCE_DIR}/third-party") +if(NOT DEFINED PYBIND11_VERSION AND NOT "$ENV{PYBIND11_VERSION}" STREQUAL "") + set(PYBIND11_VERSION "$ENV{PYBIND11_VERSION}") +endif() +if(NOT DEFINED ABSEIL_CPP_VERSION AND NOT "$ENV{ABSEIL_CPP_VERSION}" STREQUAL "") + set(ABSEIL_CPP_VERSION "$ENV{ABSEIL_CPP_VERSION}") +endif() +if(NOT PYBIND11_VERSION) + set(PYBIND11_VERSION v2.11.1) +endif() +if(NOT ABSEIL_CPP_VERSION) + set(ABSEIL_CPP_VERSION 20230802.1) +endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release)