old_contents: import os
  from setuptools import setup, find_packages
  
  
  try:
      with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
          long_description = f.read()
  except:
      long_description = ''
  
  
  setup(
      name='pretix-cartshare',
      version='1.0',
      description='pretix plugin to share carts',
      long_description=long_description,
      url='https://pretix.eu',
      author='Raphael Michel',
      author_email='mail@raphaelmichel.de',
  
      packages=find_packages(exclude=['tests', 'tests.*']),
      include_package_data=True,
      entry_points="""
  [pretix.plugin]
  cartshare=pretix_cartshare:PretixPluginMeta
  """,
  )
  
new_contents: import os
  from distutils.command.build import build
  
  from django.core import management
  from setuptools import setup, find_packages
  
  
  try:
      with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
          long_description = f.read()
  except:
      long_description = ''
  
  
  class CustomBuild(build):
      def run(self):
          management.call_command('compilemessages', verbosity=1, interactive=False)
          build.run(self)
  
  
  cmdclass = {
      'build': CustomBuild
  }
  
  
  setup(
      name='pretix-cartshare',
      version='1.0',
      description='pretix plugin to share carts',
      long_description=long_description,
      url='https://pretix.eu',
      author='Raphael Michel',
      author_email='mail@raphaelmichel.de',
  
      packages=find_packages(exclude=['tests', 'tests.*']),
      include_package_data=True,
      cmdclass=cmdclass,
      entry_points="""
  [pretix.plugin]
  cartshare=pretix_cartshare:PretixPluginMeta
  """,
  )
  
subject: Build i18n files in setup.py