Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump atlas to 0.39.0 #23

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions check_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re
import requests

import functools

try:
pypi_version = requests.get("https://test.pypi.org/pypi/atlas4py/json").json()["info"][
Expand All @@ -19,7 +19,10 @@
local_parts = [int(num_re.match(p)[1]) for p in local_version.split(".")]
pypi_parts = [int(num_re.match(p)[1]) for p in pypi_version.split(".")]

if local_parts == pypi_parts or not all(l >= p for l, p in zip(local_parts, pypi_parts)):
for l, p in zip(local_parts, pypi_parts):
if l > p:
break
else:
raise ValueError(
f"Local version '{local_version}'' is not newer than the currently published version '{pypi_version}'"
)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

VERSIONS = dict(
cmake="3.14.0",
ecbuild="3.8.0",
eckit="1.24.0",
atlas="0.35.1",
ecbuild="3.8.5",
eckit="1.28.0",
atlas="0.39.0",
pybind11="2.11.1",
python="3.6",
)
Expand Down
28 changes: 16 additions & 12 deletions src/atlas4py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ set(CMAKE_CXX_STANDARD 17)
include(FetchContent)

function(copy_target ct_tgt)
add_custom_target(copy_${ct_tgt} ALL
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ct_tgt}> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
DEPENDS ${ct_tgt}
)
if(NOT TARGET copy_${ct_tgt})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change just allows calling copy_target multiple times with the same argument.

add_custom_target(copy_${ct_tgt} ALL
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ct_tgt}> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
DEPENDS ${ct_tgt}
)
endif()
endfunction()

find_package(atlas QUIET PATHS $ENV{ATLAS_INSTALL_DIR})
Expand Down Expand Up @@ -57,14 +59,16 @@ if(NOT atlas_FOUND)

if(_atlas4py_built_eckit)
# copy atlas' eckit dependencies
get_target_property(deps atlas LINK_LIBRARIES)
get_target_property(deps_interface atlas INTERFACE_LINK_LIBRARIES)
list(APPEND deps ${deps_interface})
list(REMOVE_DUPLICATES deps)
foreach(dep IN LISTS deps)
if(dep MATCHES "eckit.*")
copy_target(${dep})
endif()
foreach(lib "atlas" "atlas_io")
Copy link
Contributor Author

@tehrengruber tehrengruber Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to copy not only the atlas, but also atlas_io targets. Since they share dependencies, I adopted copy_target to be callable multiple times with the same argument. Without this change eckit_codec is missing and loading the package fails.

get_target_property(deps ${lib} LINK_LIBRARIES)
get_target_property(deps_interface ${lib} INTERFACE_LINK_LIBRARIES)
list(APPEND deps ${deps_interface})
list(REMOVE_DUPLICATES deps)
foreach(dep IN LISTS deps)
if(dep MATCHES "eckit.*")
copy_target(${dep})
endif()
endforeach()
endforeach()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/atlas4py/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.35.1.dev15"
__version__ = "0.39.0.dev16"
Loading