def test_requirements__remove_duplicates(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/010')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [
         'double', 'triple==0.0.1',
     ])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/002')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [
         'h5py==2.0.0', 'numpy', 'scipy',
     ])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements__group_extras_with_matching_versions(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/009')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [
         'random==0.0.1 [abc, xyz]',
     ])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements__tests(self):
     '''
     '''
     expected = ['mock', 'nose>=1.0.0']
     path = os.path.join(self.base_path, 'data/005')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, expected)
     self.assertEquals(requirements.extras_require, {
         'tests': expected,
     })
     self.assertEquals(requirements.dependency_links, [])
 def test_dependency_links(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/001')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [
         'http://www.example.net/package/package-0.0.1.zip',
         'http://www.example.net/simple',
     ])
 def test_requirements__path_with_extra_hyphens(self):
     '''
     Check extraction of extras name and operating system name.
     '''
     path = os.path.join(self.base_path, 'data/013/a-b-c')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [
         'h5py==2.0.0', 'numpy', 'scipy',
     ])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements__extras(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/006')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {
         'cython': ['lxml [cython]'],
         'pdf': ['PIL', 'reportlab==2.5']
     })
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements__editable_package(self):
     '''
     '''
     path = os.path.join(self.base_path, 'data/012')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [
         'package',
     ])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [
         'http://git.example.net/package/package.git#egg=package',
     ])
 def test_requirements__architecture_specific(self):
     '''
     '''
     system = platform.system().lower()
     if system == 'linux':
         expected = ['dbus-python>=0.84.0']
     elif system == 'windows':
         expected = ['wmi>=1.4.9']
     else:
         self.skipTest('Test not available for this platform.')
     path = os.path.join(self.base_path, 'data/003')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, expected)
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {})
     self.assertEquals(requirements.dependency_links, [])
 def test_requirements__extras__architecture_specific(self):
     '''
     '''
     system = platform.system().lower()
     if system == 'linux':
         expected = ['easygconf']
     elif system == 'windows':
         expected = ['regobj']
     else:
         self.skipTest('Test not available for this platform.')
     path = os.path.join(self.base_path, 'data/007')
     requirements = RequirementsParser(path=path)
     self.assertEquals(requirements.install_requires, [])
     self.assertEquals(requirements.setup_requires, [])
     self.assertEquals(requirements.tests_require, [])
     self.assertEquals(requirements.extras_require, {
         'registry': expected,
     })
     self.assertEquals(requirements.dependency_links, [])
Example #11
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:et:ft=python:nowrap:sts=4:sw=4:ts=4

# Copyright (c) Flight Data Services Ltd
# http://www.flightdataservices.com
# See the file "LICENSE" for the full license governing this code.

import setupfixer as pkg
from setuptools import setup, find_packages
from setupfixer.requirements import RequirementsParser
requirements = RequirementsParser()

setup(
    name=pkg.__packagename__,
    version=pkg.__version__,
    author=pkg.__author__,
    author_email=pkg.__author_email__,
    maintainer=pkg.__maintainer__,
    maintainer_email=pkg.__maintainer_email__,
    url=pkg.__url__,
    description=pkg.__description__,
    long_description=open('README.rst').read() + open('CHANGES').read() +
    open('TODO').read() + open('AUTHORS').read(),
    download_url=pkg.__download_url__,
    classifiers=pkg.__classifiers__,
    platforms=pkg.__platforms__,
    license=pkg.__license__,
    keywords=pkg.__keywords__,
    packages=find_packages(exclude=('tests', )),
    include_package_data=True,