-
Notifications
You must be signed in to change notification settings - Fork 230
Add more dependencies to root JSON file #6189
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
Changes from 4 commits
a524cdc
8669094
09fb469
87410ff
da668b4
0a4ece2
1c6f2f3
fd2c587
04a1f0c
772d6fb
56ad087
a5eb0b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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", | ||
|
|
@@ -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"], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the file here should maybe just use |
||
| python_requires=">=3.8", # left for CI, truly ">=3.9" | ||
| zip_safe=False, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"] = ( | ||
|
|
@@ -56,6 +72,8 @@ def update(args): | |
| "amrex": "AMReX", | ||
| "pyamrex": "pyAMReX", | ||
| "picsar": "PICSAR", | ||
| "pybind11": "pybind11", | ||
| "picmi": "PICMI", | ||
| "warpx": "WarpX", | ||
| } | ||
|
|
||
|
|
@@ -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": | ||
|
|
@@ -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]}") | ||
|
|
@@ -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}") | ||
|
|
@@ -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) | ||
|
|
@@ -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", | ||
|
|
@@ -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 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.