Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make update #2348

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions Makefile
Expand Up @@ -145,6 +145,29 @@ scoop: all
@ echo "Running minimal example with SCOOP"
python -m scoop -n 2 rmg.py -v testing/scoop/input.py

.ONESHELL:
update:
@ echo "Updating RMG-py"
@ echo "Please remember to stash unwanted changes."
git status
@ read -p "Are there any changes that are not staged for committed? [y|n] " user_input
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be "staged or committed" or "staged for commit"?

if [ "$$user_input" = "N" ] || [ "$$user_input" = "n" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work on your system? because I have the following error when I select y or n:

(rmg_env) blais.ch@FACC02D75Y4MD6T RMG-Py % make update
Updating RMG-py
Please remember to stash unwanted changes.
git status
On branch make_update
Your branch is up to date with 'origin/make_update'.

nothing to commit, working tree clean
Are there any changes that are not staged for committed? [y|n] y
if [ "$user_input" = "N" ] || [ "$user_input" = "n" ]; then
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [update] Error 2

this message appears in both zsh and bash. I assume it has to do with mixing make and bash?

git checkout main || true
git pull git@github.com:ReactionMechanismGenerator/RMG-Py.git main || git pull https://github.com/ReactionMechanismGenerator/RMG-Py.git main || true
conda activate rmg_env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if the environment name weren't hard coded. Mine has a different name, and sometimes I have more than one.
Perhaps instead have a check that RMG (or its dependencies) are available in the current environment, and a warning to activate the right environment if it is not.

You could probably just add check as a dependency for this target? (I think that checks all the python dependencies)

make
conda deactivate
exit
elif [ "$$user_input" = "Y" ] || [ "$$user_input" = "y" ]; then
@ echo "Please stash using 'git stash' and run this again"
@ echo "After the operation is done, use 'git stash pop'"
@ echo "Aborting..."
exit
fi
@ echo Wrong input: $$user_input
@ echo "Aborting..."
exit

#########
# Section for setting up MOPAC calculations on the Travis-CI.org server
ifeq ($(TRAVIS),true)
Expand Down
Expand Up @@ -7,7 +7,14 @@ Updating the RMG-Py Source Code
It is recommended to keep yourself up to date with the latest patches and bug fixes by RMG developers,
which is maintained on the official repository at https://github.com/ReactionMechanismGenerator/RMG-Py/
You can view the latest changes by viewing the commits tab on the repository.
To update your source code, you can "pull" the latest changes from the official repo by typing the following command in the

To update your local RMG-Py source code automatically, you can use the following commands::

cd /path/to/RMG-Py
conda activate rmg_env
make update

To update your source code manually, you can "pull" the latest changes from the official repo by typing the following command in the
Command Prompt ::

cd RMG-Py
Expand Down