Skip to content

Commit 75a3607

Browse files
committed
Merge branch 'develop' into wipe-changes
2 parents 3560b41 + b073f57 commit 75a3607

File tree

7 files changed

+38
-27
lines changed

7 files changed

+38
-27
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ launch.json
1414
compile_commands.json
1515

1616
__pycache__/
17+
18+
*.swp

cmake/z3fdb_setup.cfg.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[metadata]
2+
description = "z3fdb"
3+
# TODO replace with file: README.md
4+
long_description = "Z3FDB is a custom Zarr v3 Store connecting to FDB"
5+
long_description_content_type = text/markdown
6+
# TODO consider replacing with file: AUTHORS, possibly after updating that file
7+
author = "European Centre for Medium-Range Weather Forecasts"

cmake/z3fdb_setup.py.in

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1+
import os
12
from setuptools import setup
3+
import platform
4+
from wheel.bdist_wheel import bdist_wheel
5+
import sys
6+
7+
8+
# NOTE this we need to correctly link with fdb5lib version on cd. For local builds feel free to ignore
9+
version_suffix = os.environ.get("VERSION_SUFFIX", "")
10+
11+
# NOTE see ci-utils/wheelmaker/buildscripts/setup_utils, we need to get the right abi compat tag
12+
class bdist_wheel_ext(bdist_wheel):
13+
def get_tag(self):
14+
python, abi, plat = bdist_wheel.get_tag(self)
15+
return python, abi, f"manylinux_2_28_{platform.machine()}"
16+
17+
ext_kwargs = {
18+
'darwin': {},
19+
'linux': {"cmdclass": {"bdist_wheel": bdist_wheel_ext}},
20+
}
21+
222

323
setup(
424
name="z3fdb",
5-
version="@fdb5_VERSION_STR@",
25+
version=f"@fdb5_VERSION_STR@{version_suffix}",
626
packages=[
727
"z3fdb",
828
"z3fdb._internal",
@@ -12,6 +32,7 @@ setup(
1232
package_data={
1333
"chunked_data_view_bindings": ["*.so", "*.pyd"],
1434
},
15-
install_requires=["numpy", "zarr>=3,<4", "findlibs"],
35+
install_requires=["numpy", "zarr>=3,<4", "findlibs>=0.1.2", f"fdb5lib==@fdb5_VERSION_STR@{version_suffix}"],
1636
has_ext_modules=lambda: True,
37+
**ext_kwargs[sys.platform],
1738
)

python/fdb5lib/buildconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
NAME="fdb"
1414
# TODO no idea why I cant get it to compile with grib=1
15-
CMAKE_PARAMS="-Deckit_ROOT=/tmp/fdb/prereqs/eckitlib -Dmetkit_ROOT=/tmp/fdb/prereqs/metkitlib -Deccodes_ROOT=/tmp/fdb/prereqs/eccodeslib -DENABLE_GRIB=0"
15+
CMAKE_PARAMS="-Deckit_ROOT=/tmp/fdb/prereqs/eckitlib -Dmetkit_ROOT=/tmp/fdb/prereqs/metkitlib -Deccodes_ROOT=/tmp/fdb/prereqs/eccodeslib -DENABLE_GRIB=0 -DENABLE_PYTHON_ZARR_INTERFACE=1"
1616
PYPROJECT_DIR="python/fdb5lib"
1717
DEPENDENCIES='["eckitlib", "eccodeslib", "metkitlib"]'

src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ if (HAVE_PYTHON_ZARR_INTERFACE)
2626
${Z3FDB_STAGING}/setup.py
2727
@ONLY
2828
)
29+
configure_file(
30+
${CMAKE_CURRENT_SOURCE_DIR}/../cmake/z3fdb_setup.cfg.in
31+
${Z3FDB_STAGING}/setup.cfg
32+
@ONLY
33+
)
2934
add_subdirectory(chunked_data_view_bindings)
3035
set(_z3fdb_package_files
3136
"z3fdb/simple_store_builder.py"

src/fdb5/toc/TocHandler.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -218,29 +218,6 @@ bool TocHandler::exists() const {
218218
return tocPath_.exists();
219219
}
220220

221-
void TocHandler::checkUID() const {
222-
static bool fdbOnlyCreatorCanWrite = eckit::Resource<bool>("fdbOnlyCreatorCanWrite", true);
223-
if (!fdbOnlyCreatorCanWrite) {
224-
return;
225-
}
226-
227-
static std::vector<std::string> fdbSuperUsers =
228-
eckit::Resource<std::vector<std::string>>("fdbSuperUsers", "", true);
229-
230-
if (dbUID() != userUID_) {
231-
232-
if (std::find(fdbSuperUsers.begin(), fdbSuperUsers.end(), userName(userUID_)) == fdbSuperUsers.end()) {
233-
234-
std::ostringstream oss;
235-
oss << "Only user '" << userName(dbUID())
236-
237-
<< "' can write to FDB " << directory_ << ", current user is '" << userName(userUID_) << "'";
238-
239-
throw eckit::UserError(oss.str());
240-
}
241-
}
242-
}
243-
244221
void TocHandler::openForAppend() {
245222

246223
checkUID(); // n.b. may openForRead

src/fdb5/toc/TocHandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class TocHandler : public TocCommon {
115115
~TocHandler() override;
116116

117117
bool exists() const;
118-
void checkUID() const override;
119118

120119
void writeInitRecord(const Key& tocKey);
121120
void writeClearRecord(const Index&);

0 commit comments

Comments
 (0)