old_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  
  try:
      from setuptools import setup
  except ImportError:
      from distutils.core import setup
  
  
  with open('README.rst') as readme_file:
      readme = readme_file.read()
  
  with open('HISTORY.rst') as history_file:
      history = history_file.read().replace('.. :changelog:', '')
  
  requirements = [
      "django>=1.7"
  ]
  
  test_requirements = [
  ]
  
  setup(
      name='django-mysql',
      version='0.1.2',
      description="Extensions to Django for use with MySQL/MariaDB",
      long_description=readme + '\n\n' + history,
      author="Adam Johnson",
      author_email='me@adamj.eu',
      url='https://github.com/adamchainz/django-mysql',
      packages=[
          'django_mysql',
      ],
      package_dir={'django_mysql': 'django_mysql'},
      include_package_data=True,
      install_requires=requirements,
      license="BSD",
      zip_safe=False,
      keywords='Django, MySQL, MariaDB',
      classifiers=[
          'Development Status :: 2 - Pre-Alpha',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: BSD License',
          'Natural Language :: English',
          "Programming Language :: Python :: 2",
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.3',
          'Programming Language :: Python :: 3.4',
      ],
      test_suite='tests',
      tests_require=test_requirements
  )
  
new_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  # -*- coding:utf-8 -*-
  from __future__ import print_function
  
  import os
  import sys
  
  if sys.argv[-1] == 'publish':
      os.system("python setup.py sdist upload")
      os.system("python setup.py bdist_wheel upload")
      sys.exit()
  
  
  try:
      from setuptools import setup
  except ImportError:
      from distutils.core import setup
  
  
  with open('README.rst') as readme_file:
      readme = readme_file.read()
  
  with open('HISTORY.rst') as history_file:
      history = history_file.read().replace('.. :changelog:', '')
  
  requirements = [
      "django>=1.7"
  ]
  
  test_requirements = [
  ]
  
  setup(
      name='django-mysql',
      version='0.1.2',
      description="Extensions to Django for use with MySQL/MariaDB",
      long_description=readme + '\n\n' + history,
      author="Adam Johnson",
      author_email='me@adamj.eu',
      url='https://github.com/adamchainz/django-mysql',
      packages=[
          'django_mysql',
      ],
      package_dir={'django_mysql': 'django_mysql'},
      include_package_data=True,
      install_requires=requirements,
      license="BSD",
      zip_safe=False,
      keywords='Django, MySQL, MariaDB',
      classifiers=[
          'Development Status :: 2 - Pre-Alpha',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: BSD License',
          'Natural Language :: English',
          "Programming Language :: Python :: 2",
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.3',
          'Programming Language :: Python :: 3.4',
      ],
      test_suite='tests',
      tests_require=test_requirements
  )
  
subject: Add publish to setup.py