https://github.com/csferrie/python-qinfer
Raw File
Tip revision: 8170c84a0be1723f8c6b09e0d3c7a40a886f1fe3 authored by Ian Hincks on 17 August 2018, 20:03:00 UTC
Merge pull request #134 from ihincks/upgrade-vectorized-risk
Tip revision: 8170c84
setup.py
import os, sys

# Figure out the version number and write it to
#     src/qinfer/version.py
# so that we don't have to import qinfer before it's
# installed. This technique seems to be popular amongst
# scientific libraries for ensuring that PEP-440 is adhered
# to, and that version numbers in __init__.py match those in
# setup.py.

MAJOR = 1
MINOR = 0
PRE = None
VERSION = "{major}.{minor}{pre}".format(
    major=MAJOR, minor=MINOR, pre=PRE if PRE is not None else ''
)
VERSION_TARGET = 'src/qinfer/version.py'

def write_version(filename=VERSION_TARGET):
    contents = """\
# This file is automatically generated by setup.py.
# Do not modify.
version = "{version}"
""".format(version=VERSION)
    
    with open(filename, 'w') as version_file:
        version_file.write(contents)

if os.path.exists(VERSION_TARGET):
    os.remove(VERSION_TARGET)

write_version()

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

try:
    with open('README.rst', 'r') as readme:
        long_description = readme.read()
except:
    long_description = ''

setup(
    name='QInfer',
    version=VERSION,
    url='https://github.com/QInfer/python-qinfer',
    download_url='https://github.com/QInfer/python-qinfer/archive/v1.0b1.tar.gz',
    author='Chris Granade and Chris Ferrie',
    author_email='cgranade@cgranade.com',
    maintainer='Chris Granade and Chris Ferrie',
    maintainer_email='cgranade@cgranade.com',
    package_dir={'': 'src'},
    packages=[
        'qinfer',
        'qinfer._lib',
        'qinfer.tomography',
        'qinfer.tests'
    ],
    keywords=['quantum', 'Bayesian', 'estimation'],
    description=
        'Bayesian particle filtering for parameter estimation in quantum '
        'information applications.',
    long_description=long_description,
    license='https://opensource.org/licenses/BSD-3-Clause',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Scientific/Engineering :: Physics',
    ],
    platforms=['any'],
    install_requires=[
        'numpy',
        'scipy',
        'future>=0.15'
    ]
)
back to top