Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…asyconfigs into wxWidgets-3.2.6
  • Loading branch information
smoors committed Nov 7, 2024
2 parents 3658780 + e42dda8 commit f234be4
Show file tree
Hide file tree
Showing 51 changed files with 1,740 additions and 63 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'
40 changes: 40 additions & 0 deletions easybuild/easyconfigs/b/BCFtools/BCFtools-1.21-GCC-13.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Author: Jonas Demeulemeester
# The Francis Crick Insitute, London, UK
# Updated to 1.21 jpecar / EMBL

easyblock = 'ConfigureMake'

name = 'BCFtools'
version = '1.21'

homepage = 'https://www.htslib.org/'
description = """Samtools is a suite of programs for interacting with high-throughput sequencing data.
BCFtools - Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence
variants"""

toolchain = {'name': 'GCC', 'version': '13.3.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/samtools/%(namelower)s/releases/download/%(version)s']
sources = [SOURCELOWER_TAR_BZ2]
checksums = ['528a4cc1d3555368db75a700b22a3c95da893fd1827f6d304716dfd45ea4e282']

dependencies = [
('zlib', '1.3.1'),
('HTSlib', '1.21'),
('bzip2', '1.0.8'),
('XZ', '5.4.5'),
('GSL', '2.8'),
]

configopts = "--with-htslib=$EBROOTHTSLIB --enable-libgsl"


sanity_check_paths = {
'files': ['bin/%(namelower)s', 'bin/plot-vcfstats', 'bin/vcfutils.pl'],
'dirs': ['libexec/%(namelower)s'],
}

moduleclass = 'bio'
50 changes: 50 additions & 0 deletions easybuild/easyconfigs/d/Dask-ML/Dask-ML-2024.4.4-foss-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
easyblock = 'PythonBundle'

name = 'Dask-ML'
version = '2024.4.4'

homepage = 'http://ml.dask.org/'
description = """
Dask-ML provides scalable machine learning in Python using Dask alongside popular machine
learning libraries like Scikit-Learn, XGBoost, and others.
"""

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

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

dependencies = [
('Python', '3.11.3'),
('scikit-learn', '1.3.1'),
('dask', '2023.9.2'),
('numba', '0.58.1'),
('SciPy-bundle', '2023.07'),
]

use_pip = True
sanity_pip_check = True

exts_list = [
('sparse', '0.15.4', {
# replace use of 'version_file' (which requires setuptools-scm >= 8.0) with 'write_to'
'preinstallopts': "sed -i 's/^version_file/write_to/' pyproject.toml && ",
'checksums': ['d4b1c57d24ff0f64f2fd5b5a95b49b7fb84ed207a26d7d58ce2764dcc5c72b84'],
}),
('dask-glm', '0.3.2', {
'checksums': ['c947a566866698a01d79978ae73233cb5e838ad5ead6085143582c5e930b9a4a'],
}),
('distributed', '2023.9.2', {
'checksums': ['b76b43be6a297c6cc6dc4eac7f5a05a8c6834aaf025ed37395d1d830448d540e'],
}),
('multipledispatch', '1.0.0', {
'checksums': ['5c839915465c68206c3e9c473357908216c28383b425361e5d144594bf85a7e0'],
}),
('packaging', '24.1', {
'checksums': ['026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002'],
}),
('dask_ml', version, {
'checksums': ['7956910a49e1e31944280fdb311adf245da11ef410d67deb7a05c67c7d0c4498'],
}),
]

moduleclass = 'ai'
25 changes: 25 additions & 0 deletions easybuild/easyconfigs/g/GSL/GSL-2.8-GCC-13.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
easyblock = 'ConfigureMake'

name = 'GSL'
version = '2.8'

homepage = 'https://www.gnu.org/software/gsl/'
description = """The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers.
The library provides a wide range of mathematical routines such as random number generators, special functions
and least-squares fitting."""

toolchain = {'name': 'GCC', 'version': '13.3.0'}
toolchainopts = {'unroll': True, 'pic': True}

source_urls = [GNU_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
checksums = ['6a99eeed15632c6354895b1dd542ed5a855c0f15d9ad1326c6fe2b2c9e423190']

sanity_check_paths = {
'files': ['bin/%s' % x for x in ['gsl-config', 'gsl-histogram', 'gsl-randist']] +
['include/gsl/gsl_types.h'] +
['lib/lib%s.%s' % (x, SHLIB_EXT) for x in ['gsl', 'gslcblas']],
'dirs': [],
}

moduleclass = 'numlib'
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
('prodigal', '2.6.3'),
('HMMER', '3.4'),
('pplacer', '1.1.alpha19', '', SYSTEM),
('FastANI', '1.34'),
('skani', '0.2.2'),
('FastTree', '2.1.11'),
('Mash', '2.3'),
('tqdm', '4.66.1'),
Expand Down
Loading

0 comments on commit f234be4

Please sign in to comment.