#29973: compilemessages misses ignore option, compiles more than needed
-------------------------------------+-------------------------------------
     Reporter:  Elger Jonker         |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Core (Management     |                  Version:  2.1
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:  compilemessages,     |             Triage Stage:
  ignore, translation,               |  Unreviewed
  internationalization               |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Elger Jonker):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 The --exclude command is about locales. This issue is about having too
 many directories being used in compilemessages.

 Here is an example where i'm in need of an --ignore during
 compilemessages, including the line where the issue resides and an example
 output of where things go wrong:

 Using this command:
 {{{
 django-admin compilemessages -l NL --exclude DE
 }}}

 And this filter on what directory constitutes a 'locale directory':
 
https://github.com/django/django/blob/eac9ab7ebb1ce0cbbc79c4cf65e8f70b0635a240/django/core/management/commands/compilemessages.py#L69

 It's clear that the filter is far too greedy. And in my case it results in
 a list of directories that should not be included. Hence the request for
 an --ignore option just like in makemessages.

 The directory filter currently delivers this output on my machine, again:
 everything named 'locale' is included.

 {{{
 ['conf/locale',
  'locale',
  'locale',
  './locale',
  './.tox/default/lib/python3.6/site-packages/import_export/locale',
  './.tox/default/lib/python3.6/site-packages/jet/locale',
  './.tox/default/lib/python3.6/site-packages/jet/dashboard/locale',
  './.tox/default/lib/python3.6/site-packages/constance/locale',
  './.tox/default/lib/python3.6/site-packages/adminsortable2/locale',
  './.tox/default/lib/python3.6/site-packages/leaflet/locale',
  './.tox/default/lib/python3.6/site-packages/dal_select2/locale',
  './.tox/default/lib/python3.6/site-packages/sphinx/locale',
  './.tox/default/lib/python3.6/site-packages/django_countries/locale',
  './.tox/default/lib/python3.6/site-packages/django_extensions/locale',
  './.tox/default/lib/python3.6/site-packages/django/contrib/auth/locale',
  './.tox/default/lib/python3.6/site-packages/django/contrib/admin/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/flatpages/locale',
  './.tox/default/lib/python3.6/site-packages/django/contrib/sites/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/postgres/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/redirects/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/sessions/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/humanize/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/contenttypes/locale',
  './.tox/default/lib/python3.6/site-packages/django/contrib/gis/locale',
  './.tox/default/lib/python3.6/site-
 packages/django/contrib/admindocs/locale',
  './.tox/default/lib/python3.6/site-packages/django/conf/locale',
  './.tox/default/lib/python3.6/site-packages/debug_toolbar/locale',
  './failmap/locale',
  './failmap/organizations/locale',
  './failmap/game/locale',
  './failmap/map/locale',
  './vendor/dnscheck/engine/locale']
 }}}

 You can also run it for yourself, by creating a 'locale' directory
 somewhere and then run this part of the django source code:
 
https://github.com/django/django/blob/eac9ab7ebb1ce0cbbc79c4cf65e8f70b0635a240/django/core/management/commands/compilemessages.py#L67

 {{{
 basedirs=[]
 for dirpath, dirnames, filenames in os.walk('.', topdown=True):
     for dirname in dirnames:
         if dirname == 'locale':
             basedirs.append(os.path.join(dirpath, dirname))

 basedirs
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29973#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.3bf9ddf833151cb1972979553b6aa97d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to