NLeSC / python-template

Netherlands eScience Center Python Template
https://research-software-directory.org/software/nlesc-python-template
Apache License 2.0
177 stars 76 forks source link

Migration from cookiecutter to copier template #399

Closed lyashevska closed 3 weeks ago

lyashevska commented 1 month ago

Description

Related issues:

Instructions to review the pull request

To test locally:

python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools
pip install ".[dev]"
pytest

To bootstrap a new project from the template

cd $(mktemp -d )
copier copy path/to/project/template path/to/destination

Where path/to/project/template can be a local path, an URL, or a shortcut URL.

egpbos commented 1 month ago

Oh, after my edit in the review message on git history I had another look at it and I see now that it is quite weird indeed! 😄 No common base... I understand how it happened, of course, but I'm not sure how this is going to make the history of the repo look in the end. We'll have to fix that before we merge. I'm not sure what the easiest way is to turn this into a normal history, but perhaps squashing it all into one commit would make things easier. Or something with cherry-picking...

lyashevska commented 1 month ago

Thanks for your review! Yes, I have merged two repos with --allow-unrelated-history flag. This is what you get. Lets think what would give use the best look.

lyashevska commented 1 month ago

After some testing I have decided to squash all commits as it gives the cleanest outcome. However as you pointed out commit history for renamed files gets lost. I will try to commit the move operation (e.g. {{cookiecutter.directory_name}} to template) separately from any changes to the file and see if the authorship remains as it should. This is also the reason why #387 was lost...

egpbos commented 1 month ago

Try to rebase it on main, I think that should get the history back. The problem is probably that even though it is now squashed, it is still not based off of main.

lyashevska commented 1 month ago

@egpbos history is back now, can you double check please?

egpbos commented 1 month ago

@egpbos history is back now, can you double check please?

Yes, perfect! Checked out dev branch and VSCode remembers all. Also the git graph looks clean, no more loose ends :)