File tree Expand file tree Collapse file tree 6 files changed +76
-6
lines changed Expand file tree Collapse file tree 6 files changed +76
-6
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # copyright ############################### #
4+ # This file is part of the Xboinc Package. #
5+ # Copyright (c) CERN, 2023. #
6+ # ######################################### #
7+
8+
9+ cat << 'EOF ' > pre-commit
10+ #!/bin/sh
11+
12+ branch="$(git rev-parse --abbrev-ref HEAD)"
13+
14+ if [ "$branch" = "main" ]
15+ then
16+ echo "Cannot commit to main!"
17+ echo "Use pull requests or, if package admin, the versioning script."
18+ exit 1
19+ fi
20+
21+ for file in pyproject.toml version.sh LICENSE install_protection_hook.sh pin_xsuite_versions.sh xboinc/general.py 'xboinc/executable/.*'
22+ do
23+ git diff --name-only | grep '^'${file}'$' &> /dev/null
24+ if [ $? -eq 0 ]
25+ then
26+ thisfile=${file/.\*/\*}
27+ echo "File $thisfile is protected but has local changes."
28+ echo "Restore the file with 'git restore "${thisfile}"' before commiting anything, or force this commit with 'commit --no-verify'."
29+ exit 1
30+ fi
31+ git diff --cached --name-only | grep '^'${file}'$' &> /dev/null
32+ if [ $? -eq 0 ]
33+ then
34+ thisfile=${file/.\*/\*}
35+ echo "File $thisfile is protected but has local changes that are staged."
36+ echo "Restore the file with 'git restore "${thisfile}"' before commiting anything, or force this commit with 'commit --no-verify'."
37+ exit 1
38+ fi
39+ done
40+ EOF
41+
42+ chmod +x pre-commit
43+ mv pre-commit .git/hooks/
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ sed -i "s/\(__version__ =\).*/\1 '"${new_ver}"'/" xboinc/general
9797sed -i " s/\(assert __version__ ==\).*/\1 '" ${new_ver} " '/" tests/test_version.py
9898git reset
9999git add pyproject.toml xboinc/general.py tests/test_version.py xboinc/executable/main.c
100- git commit -m " Updated version number to v" ${new_ver} " ."
100+ git commit --no-verify - m " Updated version number to v" ${new_ver} " ."
101101git push
102102
103103# Make and accept pull request
@@ -122,3 +122,6 @@ curl \
122122
123123# Build release and publish to PyPi
124124poetry publish --build
125+
126+
127+
Original file line number Diff line number Diff line change 44# ######################################### #
55
66from .generate_executable_source import generate_executable_source , generate_executable
7+ from .default_tracker import get_default_tracker
Original file line number Diff line number Diff line change 1+ # copyright ############################### #
2+ # This file is part of the Xboinc Package. #
3+ # Copyright (c) CERN, 2023. #
4+ # ######################################### #
5+
16import xtrack as xt
27import xfields as xf
38import xobjects as xo
49import xcoll as xc
510
611
12+ # ===============================================================================================
13+ # IMPORTANT
14+ # ===============================================================================================
15+ # Only make changes to this file just before a minor version bump (need a separate commit though)
16+ # to avoid having multiple xboinc versions with out-of-sync executables.
17+ # ===============================================================================================
718
819def get_default_tracker ():
920 """
Original file line number Diff line number Diff line change 1+ // copyright ############################### #
2+ // This file is part of the Xboinc Package. #
3+ // Copyright (c) CERN, 2023. #
4+ // ######################################### #
5+
16#include <math.h>
27
38#include "xtrack_tracker.h"
712#include <stdlib.h>
813
914
15+ // ===============================================================================================
16+ // IMPORTANT
17+ // ===============================================================================================
18+ // Only make changes to this file just before a minor version bump (need a separate commit though)
19+ // to avoid having multiple xboinc versions with out-of-sync executables.
20+
21+ // ===============================================================================================
1022// Do not change
11- // ==================================
23+ // ===============================================================================================
1224// version XXX.YYY as int (no patch)
1325int64_t xboinc_exec_version = 0 ;
14- // ==================================
26+ // ===============================================================================================
1527
1628
1729int8_t * file_to_buffer (char * filename , int8_t * buf_in ){
Original file line number Diff line number Diff line change 88_pkg_root = Path (__file__ ).parent .absolute ()
99
1010
11- # ====================================================================
11+ # ==========================================================================================
1212# Do not change
13- # ====================================================================
13+ # ==========================================================================================
1414
1515__version__ = '0.0.3'
1616
2727 'xcoll' : '0.2.5' ,
2828}
2929
30- # ====================================================================
30+ # ==========================================================================================
You can’t perform that action at this time.
0 commit comments