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

MDI CookieCutter project creation fails with some git versions #4

Open
janash opened this issue Jun 24, 2024 · 1 comment
Open

MDI CookieCutter project creation fails with some git versions #4

janash opened this issue Jun 24, 2024 · 1 comment

Comments

@janash
Copy link
Contributor

janash commented Jun 24, 2024

When running the MDI CookieCutter I got the following error.

git: 'subtree' is not a git command. See 'git --help'.
 1
b"git: 'subtree' is not a git command. See 'git --help'.\n"
Traceback (most recent call last):
  File "/tmp/tmp14txghxo.py", line 84, in <module>
    git_init_and_tag()
  File "/tmp/tmp14txghxo.py", line 48, in git_init_and_tag
    invoke_shell("git subtree add --prefix=replica_exchange/mdi https://github.com/MolSSI/MDI_Library master --squash")
  File "/tmp/tmp14txghxo.py", line 31, in invoke_shell
    raise e
  File "/tmp/tmp14txghxo.py", line 26, in invoke_shell
    output = sp.check_output(command, shell=True, stderr=sp.STDOUT)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/janash/miniconda3/envs/mdi-work/lib/python3.11/subprocess.py", line 465, in check_output    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/janash/miniconda3/envs/mdi-work/lib/python3.11/subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'git subtree add --prefix=replica_exchange/mdi https://github.com/MolSSI/MDI_Library master --squash' returned non-zero exit status 1.
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

This occurs because I am in an environment with git installed from conda, which does not seem to contain the subtree command. This error could be caught to either give the user more detailed feedback, or use an alternative command.

@taylor-a-barnes
Copy link
Collaborator

Thanks for pointing this out. One option would be to change from using a subtree approach to one in which CMake automatically downloads the MDI Library as part of the build process. That's what LAMMPS and a few other MDI-supporting codes do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants