Skip to content

Commit d4277a5

Browse files
authored
Merge pull request #1 from xsuite/release/v0.0.1
Release 0.0.1
2 parents 0910a07 + 2de180e commit d4277a5

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

install_protection_hook.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# copyright ############################### #
4+
# This file is part of the Xcoll 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 xcoll/general.py
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,"
29+
echo "or force this commit with 'git commit --no-verify'."
30+
exit 1
31+
fi
32+
git diff --cached --name-only | grep '^'${file}'$' &> /dev/null
33+
if [ $? -eq 0 ]
34+
then
35+
thisfile=${file/.\*/\*}
36+
echo "File $thisfile is protected but has local changes that are staged."
37+
echo "First unstage the file with 'git restore --staged "${thisfile}"', then "
38+
echo "restore the file with 'git restore "${thisfile}"' before commiting anything."
39+
echo "Alternatively, force this commit with 'git commit --no-verify'."
40+
exit 1
41+
fi
42+
done
43+
EOF
44+
45+
chmod +x pre-commit
46+
mv pre-commit .git/hooks/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "xaux"
3-
version = "0.0.0"
3+
version = "0.0.1"
44
description = "Support tools for Xsuite packages"
55
authors = ["Frederik Van der Veken <[email protected]>"]
66
license = "Apache 2.0"

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from xaux import __version__
22

33
def test_version():
4-
assert __version__ == '0.0.0'
4+
assert __version__ == '0.0.1'
55

xaux/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
# ===================
1111
# Do not change
1212
# ===================
13-
__version__ = '0.0.0'
13+
__version__ = '0.0.1'
1414
# ===================

0 commit comments

Comments
 (0)