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

Refactor to reduce duplication in post_gen hooks, plus other fixes #369

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

nedbat
Copy link
Contributor

@nedbat nedbat commented Jul 28, 2023

We can split this into separate pull requests if needed. I got a bit aggressive with some changes....

Merge checklist:
Check off if complete or not applicable:

  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, deadlines, tickets

@nedbat nedbat requested a review from timmc-edx July 28, 2023 13:00
Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

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

Looks pretty good! Some make upgrade calls we can get rid of though, I think. (Haven't tried running tests without them because yeah, it takes a lot longer now.)

tests/test_cookiecutter_django_ida.py Show resolved Hide resolved
tests/test_cookiecutter_django_ida.py Show resolved Hide resolved
tests/test_cookiecutter_xblock.py Outdated Show resolved Hide resolved
tests/test_cookiecutter_django_ida.py Outdated Show resolved Hide resolved
@nedbat
Copy link
Contributor Author

nedbat commented Aug 3, 2023

@timmc-edx ready to go.

@@ -60,6 +60,8 @@ def fixture_options_baked(cookies_session, request, custom_template):
baked result.
"""
with bake_in_temp_dir(cookies_session, extra_context=request.param, template=custom_template):
sh.make('upgrade')
sh.pip('install', '-r', 'requirements/base.txt')
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticing now that this was base.txt. Does it still work if we switch it to test.txt? 🤞

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed. It works. Now all four copies of this fixture use test.txt.

Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

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

Awesome! Big improvement.

Copy link
Contributor

@timmc-edx timmc-edx left a comment

Choose a reason for hiding this comment

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

errr... actually clicking "Approve" this time

@nedbat nedbat merged commit 0bc4df6 into master Aug 4, 2023
4 checks passed
@nedbat nedbat deleted the nedbat/common-hook-code branch August 4, 2023 14:29
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

Successfully merging this pull request may close these issues.

2 participants