text: # Always prefer setuptools over distutils
  from setuptools import setup, find_packages
  import codecs
  import os.path
  
  
  def read(rel_path):
      here = os.path.abspath(os.path.dirname(__file__))
      with codecs.open(os.path.join(here, rel_path), 'r') as fp:
          return fp.read()
  
  
  def get_version(rel_path):
      for line in read(rel_path).splitlines():
          if line.startswith('__version__'):
              delim = '"' if '"' in line else "'"
              return line.split(delim)[1]
      else:
          raise RuntimeError("Unable to find version string.")
  
  
  scripts = [
      'scripts/upho_weights',
      'scripts/upho_sf',
      'scripts/upho_qpoints',
      'scripts/upho_fit',
  ]
  setup(
      # This is the name of your project. The first time you publish this
      # package, this name will be registered for you. It will determine how
      # users can install this project, e.g.:
      #
      # $ pip install sampleproject
      #
      # And where it will live on PyPI: https://pypi.org/project/sampleproject/
      #
      # There are some restrictions on what makes a valid project name
      # specification here:
      # https://packaging.python.org/specifications/core-metadata/#name
      name='upho',  # Required
  
      # Versions should comply with PEP 440:
      # https://www.python.org/dev/peps/pep-0440/
      #
      # For a discussion on single-sourcing the version across setup.py and the
      # project code, see
      # https://packaging.python.org/en/latest/single_source_version.html
      version=get_version('upho/__init__.py'),  # Required
  
      # This should be a valid link to your project's main homepage.
      #
      # This field corresponds to the "Home-Page" metadata field:
      # https://packaging.python.org/specifications/core-metadata/#home-page-optional
      url='https://github.com/yuzie007/upho',  # Optional
  
      # This should be your name or the name of the organization which owns the
      # project.
      author='Yuji Ikeda',  # Optional
  
      # This should be a valid email address corresponding to the author listed
      # above.
      author_email='yuji.ikeda.ac.jp@gmail.com',  # Optional
  
      # You can just specify package directories manually here if your project is
      # simple. Or you can use find_packages().
      #
      # Alternatively, if you just want to distribute a single Python file, use
      # the `py_modules` argument instead as follows, which will expect a file
      # called `my_module.py` to exist:
      #
      #   py_modules=["my_module"],
      #
      packages=find_packages(),  # Required
  
      # This field lists other packages that your project depends on to run.
      # Any package you put here will be installed by pip when your project is
      # installed, so they must be valid existing projects.
      #
      # For an analysis of "install_requires" vs pip's requirements files see:
      # https://packaging.python.org/en/latest/requirements.html
      install_requires=['phonopy>=2.7.0'],  # Optional
  
      scripts=scripts)
  