Skip to content

Commit

Permalink
Release 25.01 (#5544)
Browse files Browse the repository at this point in the history
Prepare the January release of WarpX:
```bash
# update dependencies
./Tools/Release/updateAMReX.py
./Tools/Release/updatePICSAR.py  # no changes, still 24.09
./Tools/Release/updatepyAMReX.py
# bump version number
./Tools/Release/newVersion.sh
```

Following this workflow:
https://warpx.readthedocs.io/en/latest/maintenance/release.html
  • Loading branch information
ax3l authored Jan 9, 2025
1 parent 499fcb0 commit a56ca8d
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach b3f67385e62f387b548389222840486c0fffca57 && cd -
cd ../amrex && git checkout --detach 25.01 && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_FFT=TRUE USE_CCACHE=TRUE -j 4
ccache -s
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preamble ####################################################################
#
cmake_minimum_required(VERSION 3.24.0)
project(WarpX VERSION 24.12)
project(WarpX VERSION 25.01)

include(${WarpX_SOURCE_DIR}/cmake/WarpXFunctions.cmake)

Expand Down
4 changes: 2 additions & 2 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def __init__(self, *args, **kwargs):
# built documents.
#
# The short X.Y version.
version = "24.12"
version = "25.01"
# The full version, including alpha/beta/rc tags.
release = "24.12"
release = "25.01"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 4 additions & 1 deletion Docs/source/maintenance/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In order to create a GitHub release, you need to:
1. Create a new branch from ``development`` and update the version number in all source files.
We usually wait for the AMReX release to be tagged first, then we also point to its tag.

There is a script for updating core dependencies of WarpX and the WarpX version:
There are scripts for updating core dependencies of WarpX and the WarpX version:

.. code-block:: sh
Expand All @@ -42,6 +42,9 @@ In order to create a GitHub release, you need to:

Then open a PR, wait for tests to pass and then merge.

The maintainer script ``Tools/Release/releasePR.py`` automates the steps above.
Please read through the instructions in the script before running.

2. **Local Commit** (Optional): at the moment, ``@ax3l`` is managing releases and signs tags (naming: ``YY.MM``) locally with his GPG key before uploading them to GitHub.

**Publish**: On the `GitHub Release page <https://github.com/ECP-WarpX/WarpX/releases>`__, create a new release via ``Draft a new release``.
Expand Down
2 changes: 1 addition & 1 deletion Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

setup(
name="pywarpx",
version="24.12",
version="25.01",
packages=["pywarpx"],
package_dir={"pywarpx": "pywarpx"},
description="""Wrapper of WarpX""",
Expand Down
200 changes: 200 additions & 0 deletions Tools/Release/releasePR.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
#!/usr/bin/env python3
#
# Copyright 2025 The WarpX Community
#
# This file is part of WarpX.
#
# Authors: Axel Huebl
#

# This file is a maintainer tool to open a release PR for WarpX.
# It is highly automated and does a few assumptions, e.g., that you
# are releasing for the current month.
#
# You also need to have git and the GitHub CLI tool "gh" installed and properly
# configured for it to work:
# https://cli.github.com/
#
import subprocess
import sys
from datetime import datetime
from pathlib import Path

# Maintainer Inputs ###########################################################

print("""Hi there, this is a WarpX maintainer tool to ...\n.
For it to work, you need write access on the source directory and
you should be working in a clean git branch without ongoing
rebase/merge/conflict resolves and without unstaged changes.""")

# check source dir
REPO_DIR = Path(__file__).parent.parent.parent.absolute()
print(f"\nYour current source directory is: {REPO_DIR}")

REPLY = input("Are you sure you want to continue? [y/N] ")
print()
if REPLY not in ["Y", "y"]:
print("You did not confirm with 'y', aborting.")
sys.exit(1)

release_repo = input("What is the name of your git remote? (e.g., ax3l) ")
commit_sign = input("How to sign the commit? (e.g., -sS) ")


# Helpers #####################################################################


def concat_answers(answers):
return "\n".join(answers) + "\n"


# Stash current work ##########################################################

subprocess.run(["git", "stash"], capture_output=True, text=True)


# Git Branch ##################################################################

WarpX_version_yr = f"{datetime.now().strftime('%y')}"
WarpX_version_mn = f"{datetime.now().strftime('%m')}"
WarpX_version = f"{WarpX_version_yr}.{WarpX_version_mn}"
release_branch = f"release-{WarpX_version}"
subprocess.run(["git", "checkout", "development"], capture_output=True, text=True)
subprocess.run(["git", "fetch"], capture_output=True, text=True)
subprocess.run(["git", "pull", "--ff-only"], capture_output=True, text=True)
subprocess.run(["git", "branch", "-D", release_branch], capture_output=True, text=True)
subprocess.run(
["git", "checkout", "-b", release_branch], capture_output=True, text=True
)


# AMReX New Version ###########################################################

AMReX_version = f"{datetime.now().strftime('%y')}.{datetime.now().strftime('%m')}"
answers = concat_answers(["y", AMReX_version, AMReX_version, "y"])

process = subprocess.Popen(
[Path(REPO_DIR).joinpath("Tools/Release/updateAMReX.py")],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)

process.communicate(answers)
del process

# commit
subprocess.run(["git", "add", "-u"], capture_output=True, text=True)
subprocess.run(
["git", "commit", commit_sign, "-m", f"AMReX: {AMReX_version}"], text=True
)


# PICSAR New Version ##########################################################

PICSAR_version = "24.09"
answers = concat_answers(["y", PICSAR_version, PICSAR_version, "y"])

process = subprocess.Popen(
[Path(REPO_DIR).joinpath("Tools/Release/updatePICSAR.py")],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)

process.communicate(answers)
del process

# commit
subprocess.run(["git", "add", "-u"], capture_output=True, text=True)
subprocess.run(
["git", "commit", commit_sign, "-m", f"PICSAR: {PICSAR_version}"], text=True
)


# pyAMReX New Version #########################################################

pyAMReX_version = f"{datetime.now().strftime('%y')}.{datetime.now().strftime('%m')}"
answers = concat_answers(["y", pyAMReX_version, pyAMReX_version, "y"])

process = subprocess.Popen(
[Path(REPO_DIR).joinpath("Tools/Release/updatepyAMReX.py")],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)

process.communicate(answers)
del process

# commit
subprocess.run(["git", "add", "-u"], capture_output=True, text=True)
subprocess.run(
["git", "commit", commit_sign, "-m", f"pyAMReX: {pyAMReX_version}"], text=True
)


# WarpX New Version ###########################################################

answers = concat_answers(["y", WarpX_version_yr, WarpX_version_mn, "", "", "y"])

process = subprocess.Popen(
[Path(REPO_DIR).joinpath("Tools/Release/newVersion.sh")],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)

process.communicate(answers)
del process

# commit
subprocess.run(["git", "add", "-u"], capture_output=True, text=True)
subprocess.run(
["git", "commit", commit_sign, "-m", f"WarpX: {WarpX_version}"], text=True
)


# GitHub PR ###################################################################

subprocess.run(["git", "push", "-u", release_repo, release_branch], text=True)

subprocess.run(
[
"gh",
"pr",
"create",
"--title",
f"Release {WarpX_version}",
"--body",
f"""Prepare the {datetime.now().strftime('%B')} release of WarpX:
```bash
# update dependencies
./Tools/Release/updateAMReX.py
./Tools/Release/updatePICSAR.py # no changes, still {PICSAR_version}
./Tools/Release/updatepyAMReX.py
# bump version number
./Tools/Release/newVersion.sh
```
Following this workflow: https://warpx.readthedocs.io/en/latest/maintenance/release.html
""",
"--label",
"component: documentation",
"--label",
"component: third party",
"--web",
],
text=True,
)


# Epilogue ####################################################################

print("""Done. Please check your source, e.g. via
git diff
now and commit the changes if no errors occurred.""")
4 changes: 2 additions & 2 deletions cmake/dependencies/AMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ macro(find_amrex)
endif()
set(COMPONENT_PRECISION ${WarpX_PRECISION} P${WarpX_PARTICLE_PRECISION})

find_package(AMReX 24.12 CONFIG REQUIRED COMPONENTS ${COMPONENT_ASCENT} ${COMPONENT_CATALYST} ${COMPONENT_DIMS} ${COMPONENT_EB} ${COMPONENT_FFT} PARTICLES ${COMPONENT_PIC} ${COMPONENT_PRECISION} ${COMPONENT_SENSEI} LSOLVERS)
find_package(AMReX 25.01 CONFIG REQUIRED COMPONENTS ${COMPONENT_ASCENT} ${COMPONENT_CATALYST} ${COMPONENT_DIMS} ${COMPONENT_EB} ${COMPONENT_FFT} PARTICLES ${COMPONENT_PIC} ${COMPONENT_PRECISION} ${COMPONENT_SENSEI} LSOLVERS)
# note: TINYP skipped because user-configured and optional

# AMReX CMake helper scripts
Expand All @@ -294,7 +294,7 @@ set(WarpX_amrex_src ""
set(WarpX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
CACHE STRING
"Repository URI to pull and build AMReX from if(WarpX_amrex_internal)")
set(WarpX_amrex_branch "b3f67385e62f387b548389222840486c0fffca57"
set(WarpX_amrex_branch "25.01"
CACHE STRING
"Repository branch for WarpX_amrex_repo if(WarpX_amrex_internal)")

Expand Down
4 changes: 2 additions & 2 deletions cmake/dependencies/pyAMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function(find_pyamrex)
endif()
elseif(NOT WarpX_pyamrex_internal)
# TODO: MPI control
find_package(pyAMReX 24.12 CONFIG REQUIRED)
find_package(pyAMReX 25.01 CONFIG REQUIRED)
message(STATUS "pyAMReX: Found version '${pyAMReX_VERSION}'")
endif()
endfunction()
Expand All @@ -74,7 +74,7 @@ option(WarpX_pyamrex_internal "Download & build pyAMReX" ON)
set(WarpX_pyamrex_repo "https://github.com/AMReX-Codes/pyamrex.git"
CACHE STRING
"Repository URI to pull and build pyamrex from if(WarpX_pyamrex_internal)")
set(WarpX_pyamrex_branch "cba1ca5098fd4edc83b2ae630c0391140fac55f4"
set(WarpX_pyamrex_branch "25.01"
CACHE STRING
"Repository branch for WarpX_pyamrex_repo if(WarpX_pyamrex_internal)")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def build_extension(self, ext):
setup(
name="pywarpx",
# note PEP-440 syntax: x.y.zaN but x.y.z.devN
version="24.12",
version="25.01",
packages=["pywarpx"],
package_dir={"pywarpx": "Python/pywarpx"},
author="Jean-Luc Vay, David P. Grote, Maxence Thévenet, Rémi Lehe, Andrew Myers, Weiqun Zhang, Axel Huebl, et al.",
Expand Down

0 comments on commit a56ca8d

Please sign in to comment.