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

Handle the case when local cookiecutter template isn't in the correct branch #76

Closed
eliasdorneles opened this issue Oct 2, 2017 · 4 comments

Comments

@eliasdorneles
Copy link
Contributor

When briefcase runs cookiecutter it tells it to check out the branch that corresponds to the Python major.minor version being used.

However, cookiecutter does not do that when given the directory path to the git repo, so briefcase should checkout the right branch when deciding to reuse the local template.

I think it makes sense to do git checkout BRANCH_NAME inside of the git_pull() method, just before doing the pull.

@eliasdorneles
Copy link
Contributor Author

Btw, it seems that the problem of not ensuring it's in the right branch is what was causing errors like:

cookiecutter.exceptions.RepositoryNotFound: A valid repository for "/home/elias/.cookiecutters/Python-Android-template" could not be found in the following locations:
/home/elias/.cookiecutters/Python-Android-template

Which happens because the master branch of the templates isn't a valid template (doesn't have a cookiecutter.json file).

@andrewleech
Copy link
Contributor

I think this makes a lot of sense and would be especially useful when testing briefcase builds against multiple python versions.

My only suggestion is ensuring that git checkout BRANCH_NAME is not done when --template is set at run time for using custom / testing templates. I don't think you were suggesting this at all, I'm just using this setting at the moment so thought of it.

@eliasdorneles
Copy link
Contributor Author

Hm right, that makes sense. 👍

@andrewleech
Copy link
Contributor

I'm pretty sure updating self.git_pull or adding the checkout in the place you linked to (reuse the local template) would only operated on the default template anyway, any provided on command line wouldn't be touched

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