Skip to content

make compile_templates deterministic#1454

Merged
davidism merged 1 commit intopallets:3.0.xfrom
atetubou:deterministic_test
Aug 9, 2021
Merged

make compile_templates deterministic#1454
davidism merged 1 commit intopallets:3.0.xfrom
atetubou:deterministic_test

Conversation

@atetubou
Copy link
Copy Markdown
Contributor

Python3 doesn't keep insertion order for set(), so this sorts some
places for deterministic output for compiled template.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism
Copy link
Copy Markdown
Member

Please rebase to 3.0.x instead of main.

@davidism davidism added this to the 3.0.2 milestone May 26, 2021
Comment thread tests/test_compile.py Outdated
Comment thread CHANGES.rst Outdated
@atetubou atetubou changed the base branch from main to 3.0.x May 27, 2021 03:38
@atetubou atetubou changed the base branch from 3.0.x to main May 27, 2021 03:39
@atetubou atetubou force-pushed the deterministic_test branch 2 times, most recently from d0c0299 to 014f63a Compare May 27, 2021 03:43
@atetubou atetubou changed the base branch from main to 3.0.x May 27, 2021 03:44
@atetubou atetubou force-pushed the deterministic_test branch 2 times, most recently from d0f0fc8 to 7598b9b Compare May 27, 2021 04:01
@atetubou
Copy link
Copy Markdown
Contributor Author

Thank you for review, I think I addressed your comments.

@atetubou atetubou force-pushed the deterministic_test branch from 7598b9b to 5051f9b Compare May 27, 2021 04:04
@atetubou
Copy link
Copy Markdown
Contributor Author

atetubou commented Jun 1, 2021

Can I have a review again?

@atetubou atetubou requested a review from davidism June 2, 2021 05:05
@pallets pallets deleted a comment from atetubou Jun 3, 2021
@davidism
Copy link
Copy Markdown
Member

davidism commented Jun 3, 2021

Please don't bump posts like that. As volunteers, we will get to your pr when we have time available.

@davidism davidism force-pushed the deterministic_test branch from 5051f9b to 0d417f5 Compare August 9, 2021 17:57
Python3 doesn't keep insertion order for set(), so this sorts some
places for deterministic output for compiled template.
@davidism davidism force-pushed the deterministic_test branch from 0d417f5 to 4c703ec Compare August 9, 2021 17:58
@davidism davidism merged commit 1891320 into pallets:3.0.x Aug 9, 2021
@atetubou atetubou deleted the deterministic_test branch August 10, 2021 00:55
@atetubou
Copy link
Copy Markdown
Contributor Author

Sorry for pinging and thank you for your merge!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile_templates is non-deterministic when using filters compile_templates is non-deterministic on {% import ... as ... with context %}

2 participants