Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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.33.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,
)
69 changes: 68 additions & 1 deletion 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,18 @@ 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

# update commit
if repo_name != "warpx":
print(f"- old commit: {dependencies_data[commit_key]}")
Expand All @@ -115,6 +141,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 +151,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 +199,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 +236,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
8 changes: 6 additions & 2 deletions dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"version_amrex": "25.09",
"version_pyamrex": "25.09",
"version_picsar": "25.06",
"version_pybind11": "v3.0.1",
"version_picmi": "0.33.0",
"commit_amrex": "df200093d90f58f0e0e09a5d6146fdb9b0258f22",
"commit_pyamrex": "a4b60d0e76d0f216f788a6e85c8add38a6a945e3",
"commit_picsar": "0c329e66010267662a82219f7de7abbd231463f4"
}
"commit_picsar": "0c329e66010267662a82219f7de7abbd231463f4",
"commit_pybind11": "30748f863f18c2e0d48e9dcb3be1e77542904da8",
"commit_picmi": "37bb651396d3d33bacfeac016f8745f2434b4e96"
}
Loading