Skip to content

Commit b217c2b

Browse files
Some fixes (#550)
* Some fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2fb614f commit b217c2b

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/conan.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111

1212
steps:
1313
- name: Run sccache-cache
14-
uses: mozilla-actions/[email protected].6
14+
uses: mozilla-actions/[email protected].9
1515

1616
- name: Checkout repository
1717
uses: actions/checkout@v4
1818

1919
- name: Setup Conan Environment
20-
uses: hankhsu1996/setup-conan@v1.0.0
20+
uses: hankhsu1996/setup-conan@v1.1.0
2121
with:
2222
cache-dependencies: false
2323
cache-tool: false

conanfile.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from conan import ConanFile
22
from conan.errors import ConanInvalidConfiguration
33
from conan.tools.build.cppstd import check_min_cppstd
4-
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
4+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
55
from conan.tools.files import copy
66
from conan.tools.microsoft import is_msvc
77
from conan.tools.scm import Version
@@ -14,12 +14,11 @@ class SparrowRecipe(ConanFile):
1414
description = "C++20 idiomatic APIs for the Apache Arrow Columnar Format"
1515
license = "Apache-2.0"
1616
author = "Man Group"
17-
url = "https://github.com/conan-io/conan-center-index"
18-
homepage = "https://github.com/man-group/sparrow"
17+
url = "https://github.com/man-group/sparrow"
18+
homepage = "https://man-group.github.io/sparrow"
1919
topics = ("arrow", "apache arrow", "columnar format", "dataframe")
2020
package_type = "library"
2121
settings = "os", "arch", "compiler", "build_type"
22-
generators = "CMakeDeps"
2322
exports_sources = "include/*", "LICENSE", "src/*", "cmake/*", "docs/*", "CMakeLists.txt", "sparrowConfig.cmake.in"
2423
options = {
2524
"shared": [True, False],
@@ -49,6 +48,7 @@ def requirements(self):
4948
self.test_requires("benchmark/1.9.4")
5049

5150
def build_requirements(self):
51+
self.tool_requires("cmake/[>=3.28.1 <4.2.0]")
5252
if self.options.get_safe("generate_documentation"):
5353
self.tool_requires("doxygen/1.9.4", options={"enable_app": "True"})
5454

@@ -88,6 +88,9 @@ def layout(self):
8888
cmake_layout(self, src_folder=".")
8989

9090
def generate(self):
91+
deps = CMakeDeps(self)
92+
deps.generate()
93+
9194
tc = CMakeToolchain(self)
9295
tc.variables["USE_DATE_POLYFILL"] = self.options.get_safe(
9396
"use_date_polyfill", False)

include/sparrow/config/sparrow_version.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ namespace sparrow
2323
constexpr int SPARROW_BINARY_CURRENT = 10;
2424
constexpr int SPARROW_BINARY_REVISION = 0;
2525
constexpr int SPARROW_BINARY_AGE = 1;
26+
27+
static_assert(
28+
SPARROW_BINARY_AGE <= SPARROW_BINARY_CURRENT,
29+
"SPARROW_BINARY_AGE cannot be greater than SPARROW_BINARY_CURRENT"
30+
);
2631
}

test/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@
1919

2020
#include "better_junit_reporter.hpp"
2121

22-
TEST_CASE("version is readable")
22+
TEST_CASE("versions are readable")
2323
{
2424
// TODO: once available on OSX, use `<format>` facility instead.
25-
// We only try to make sure the version valeus are printable, whatever their type.
25+
// We only try to make sure the version values are printable, whatever their type.
2626
// AKA this is not written to be fancy but to force conversion to string.
2727
using namespace sparrow;
2828
[[maybe_unused]] const std::string printable_version = std::string("sparrow version : ")
2929
+ std::to_string(SPARROW_VERSION_MAJOR) + "."
3030
+ std::to_string(SPARROW_VERSION_MINOR) + "."
3131
+ std::to_string(SPARROW_VERSION_PATCH);
32+
33+
[[maybe_unused]] const std::string printable_binary_version = std::string("sparrow binary version: ")
34+
+ std::to_string(SPARROW_BINARY_CURRENT) + "."
35+
+ std::to_string(SPARROW_BINARY_REVISION)
36+
+ "." + std::to_string(SPARROW_BINARY_AGE);
3237
}

0 commit comments

Comments
 (0)