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

Add precompile to qa.cfg? #85

Open
idgserpro opened this issue Nov 25, 2021 · 5 comments
Open

Add precompile to qa.cfg? #85

idgserpro opened this issue Nov 25, 2021 · 5 comments

Comments

@idgserpro
Copy link
Member

idgserpro commented Nov 25, 2021

Since in qa.cfg we already have "${buildout:package-name}", what about adding this part so packages that rely on this for testing can just add a precompile part after extending qa.cfg?

[precompile]
# Needed to create *.mo for tests.
recipe = plone.recipe.precompiler
eggs = ${buildout:package-name}
compile-mo-files = true

@mauritsvanrees thoughts?

@jensens
Copy link
Member

jensens commented Nov 25, 2021

since tests are most of the time run once (like in CI) - what do we gain?

@idgserpro
Copy link
Member Author

since tests are most of the time run once (like in CI) - what do we gain?

A DRY principle, mostly. If you have ten packages that need *.po compilation (for some CI environments where the workspace is alwayes destroyed between builds), instead of adding this snippet to all of the packages, you only add the precompile part after extending buildout.plonetest.

@jensens
Copy link
Member

jensens commented Nov 25, 2021

OK. If there are benefits, why not?

@mauritsvanrees
Copy link
Member

So add this in qa.cfg and also add precompile to the list of parts there?
Seems okay. I don't know if this helps in tests: probably only when you have a test that explicitly checks for a translation.
But I suppose running the part can uncover errors in Python files and in po files.

@idgserpro
Copy link
Member Author

Actually, I was planning to just add a precompile part, to qa.cfg, but not in parts itself.

We have the part rebuild_i18n-sh, but it isn't in qa.cfg parts: if you want to use it, you need to add to your own buildout.cfg parts section.

For the precompile, I want to keep this behavior. The idea is just to avoid copy and paste for the precompile part (the same motivation for rebuild_i18n-sh I suppose).

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

3 participants