Skip to content

Commit fa3e700

Browse files
authored
VER: Release 0.10.0
2 parents 58080e0 + db76377 commit fa3e700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+572
-303
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
compiler: [clang++, g++]
14-
1514
name: build - ubuntu-latest - ${{ matrix.compiler}}
1615
runs-on: ubuntu-latest
17-
1816
steps:
1917
- name: Checkout repository
2018
uses: actions/checkout@v3
@@ -54,7 +52,6 @@ jobs:
5452
macos:
5553
name: build - macos-latest - clang++
5654
runs-on: macos-latest
57-
5855
steps:
5956
- name: Checkout repository
6057
uses: actions/checkout@v3
@@ -74,3 +71,29 @@ jobs:
7471
run: cmake --build build
7572
- name: Unit tests
7673
run: cd build && ctest --verbose
74+
75+
windows:
76+
name: build - windows-latest - msvc
77+
runs-on: windows-latest
78+
steps:
79+
- name: Checkout repository
80+
uses: actions/checkout@v3
81+
- name: Cache dependencies
82+
uses: actions/cache@v3
83+
env:
84+
cache-name: cache-vcpkg
85+
with:
86+
path: build/vcpkg_installed
87+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./vcpkg.json') }}
88+
- name: CMake configure
89+
run: |
90+
cmake -S . -B build `
91+
-DDATABENTO_ENABLE_UNIT_TESTING=1 `
92+
-DDATABENTO_ENABLE_EXAMPLES=1 `
93+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
94+
-DVCPKG_BUILD_TYPE=debug `
95+
-DDATABENTO_USE_EXTERNAL_GTEST=0
96+
- name: CMake build
97+
run: cmake --build build --parallel 10
98+
- name: Unit tests
99+
run: cd build && ctest --verbose --exclude-regex cmake

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
build
2+
CMakeSettings.json
3+
vcpkg_installed
4+
.vs
25
!*.zst

CHANGELOG.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## 0.10.0 - 2023-07-20
4+
5+
#### Enhancements
6+
- Added preliminary support for Windows
7+
- Added `LiveThreaded::BlockForStop` to make it easier to wait for one or more records
8+
before closing the session
9+
- Changed `TimeseriesGetRange` to request a Zstd-compressed result for more efficient
10+
data transfer
11+
- Switched `BatchSubmitJob` to use form data to avoid query param length limit
12+
- Switched `SymbologyResolve` to use POST request with form data to avoid query param
13+
length limit
14+
15+
#### Breaking changes
16+
- Changed size-related fields and `limit` parameters to use `std::uint64_t` for consistency
17+
across architectures
18+
19+
#### Bug fixes
20+
- Removed usage of non-portable `__PRETTY_FUNCTION__`
21+
322
## 0.9.1 - 2023-07-11
423

524
#### Enhancements
@@ -8,9 +27,9 @@
827
- Added `RType` getter to `Record`
928

1029
#### Bug fixes
11-
- Batch live subscriptions to avoid hitting max message length
12-
- Fix bug in Zstd decompression
13-
- Fix `Historical::BatchDownload` truncating file before writing each chunk
30+
- Added batching for live subscriptions to avoid hitting max message length
31+
- Fixed bug in Zstd decompression
32+
- Fixed `Historical::BatchDownload` truncating file before writing each chunk
1433

1534
## 0.9.0 - 2023-06-13
1635

@@ -44,18 +63,24 @@
4463
- Added initial support for live data with `LiveBlocking` and `LiveThreaded` clients
4564
- Added support for statistics schema
4665
- Added `SystemMsg` and `ErrorMsg` records for use in live data
47-
- Added `strike_price`, `strike_price_currency`, and `instrument_class` to `InstrumentDefMsg`
66+
- Added `strike_price`, `strike_price_currency`, and `instrument_class` to
67+
`InstrumentDefMsg`
4868
- Added `FixedPx` helper class for formatting fixed prices
4969
- Added configurable log receiver `ILogReceiver`
50-
- Added `instrument_class`, `strike_price`, and `strike_price_currency` to definition schema
51-
- Added additional `condition` variants for `DatasetConditionDetail` (degraded, pending, missing)
52-
- Added additional member `last_modified_date` to `DatasetConditionDetail` Added `has_mixed_schema`, `has_mixed_stype_in`, and `ts_out` to `Metadata` to support live data
70+
- Added `instrument_class`, `strike_price`, and `strike_price_currency` to definition
71+
schema
72+
- Added additional `condition` variants for `DatasetConditionDetail` (degraded, pending,
73+
missing)
74+
- Added additional member `last_modified_date` to `DatasetConditionDetail`
75+
- Added `has_mixed_schema`, `has_mixed_stype_in`, and `ts_out` to `Metadata` to support
76+
live data
5377
- Added optional `compression` parameter to `BatchSubmitJob`
5478

5579
#### Breaking changes
5680
- Removed `related` and `related_security_id` from `InstrumentDefMsg`
5781
- Renamed `BatchJob.cost` to `cost_usd` and value now expressed as US dollars
58-
- Renamed `SType::ProductId` to `SType::InstrumentId` and `SType::Native` to `SType::RawSymbol`
82+
- Renamed `SType::ProductId` to `SType::InstrumentId` and `SType::Native` to
83+
`SType::RawSymbol`
5984
- Renamed `RecordHeader::product_id` to `instrument_id`
6085
- Renamed `InstrumentDefMsg::symbol` to `raw_symbol`
6186
- Renamed `SymbolMapping::native_symbol` to `raw_symbol`

CMakeLists.txt

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
44
# Project details
55
#
66

7-
project("databento" VERSION 0.9.1 LANGUAGES CXX)
7+
project("databento" VERSION 0.10.0 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#
@@ -24,7 +24,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
2424
include(cmake/StandardSettings.cmake)
2525
include(cmake/StaticAnalyzers.cmake)
2626
include(cmake/Utils.cmake)
27-
message(STATUS "Started CMake for ${PROJECT_NAME} v${PROJECT_VERSION}...\n")
27+
message(STATUS "Started CMake for ${PROJECT_NAME} v${PROJECT_VERSION}...")
2828

2929
if(NOT CMAKE_BUILD_TYPE)
3030
if(IS_MAIN_PROJECT)
@@ -41,7 +41,7 @@ endif()
4141
#
4242

4343
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
44-
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.\n")
44+
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
4545
endif()
4646

4747
#
@@ -51,7 +51,7 @@ endif()
5151
include(TestBigEndian)
5252
test_big_endian(IS_BIG_ENDIAN)
5353
if(IS_BIG_ENDIAN)
54-
message(FATAL_ERROR "Big-endian platforms aren't supported because DBN parsing assumes the data is little-endian and in native byte order.\n")
54+
message(FATAL_ERROR "Big-endian platforms aren't supported because DBN parsing assumes the data is little-endian and in native byte order.")
5555
endif()
5656

5757
#
@@ -94,7 +94,7 @@ set_target_properties(
9494
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
9595
)
9696

97-
message(STATUS "Added all header and implementation files.\n")
97+
message(STATUS "Added all header and implementation files.")
9898

9999
#
100100
# Set the project standard and warnings
@@ -110,7 +110,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
110110
target_compile_options(${PROJECT_NAME} PRIVATE -fstandalone-debug)
111111
endif()
112112

113-
verbose_message("Applied compiler warnings.\n")
113+
verbose_message("Applied compiler warnings.")
114114

115115
#
116116
# Model project dependencies
@@ -119,18 +119,19 @@ verbose_message("Applied compiler warnings.\n")
119119
include(FetchContent)
120120
# JSON
121121
if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_JSON)
122-
find_package(nlohmann_json 3.11.2 REQUIRED)
122+
find_package(nlohmann_json REQUIRED)
123123
else()
124+
set(json_version 3.11.2)
124125
if(CMAKE_VERSION VERSION_LESS 3.24)
125126
FetchContent_Declare(
126127
json
127-
URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
128+
URL https://github.com/nlohmann/json/releases/download/v${json_version}/json.tar.xz
128129
)
129130
else()
130131
# DOWNLOAD_EXTRACT_TIMESTAMP added in 3.24
131132
FetchContent_Declare(
132133
json
133-
URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
134+
URL https://github.com/nlohmann/json/releases/download/v${json_version}/json.tar.xz
134135
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
135136
)
136137
endif()
@@ -139,10 +140,10 @@ else()
139140
add_system_include_property(nlohmann_json)
140141
endif()
141142
# cpp-httplib
142-
set(httplib_version 0.11.4)
143143
if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_HTTPLIB)
144-
find_package(httplib ${httplib_version} REQUIRED)
144+
find_package(httplib REQUIRED)
145145
else()
146+
set(httplib_version 0.13.1)
146147
if(CMAKE_VERSION VERSION_LESS 3.24)
147148
FetchContent_Declare(
148149
httplib
@@ -168,6 +169,18 @@ endif()
168169
find_package(Zstd REQUIRED)
169170
find_package(Threads REQUIRED)
170171

172+
#
173+
# Platform-specific dependencies
174+
#
175+
if(WIN32)
176+
find_path(
177+
DIRENT_INCLUDE_DIR "dirent.h"
178+
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include"
179+
REQUIRED
180+
)
181+
target_include_directories(${PROJECT_NAME} PRIVATE ${DIRENT_INCLUDE_DIR})
182+
endif()
183+
171184
target_link_libraries(
172185
${PROJECT_NAME}
173186
PUBLIC
@@ -209,7 +222,7 @@ message(STATUS "Finished setting up include directories.")
209222

210223
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
211224

212-
verbose_message("Project is now aliased as ${PROJECT_NAME}::${PROJECT_NAME}.\n")
225+
verbose_message("Project is now aliased as ${PROJECT_NAME}::${PROJECT_NAME}.")
213226

214227
#
215228
# Format the project using the `clang-format` target (i.e: cmake --build build --target clang-format)
@@ -318,7 +331,14 @@ if(${PROJECT_NAME_UPPERCASE}_GENERATE_EXPORT_HEADER)
318331
message(STATUS "Generated the export header `${PROJECT_NAME}_export.h` and installed it.")
319332
endif()
320333

321-
message(STATUS "Finished building requirements for installing the package.\n")
334+
message(STATUS "Finished building requirements for installing the package.")
335+
336+
#
337+
# Platform-specific
338+
#
339+
if(WIN32)
340+
add_compile_definitions(NOMINMAX)
341+
endif()
322342

323343
#
324344
# Unit testing setup

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ You'll need to ensure the following dependencies are installed:
6363
- [Zstandard (zstd)](https://github.com/facebook/zstd)
6464
- [nlohmann\_json (header-only)](https://github.com/nlohmann/json)
6565
- [cpp-httplib (header-only)](https://github.com/yhirose/cpp-httplib)
66+
- [dirent (Windows-only, header-only)](https://github.com/tronkko/dirent)
6667

6768
By default, cpp-httplib and nlohmann\_json are downloaded by CMake as part of the build process.
6869
If you would like to use a local version of these libraries, enable the CMake flag
@@ -86,10 +87,8 @@ using namespace databento;
8687
int main() {
8788
std::unordered_map<std::uint32_t, std::string> symbol_mappings;
8889

89-
auto client = LiveBuilder{}
90-
.SetKey("$YOUR_API_KEY")
91-
.SetDataset("GLBX.MDP3")
92-
.BuildThreaded();
90+
auto client =
91+
LiveBuilder{}.SetKeyFromEnv().SetDataset("GLBX.MDP3").BuildThreaded();
9392

9493
auto handler = [&symbol_mappings](const Record& rec) {
9594
if (rec.Holds<TradeMsg>()) {
@@ -99,8 +98,7 @@ int main() {
9998
<< '\n';
10099
} else if (rec.Holds<SymbolMappingMsg>()) {
101100
auto mapping = rec.Get<SymbolMappingMsg>();
102-
symbol_mappings[mapping.hd.instrument_id] =
103-
mapping.stype_out_symbol.data();
101+
symbol_mappings[mapping.hd.instrument_id] = mapping.STypeOutSymbol();
104102
}
105103
return KeepGoing::Continue;
106104
};

cmake/CompilerWarnings.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
function(set_project_warnings project_name)
88
set(MSVC_WARNINGS
9-
/W4 # Baseline reasonable warnings
109
/w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss
1110
# of data
1211
/w14254 # 'operator': conversion from 'type1:field_bits' to

cmake/Utils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function(add_clang_format_target)
3030
-i ${sources} ${headers}
3131
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
3232
endif()
33-
message(STATUS "Format the project using the `clang-format` target (i.e: cmake --build build --target clang-format).\n")
33+
message(STATUS "Format the project using the `clang-format` target (i.e: cmake --build build --target clang-format).")
3434
endif()
3535
endfunction()
3636

cmake/mingw-w64-x86_64.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(CMAKE_SYSTEM_NAME Windows)
2+
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
3+
4+
# Cross compilers to use for C and C++
5+
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
6+
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
7+
# Compiler for Windows resource files
8+
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
9+
10+
# Target environment on the build host system
11+
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
12+
13+
# Modify default behavior of FIND_XXX() commands
14+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
15+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
16+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

example/historical/symbology_resolve.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <sysexits.h>
2-
31
#include <iostream>
42
#include <vector>
53

@@ -12,7 +10,7 @@ int main(int argc, char* argv[]) {
1210
if (argc < 6) {
1311
std::cerr << "USAGE: symbology-resolve <DATASET> <STYPE_IN> <STYPE_OUT> "
1412
"<DATE> <SYMBOLS...>\n";
15-
return EX_USAGE;
13+
return 1;
1614
}
1715
const auto stype_in = databento::FromString<databento::SType>(argv[2]);
1816
const auto stype_out = databento::FromString<databento::SType>(argv[3]);

example/historical/timeseries_get_range.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include <ctime>
33
#include <iomanip>
44
#include <iostream> // setw
5+
#ifdef _WIN32
6+
// _mkgmtime is equivalent to timegm
7+
#define timegm _mkgmtime
8+
#endif
59

610
#include "databento/constants.hpp"
711
#include "databento/datetime.hpp"

0 commit comments

Comments
 (0)