Skip to content
Merged
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
5 changes: 3 additions & 2 deletions Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@
else:
package_data = {}

# Parse WarpX version information
# Parse WarpX, PICMI versions information
dependencies_file = "../dependencies.json"
with open(dependencies_file, "r") as file:
dependencies_data = json.load(file)
warpx_version = dependencies_data.get("version_warpx")
picmi_version = dependencies_data.get("version_picmi")

setup(
name="pywarpx",
Expand All @@ -77,7 +78,7 @@
package_dir={"pywarpx": "pywarpx"},
description="""Wrapper of WarpX""",
package_data=package_data,
install_requires=["numpy", "picmistandard==0.34.0", "periodictable"],
install_requires=["numpy", f"picmistandard=={picmi_version}", "periodictable"],
Copy link
Member

Choose a reason for hiding this comment

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

I think the file here should maybe just use requirements.txt instead of documenting the dependencies again...?

python_requires=">=3.8", # left for CI, truly ">=3.9"
zip_safe=False,
)
74 changes: 71 additions & 3 deletions Tools/Release/update_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ def update(args):
repo_dict["picsar"]["tags"] = (
"https://api.github.com/repos/ECP-WarpX/picsar/tags"
)
if args.all or args.pybind11:
repo_dict["pybind11"] = {}
repo_dict["pybind11"]["commit"] = (
"https://api.github.com/repos/pybind/pybind11/commits/master"
)
repo_dict["pybind11"]["tags"] = (
"https://api.github.com/repos/pybind/pybind11/tags"
)
Comment on lines +45 to +52
Copy link
Member

@ax3l ax3l Nov 25, 2025

Choose a reason for hiding this comment

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

Note that we do not do a weekly tracking of pybind11. We manually update when we want a newer release.

Most importantly, when we release WarpX we do not depend on the pybind11 development branch (or any dependency as of their development branch).

if args.all or args.picmi:
repo_dict["picmi"] = {}
repo_dict["picmi"]["commit"] = (
"https://api.github.com/repos/picmi-standard/picmi/commits/master"
)
repo_dict["picmi"]["tags"] = (
"https://api.github.com/repos/picmi-standard/picmi/tags"
)
if args.all or args.warpx:
repo_dict["warpx"] = {}
repo_dict["warpx"]["commit"] = (
Expand All @@ -56,6 +72,8 @@ def update(args):
"amrex": "AMReX",
"pyamrex": "pyAMReX",
"picsar": "PICSAR",
"pybind11": "pybind11",
"picmi": "PICMI",
"warpx": "WarpX",
}

Expand All @@ -72,17 +90,22 @@ def update(args):
# loop over repositories and update dependencies data
for repo_name, repo_subdict in repo_dict.items():
print(f"\nUpdating {repo_labels[repo_name]}...")

# set keys to access dependencies data
commit_key = f"commit_{repo_name}"
version_key = f"version_{repo_name}"

# get new commit information
commit_response = requests.get(repo_subdict["commit"])
commit_dict = commit_response.json()

# set new commit
repo_commit_sha = commit_dict["sha"]

# get new version tag information
tags_response = requests.get(repo_subdict["tags"])
tags_list = tags_response.json()

# filter out old-format tags for specific repositories
tags_list_filtered = copy.deepcopy(tags_list)
if repo_name == "amrex":
Expand All @@ -97,15 +120,19 @@ def update(args):
for tag_dict in tags_list
if (tag_dict["name"] != "PICSARlite-0.1")
]

# set new version tag
if repo_name == "warpx":
# current date version for the WarpX release update
repo_version_tag = datetime.date.today().strftime("%y.%m")
else:
# latest available tag (index 0) for all other dependencies
repo_version_tag = tags_list_filtered[0]["name"]
# use version tag instead of commit sha for a release update
new_commit_sha = repo_version_tag if args.release else repo_commit_sha

# use version tag instead of commit sha for a release update or for pybind11
use_version_tag = args.release or (repo_name == "pybind11")
new_commit_sha = repo_version_tag if use_version_tag else repo_commit_sha

# update commit
if repo_name != "warpx":
print(f"- old commit: {dependencies_data[commit_key]}")
Expand All @@ -115,6 +142,7 @@ def update(args):
else:
print("Updating commit...")
dependencies_data[f"commit_{repo_name}"] = new_commit_sha

# update version
print(f"- old version: {dependencies_data[version_key]}")
print(f"- new version: {repo_version_tag}")
Expand All @@ -124,6 +152,21 @@ def update(args):
print("Updating version...")
dependencies_data[f"version_{repo_name}"] = repo_version_tag

# update PICMI version in requirements.txt files manually
if repo_name == "picmi":
files = [
os.path.join(repo_dir, "requirements.txt"),
os.path.join(repo_dir, "Docs", "requirements.txt"),
]
for filename in files:
with open(filename) as f:
lines = f.readlines()
with open(filename, "w") as f:
for line in lines:
if line.startswith("picmistandard=="):
line = f"picmistandard=={repo_version_tag}\n"
f.write(line)

# write to JSON file with dependencies data
with open(dependencies_file, "w") as file:
json.dump(dependencies_data, file, indent=4)
Expand Down Expand Up @@ -157,6 +200,22 @@ def update(args):
dest="picsar",
)

# add arguments: pybind11 option
parser.add_argument(
"--pybind11",
help="Update pybind11 only",
action="store_true",
dest="pybind11",
)

# add arguments: PICMI option
parser.add_argument(
"--picmi",
help="Update PICMI only",
action="store_true",
dest="picmi",
)

# add arguments: WarpX option
parser.add_argument(
"--warpx",
Expand All @@ -178,7 +237,16 @@ def update(args):

# set args.all automatically
args.all = (
False if (args.amrex or args.pyamrex or args.picsar or args.warpx) else True
False
if (
args.amrex
or args.pyamrex
or args.picsar
or args.pybind11
or args.picmi
or args.warpx
)
else True
)

# update
Expand Down
13 changes: 11 additions & 2 deletions cmake/dependencies/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function(find_pybind11)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_FETCHEDpybind11)
endif()
else()
find_package(pybind11 3.0.1 CONFIG REQUIRED)
find_package(pybind11 ${pybind11_version} CONFIG REQUIRED)
message(STATUS "pybind11: Found version '${pybind11_VERSION}'")
endif()
endfunction()
Expand All @@ -52,7 +52,16 @@ option(WarpX_pybind11_internal "Download & build pybind11" ON)
set(WarpX_pybind11_repo "https://github.com/pybind/pybind11.git"
CACHE STRING
"Repository URI to pull and build pybind11 from if(WarpX_pybind11_internal)")
set(WarpX_pybind11_branch "v3.0.1"

# Parse pybind11 version and commit information
file(READ "${WarpX_SOURCE_DIR}/dependencies.json" dependencies_data)
string(JSON pybind11_version GET "${dependencies_data}" version_pybind11)
string(JSON pybind11_commit GET "${dependencies_data}" commit_pybind11)

# Strip "v" prefix from version for find_package
string(REGEX REPLACE "^v" "" pybind11_version "${pybind11_version}")

set(WarpX_pybind11_branch ${pybind11_commit}
CACHE STRING
"Repository branch for WarpX_pybind11_repo if(WarpX_pybind11_internal)")

Expand Down
6 changes: 5 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"version_amrex": "25.11",
"version_pyamrex": "25.11",
"version_picsar": "25.06",
"version_pybind11": "v3.0.1",
"version_picmi": "0.34.0",
"commit_amrex": "c4fcda1fb2ea238c3e6fa273dc9cfcde54b4cc51",
"commit_pyamrex": "5fc00b46b2a60b2c20b9067500c4b68f709ccb94",
"commit_picsar": "0c329e66010267662a82219f7de7abbd231463f4"
"commit_picsar": "0c329e66010267662a82219f7de7abbd231463f4",
"commit_pybind11": "v3.0.1",
"commit_picmi": "e79dc49c58ad65b5e207ed40e4e6edc4b1482241"
}
Loading