Skip to content

Commit

Permalink
Merge branch 'easybuild-easyconfigs-basemap' of github.com:julianmori…
Browse files Browse the repository at this point in the history
…llo/easybuild-easyconfigs-ASE into easybuild-easyconfigs-basemap
  • Loading branch information
julianmorillo committed Nov 29, 2024
2 parents 510f33f + 31464b7 commit 6954bed
Show file tree
Hide file tree
Showing 246 changed files with 10,629 additions and 98 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/tagbot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# NOTE: In order to write comment and edit labels, this script requires workflows with write permissions.
# It should not use any untrusted third party code, or any code checked into the repository itself
# as that could indirectly grant PRs the ability to edit labels and comments on PRs.

import os
import git
import requests
import json
import difflib
from datetime import datetime
from pathlib import Path


Expand All @@ -12,8 +14,7 @@ def get_first_commit_date(repo, file_path):
if commits:
return commits[-1].committed_date
else:
print(f"{file_path} has no commit info, putting it last")
return datetime.datetime.min
raise ValueError(f'{file_path} has no commit info, this should not happen')


def sort_by_added_date(repo, file_paths):
Expand All @@ -27,17 +28,6 @@ def similar_easyconfigs(repo, new_file):
return sort_by_added_date(repo, possible_neighbours)


def diff(old, new):
with open(old, 'r') as old_file, open(new, 'r') as new_file:
old_lines = list(old_file)
new_lines = list(new_file)
return ''.join(difflib.unified_diff(
old_lines,
new_lines,
fromfile=str(old),
tofile=str(new)))


def pr_ecs(pr_diff):
new_ecs = []
changed_ecs = []
Expand All @@ -51,33 +41,38 @@ def pr_ecs(pr_diff):


GITHUB_API_URL = 'https://api.github.com'
event_path = os.getenv("GITHUB_EVENT_PATH")
token = os.getenv("GH_TOKEN")
repo = os.getenv("GITHUB_REPOSITORY")
base_branch_name = os.getenv("GITHUB_BASE_REF")
pr_ref_name = os.getenv("GITHUB_REF_NAME")
event_path = os.getenv('GITHUB_EVENT_PATH')
token = os.getenv('GH_TOKEN')
repo = os.getenv('GITHUB_REPOSITORY')
base_branch_name = os.getenv('GITHUB_BASE_REF')

with open(event_path) as f:
data = json.load(f)

pr_number = data['pull_request']['number']
# Can't rely on merge_commit_sha for pull_request_target as it might be outdated
# merge_commit_sha = data['pull_request']['merge_commit_sha']

print("PR number:", pr_number)
print("Repo:", repo)
print("Base branch name:", base_branch_name)
print("PR ref:", pr_ref_name)

gitrepo = git.Repo(".")

# Change into "pr" checkout directory to allow diffs and glob to work on the same content
os.chdir('pr')
gitrepo = git.Repo('.')

target_commit = gitrepo.commit('origin/' + base_branch_name)
pr_commit = gitrepo.commit('pull/' + pr_ref_name)
pr_diff = target_commit.diff(pr_commit)
print("Target commit ref:", target_commit)
merge_commit = gitrepo.head.commit
print("Merge commit:", merge_commit)
pr_diff = target_commit.diff(merge_commit)

new_ecs, changed_ecs = pr_ecs(pr_diff)
modified_workflow = any(item.a_path.startswith('.github/workflows/') for item in pr_diff)


print("Changed ECs:", changed_ecs)
print("Newly added ECs:", new_ecs)
print("Changed ECs:", ', '.join(str(p) for p in changed_ecs))
print("Newly added ECs:", ', '.join(str(p) for p in new_ecs))
print("Modified workflow:", modified_workflow)

new_software = 0
updated_software = 0
Expand Down Expand Up @@ -116,15 +111,20 @@ def pr_ecs(pr_diff):
comment += f'<summary>Diff against <code>{neighbour.name}</code></summary>\n\n'
comment += f'[{neighbour}](https://github.com/{repo}/blob/{base_branch_name}/{neighbour})\n\n'
comment += '```diff\n'
comment += diff(neighbour, new_file)
comment += '```\n</details>\n\n'
comment += gitrepo.git.diff(f'HEAD:{neighbour}', f'HEAD:{new_file}')
comment += '\n```\n</details>\n\n'

print("Adjusting labels")
current_labels = [label['name'] for label in data['pull_request']['labels']]

label_checks = [(changed_ecs, 'change'),
(new_software, 'new'),
(updated_software, 'update'),
(modified_workflow, 'workflow')]

labels_add = []
labels_del = []
for condition, label in [(changed_ecs, 'change'), (new_software, 'new'), (updated_software, 'update')]:
for condition, label in label_checks:
if condition and label not in current_labels:
labels_add.append(label)
elif not condition and label in current_labels:
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/tagbot.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
name: Tagbot
on: [pull_request]
on: [pull_request_target]

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number }}"
cancel-in-progress: true

jobs:
tagbot:
# Note: can't rely on github.event.pull_request.merge_commit_sha because pull_request_target
# does not wait for github mergability check, and the value is outdated.
# Instead we merge manually in a temporary subdir "pr"
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Checkout base branch for workflow scripts
uses: actions/checkout@v4

- name: Checkout PR for computing diff into "pr" subdirectory
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
path: 'pr'
fetch-depth: 0

- name: Attempt test merge
id: merge
run: |
git config user.name "github-workflow"
git config user.email "[email protected]"
git merge --no-edit --no-ff origin/${{ github.event.pull_request.base.ref }}
continue-on-error: true
working-directory: pr

- run: |
# Make sure the script is unmodified
echo "8be2d295e8436ce557acc8a4d3b82a639913ae65de0d1a76871f21359b4e8d9f .github/workflows/tagbot.py"|sha256sum --check --status
- name: Abort if merge failed
if: steps.merge.outcome == 'failure'
run: |
echo "Merge conflict detected, failing job."
exit 1
- name: set up Python
uses: actions/setup-python@v5
Expand Down
48 changes: 48 additions & 0 deletions easybuild/easyconfigs/a/ASE/ASE-3.23.0-gfbf-2023b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
easyblock = 'PythonBundle'

name = 'ASE'
version = '3.23.0'

homepage = 'https://wiki.fysik.dtu.dk/ase'
description = """ASE is a python package providing an open source Atomic Simulation Environment
in the Python scripting language.
From version 3.20.1 we also include the ase-ext package, it contains optional reimplementations
in C of functions in ASE. ASE uses it automatically when installed."""

toolchain = {'name': 'gfbf', 'version': '2023b'}

dependencies = [
('Python', '3.11.5'),
('Python-bundle-PyPI', '2023.10'),
('SciPy-bundle', '2023.11'),
('Flask', '3.0.0'),
('matplotlib', '3.8.2'),
('Tkinter', '%(pyver)s'), # Needed by GUI of ASE
('spglib-python', '2.5.0'), # optional
]

use_pip = True
sanity_pip_check = True

exts_list = [
('pytest-mock', '3.14.0', {
'checksums': ['2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0'],
}),
('ase', version, {
'checksums': ['91a2aa31d89bd90b0efdfe4a7e84264f32828b2abfc9f38e65e041ad76fec8ae'],
}),
('ase-ext', '20.9.0', {
'checksums': ['a348b0e42cf9fdd11f04b3df002b0bf150002c8df2698ff08d3c8fc7a1223aed'],
}),
]

sanity_check_paths = {
'files': ['bin/ase'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

# make sure Tkinter is available, otherwise 'ase gui' will not work
sanity_check_commands = ["python -c 'import tkinter' "]

moduleclass = 'chem'
48 changes: 48 additions & 0 deletions easybuild/easyconfigs/a/ASE/ASE-3.23.0-gfbf-2024a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
easyblock = 'PythonBundle'

name = 'ASE'
version = '3.23.0'

homepage = 'https://wiki.fysik.dtu.dk/ase'
description = """ASE is a python package providing an open source Atomic Simulation Environment
in the Python scripting language.
From version 3.20.1 we also include the ase-ext package, it contains optional reimplementations
in C of functions in ASE. ASE uses it automatically when installed."""

toolchain = {'name': 'gfbf', 'version': '2024a'}

dependencies = [
('Python', '3.12.3'),
('Python-bundle-PyPI', '2024.06'),
('SciPy-bundle', '2024.05'),
('Flask', '3.0.3'),
('matplotlib', '3.9.2'),
('Tkinter', '%(pyver)s'), # Needed by GUI of ASE
('spglib-python', '2.5.0'), # optional
]

use_pip = True
sanity_pip_check = True

exts_list = [
('pytest-mock', '3.14.0', {
'checksums': ['2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0'],
}),
('ase', version, {
'checksums': ['91a2aa31d89bd90b0efdfe4a7e84264f32828b2abfc9f38e65e041ad76fec8ae'],
}),
('ase-ext', '20.9.0', {
'checksums': ['a348b0e42cf9fdd11f04b3df002b0bf150002c8df2698ff08d3c8fc7a1223aed'],
}),
]

sanity_check_paths = {
'files': ['bin/ase'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

# make sure Tkinter is available, otherwise 'ase gui' will not work
sanity_check_commands = ["python -c 'import tkinter' "]

moduleclass = 'chem'
27 changes: 27 additions & 0 deletions easybuild/easyconfigs/a/Advisor/Advisor-2025.0.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name = 'Advisor'
version = '2025.0.0'

homepage = 'https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/advisor.html'
description = """Vectorization Optimization and Thread Prototyping
- Vectorize & thread code or performance “dies”
- Easy workflow + data + tips = faster code faster
- Prioritize, Prototype & Predict performance gain
"""

toolchain = SYSTEM

source_urls = [
'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fe95ae4a-3692-4e31-919d-3e7bdf5832f1/']
sources = ['intel-advisor-%(version)s.798_offline.sh']
checksums = ['bf85d4b0bd199a2babdff6b4bd3885ce569a3ad0e992b99b2e14dbb30af88cd4']

dontcreateinstalldir = True

sanity_check_paths = {
'files': ['%(namelower)s/%(version_major_minor)s/bin64/advisor'],
'dirs': ['%(namelower)s/%(version_major_minor)s/bin64',
'%(namelower)s/%(version_major_minor)s/lib64',
'%(namelower)s/%(version_major_minor)s/include/intel64']
}

moduleclass = 'perf'
28 changes: 28 additions & 0 deletions easybuild/easyconfigs/a/absl-py/absl-py-2.1.0-GCCcore-13.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
easyblock = 'PythonBundle'

name = 'absl-py'
version = '2.1.0'

homepage = 'https://github.com/abseil/abseil-py'
description = """absl-py is a collection of Python library code for building Python
applications. The code is collected from Google's own Python code base, and has
been extensively tested and used in production."""

toolchain = {'name': 'GCCcore', 'version': '13.3.0'}

builddependencies = [('binutils', '2.42')]

dependencies = [('Python', '3.12.3')]

use_pip = True

exts_list = [
('absl-py', version, {
'modulename': 'absl',
'checksums': ['7820790efbb316739cde8b4e19357243fc3608a152024288513dd968d7d959ff'],
}),
]

sanity_pip_check = True

moduleclass = 'tools'
45 changes: 45 additions & 0 deletions easybuild/easyconfigs/a/anndata/anndata-0.11.1-foss-2023b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
easyblock = 'PythonBundle'

name = 'anndata'
version = '0.11.1'

homepage = 'https://github.com/scverse/anndata'
description = """anndata is a Python package for handling annotated data matrices in memory and on disk,
positioned between pandas and xarray"""

toolchain = {'name': 'foss', 'version': '2023b'}

builddependencies = [
('hatchling', '1.18.0'),
]

dependencies = [
('Python', '3.11.5'),
('Python-bundle-PyPI', '2023.10'),
('SciPy-bundle', '2023.11'),
('h5py', '3.11.0'),
]

use_pip = True
sanity_pip_check = True

exts_list = [
('array_api_compat', '1.9.1', {
'checksums': ['17bab828c93c79a5bb8b867145b71fcb889686607c5672b060aef437e0359ea8'],
}),
('natsort', '8.4.0', {
'checksums': ['45312c4a0e5507593da193dedd04abb1469253b601ecaf63445ad80f0a1ea581'],
}),
(name, version, {
'checksums': ['36bff9a85276fc5f1b9fd01f15aff9aa49408129985f42e0fca4e2c5b7fa909f'],
}),
]

sanity_check_paths = {
'files': ['bin/natsort'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

sanity_check_commands = ["natsort --help"]

moduleclass = 'bio'
Loading

0 comments on commit 6954bed

Please sign in to comment.