-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from xsuite/release/v0.0.1
Release 0.0.1
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# copyright ############################### # | ||
# This file is part of the Xcoll Package. # | ||
# Copyright (c) CERN, 2023. # | ||
# ######################################### # | ||
|
||
|
||
cat << 'EOF' > pre-commit | ||
#!/bin/sh | ||
branch="$(git rev-parse --abbrev-ref HEAD)" | ||
if [ "$branch" = "main" ] | ||
then | ||
echo "Cannot commit to main!" | ||
echo "Use pull requests or, if package admin, the versioning script." | ||
exit 1 | ||
fi | ||
for file in pyproject.toml version.sh LICENSE install_protection_hook.sh xcoll/general.py | ||
do | ||
git diff --name-only | grep '^'${file}'$' &> /dev/null | ||
if [ $? -eq 0 ] | ||
then | ||
thisfile=${file/.\*/\*} | ||
echo "File $thisfile is protected but has local changes." | ||
echo "Restore the file with 'git restore "${thisfile}"' before commiting anything," | ||
echo "or force this commit with 'git commit --no-verify'." | ||
exit 1 | ||
fi | ||
git diff --cached --name-only | grep '^'${file}'$' &> /dev/null | ||
if [ $? -eq 0 ] | ||
then | ||
thisfile=${file/.\*/\*} | ||
echo "File $thisfile is protected but has local changes that are staged." | ||
echo "First unstage the file with 'git restore --staged "${thisfile}"', then " | ||
echo "restore the file with 'git restore "${thisfile}"' before commiting anything." | ||
echo "Alternatively, force this commit with 'git commit --no-verify'." | ||
exit 1 | ||
fi | ||
done | ||
EOF | ||
|
||
chmod +x pre-commit | ||
mv pre-commit .git/hooks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "xaux" | ||
version = "0.0.0" | ||
version = "0.0.1" | ||
description = "Support tools for Xsuite packages" | ||
authors = ["Frederik Van der Veken <[email protected]>"] | ||
license = "Apache 2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from xaux import __version__ | ||
|
||
def test_version(): | ||
assert __version__ == '0.0.0' | ||
assert __version__ == '0.0.1' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters