django-oscar / django-oscar-docdata

Docdata Payments Gateway integration for django-oscar
Apache License 2.0
22 stars 11 forks source link

"compilemessages" on "pip install -e" #8

Closed jedie closed 5 years ago

jedie commented 5 years ago

on "pip install -e" i get this (in my docker container):

      File ".virtualenv/src/django-oscar-docdata/setup.py", line 15, in <module>
        management.call_command('compilemessages', stdout=sys.stderr, verbosity=1)
      File ".virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 141, in call_command
        return command.execute(*args, **defaults)
      File ".virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
        output = self.handle(*args, **options)
      File ".virtualenv/lib/python3.5/site-packages/django/core/management/commands/compilemessages.py", line 59, in handle
        "tools 0.15 or newer installed." % self.program)
    django.core.management.base.CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15 or newer installed.

Think the setup.py should not call "compilemessages" if 'develop' in sys.argv only if 'sdist' in sys.argv

See: https://github.com/wearehoods/django-oscar-docdata/commit/3f9d40b484992ef6d956b3867cd20f6704e3e0a9

maerteijn commented 5 years ago

The compiled messages file (.mo) file should be there to have translations working. With python setup.py develop or pip install -e you are also installing the package so that's why it is probably there.

I'd say that gettext should be installed instead of changing this behavior.

On the other hand: this is something you would do manually while developing and when you want to release a package. I'll be cleaning up setup.py soon so I'll take this in account.

maerteijn commented 5 years ago

merged your commit 69299d3ae400f8c2de6360945a591ab44ae9666c in master