<commit_before>import json
import os

from tailorscad.state import State
from tailorscad.config import ConfigData

def parse_config_arg(parsed_command_line_args):
    """Uses the results of the argparser to build an in memory representation
    of the config file.
    """
    with open(parsed_command_line_args.config, 'r') as config_file:
        return _parse_config_file(config_file)

def _parse_config_file(config_file):
    """Private function that takes a file object and parses it using the json
    library. Helps with testing reading files from the command line."""

    loaded_json = {}
    try:
        loaded_json = json.load(config_file)
    except Exception as e:
        print str(e)
        print 'can\'t load config!'

    return parse_states(loaded_json)

def parse_states(loaded_json):

    loaded_json['states'] = _parse_states(loaded_json)

    main_state = {'main_file': loaded_json.get('main')}
    main_state['scad_type'] = loaded_json.get('scad_type')
    main_state['output_directory'] = loaded_json.get('output_directory')
    main_state['working_directory'] = loaded_json.get('working_directory')
    main_state['params'] = loaded_json.get('global_params')

    loaded_json['main_state'] = _parse_state('main', main_state)

    return ConfigData(loaded_json)

# TODO: Make this obey DRY and break it up, it is too big
def _parse_states(loaded_json):
    """Creates a list of State objects with the work to be done. The main
    file is in the final position of the state list.
    """

    if not loaded_json:
        print 'no json loaded cannot parse states'
        return

    states = []
    global_params = loaded_json.get('global_params')
    require_params = loaded_json.get('require_params')
    requires = loaded_json.get('requires')

    _build_directories(loaded_json)

    for key, state in requires.iteritems():

            state['output_directory'] = loaded_json.get('output_directory')
            state['working_directory'] = loaded_json.get('working_directory')

            state_params = require_params.get(key, {})
            state['params'] = state_params.update(global_params)

            states.append(_parse_state(key, state))

    return states

def _build_directories(loaded_json):
    """Ensures that we always have a directory to work with if they are not
    defined in the configuration file."""

    update = {}
    update['output_directory'] = loaded_json.get(
        'output_directory', os.path.join(os.getcwd(), 'bin'))
    update['working_directory'] = loaded_json.get(
        'working_directory', os.getcwd())

    loaded_json.update(update)

def _parse_state(name, state):
    """Build a new State object"""

    new_state = {'name': name}
    new_state.update(state)
    return State(new_state)

def parse_config_string(config_string):
    """Takes a config that is a str and turns it into a dictionary
    """

    return json.loads(config_string)
<commit_msg>Fix main_path not being generated correctly<commit_after>import json
import os

from tailorscad.state import State
from tailorscad.config import ConfigData

def parse_config_arg(parsed_command_line_args):
    """Uses the results of the argparser to build an in memory representation
    of the config file.
    """
    with open(parsed_command_line_args.config, 'r') as config_file:
        return _parse_config_file(config_file)

def _parse_config_file(config_file):
    """Private function that takes a file object and parses it using the json
    library. Helps with testing reading files from the command line."""

    loaded_json = {}
    try:
        loaded_json = json.load(config_file)
    except Exception as e:
        print str(e)
        print 'can\'t load config!'

    return parse_states(loaded_json)

def parse_states(loaded_json):

    loaded_json['states'] = _parse_states(loaded_json)

    main_state = {'main': loaded_json.get('main')}
    main_state['scad_type'] = loaded_json.get('scad_type')
    main_state['output_directory'] = loaded_json.get('output_directory')
    main_state['working_directory'] = loaded_json.get('working_directory')
    main_state['params'] = loaded_json.get('global_params')

    loaded_json['main_state'] = _parse_state('main', main_state)

    return ConfigData(loaded_json)

# TODO: Make this obey DRY and break it up, it is too big
def _parse_states(loaded_json):
    """Creates a list of State objects with the work to be done. The main
    file is in the final position of the state list.
    """

    if not loaded_json:
        print 'no json loaded cannot parse states'
        return

    states = []
    global_params = loaded_json.get('global_params')
    require_params = loaded_json.get('require_params')
    requires = loaded_json.get('requires')

    _build_directories(loaded_json)

    for key, state in requires.iteritems():

            state['output_directory'] = loaded_json.get('output_directory')
            state['working_directory'] = loaded_json.get('working_directory')

            state_params = require_params.get(key, {})
            state['params'] = state_params.update(global_params)

            states.append(_parse_state(key, state))

    return states

def _build_directories(loaded_json):
    """Ensures that we always have a directory to work with if they are not
    defined in the configuration file."""

    update = {}
    update['output_directory'] = loaded_json.get(
        'output_directory', os.path.join(os.getcwd(), 'bin'))
    update['working_directory'] = loaded_json.get(
        'working_directory', os.getcwd())

    loaded_json.update(update)

def _parse_state(name, state):
    """Build a new State object"""

    new_state = {'name': name}
    new_state.update(state)
    return State(new_state)

def parse_config_string(config_string):
    """Takes a config that is a str and turns it into a dictionary
    """

    return json.loads(config_string)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

version = '0.1'

setup(name='django-cas',
      version=version,
      description="Django Cas Client",
      long_description=open("./README.md", "r").read(),
      classifiers=[
          "Development Status :: Development",
          "Environment :: Console",
          "Intended Audience :: End Users/Desktop",
          "Natural Language :: English",
          "Operating System :: OS Independent",
          "Programming Language :: Python",
          "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
          "Topic :: Utilities",
          "License :: OSI Approved :: Private",
          ],
      keywords='k-state-common',
      author='Derek Stegelman, Garrett Pennington',
      author_email='derekst@k-state.edu, garrett@k-state.edu',
      url='http://github.com/kstateome/django-cas/',
      license='Public',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=True,
      )<commit_msg>Bump version<commit_after>from setuptools import setup, find_packages

version = '0.8.1'

setup(name='django-cas',
      version=version,
      description="Django Cas Client",
      long_description=open("./README.md", "r").read(),
      classifiers=[
          "Development Status :: Development",
          "Environment :: Console",
          "Intended Audience :: End Users/Desktop",
          "Natural Language :: English",
          "Operating System :: OS Independent",
          "Programming Language :: Python",
          "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
          "Topic :: Utilities",
          "License :: OSI Approved :: Private",
          ],
      keywords='k-state-common',
      author='Derek Stegelman, Garrett Pennington',
      author_email='derekst@k-state.edu, garrett@k-state.edu',
      url='http://github.com/kstateome/django-cas/',
      license='Public',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=True,
      )<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name = 'pyramid_torque_engine',
    version = '0.0.1',
    description = 'Pyramid and nTorque based dual queue work engine system.',
    author = 'James Arthur',
    author_email = 'username: thruflo, domain: gmail.com',
    url = 'http://github.com/thruflo/pyramid_torque_engine',
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: Public Domain',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Framework :: Pylons',
        'Topic :: Internet :: WWW/HTTP :: WSGI',
    ],
    packages = find_packages('src'),
    package_dir = {'': 'src'},
    include_package_data = True,
    zip_safe = False,
    install_requires=[
        'fysom',
        'pyramid_basemodel',
        'transaction',
        'zope.interface'
    ],
    tests_require = [
        'coverage',
        'nose',
        'mock'
    ]
)
<commit_msg>setup: add ntorque dependency.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name = 'pyramid_torque_engine',
    version = '0.0.1',
    description = 'Pyramid and nTorque based dual queue work engine system.',
    author = 'James Arthur',
    author_email = 'username: thruflo, domain: gmail.com',
    url = 'http://github.com/thruflo/pyramid_torque_engine',
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: Public Domain',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Framework :: Pylons',
        'Topic :: Internet :: WWW/HTTP :: WSGI',
    ],
    packages = find_packages('src'),
    package_dir = {'': 'src'},
    include_package_data = True,
    zip_safe = False,
    install_requires=[
        'fysom',
        'ntorque',
        'pyramid_basemodel',
        'transaction',
        'zope.interface'
    ],
    tests_require = [
        'coverage',
        'nose',
        'mock'
    ]
)
<|endoftext|>


<commit_before>"""
Python API client for GOV.UK Notify
"""
import re
import ast
from setuptools import setup, find_packages

_version_re = re.compile(r'__version__\s+=\s+(.*)')

with open('notifications_utils/version.py', 'rb') as f:
    version = str(ast.literal_eval(_version_re.search(
        f.read().decode('utf-8')).group(1)))

setup(
    name='notifications-utils',
    version=version,
    url='https://github.com/alphagov/notifications-utils',
    license='MIT',
    author='Government Digital Service',
    description='Shared python code for GOV.UK Notify.',
    long_description=__doc__,
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'bleach==3.1.0',
        'mistune==0.8.4',
        'requests==2.22.0',
        'python-json-logger==0.1.11',
        'Flask>=1.0.3',
        'orderedset==2.0.1',
        'Jinja2==2.10.1',
        'statsd==3.3.0',
        'Flask-Redis==0.4.0',
        'pyyaml==5.1.2',
        'phonenumbers==8.10.17',
        'pytz==2019.1',
        'smartypants==2.0.1',
        'monotonic==1.5',
        'pypdf2==1.26.0',

        # required by both api and admin
        'awscli==1.16.231',
        'boto3==1.9.221',
    ]
)
<commit_msg>important code style changes<commit_after>"""
Python API client for GOV.UK Notify
"""
import re
import ast
from setuptools import (setup, find_packages)

_version_re = re.compile(r'__version__\s+=\s+(.*)')

with open('notifications_utils/version.py', 'rb') as f:
    version = str(ast.literal_eval(_version_re.search(
        f.read().decode('utf-8')).group(1)))

setup(
    name='notifications-utils',
    version=version,
    url='https://github.com/alphagov/notifications-utils',
    license='MIT',
    author='Government Digital Service',
    description='Shared python code for GOV.UK Notify.',
    long_description=__doc__,
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'bleach==3.1.0',
        'mistune==0.8.4',
        'requests==2.22.0',
        'python-json-logger==0.1.11',
        'Flask>=1.0.3',
        'orderedset==2.0.1',
        'Jinja2==2.10.1',
        'statsd==3.3.0',
        'Flask-Redis==0.4.0',
        'pyyaml==5.1.2',
        'phonenumbers==8.10.17',
        'pytz==2019.1',
        'smartypants==2.0.1',
        'monotonic==1.5',
        'pypdf2==1.26.0',

        # required by both api and admin
        'awscli==1.16.231',
        'boto3==1.9.221',
    ]
)
<|endoftext|>


<commit_before>#
# libjingle
# Copyright 2012, Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#  1. Redistributions of source code must retain the above copyright notice,
#     this list of conditions and the following disclaimer.
#  2. Redistributions in binary form must reproduce the above copyright notice,
#     this list of conditions and the following disclaimer in the documentation
#     and/or other materials provided with the distribution.
#  3. The name of the author may not be used to endorse or promote products
#     derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

{
  'includes': [
    'build/common.gypi',
  ],
  'targets': [
    {
      'target_name': 'libjingle_xmpphelp',
      'type': 'static_library',
      'dependencies': [
        '<(DEPTH)/third_party/expat/expat.gyp:expat',
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'xmpp/jingleinfotask.cc',
        'xmpp/jingleinfotask.h',
      ],
    },  # target libjingle_xmpphelp
    {
      'target_name': 'relayserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/relayserver/relayserver_main.cc',
      ],
    },  # target relayserver
    {
      'target_name': 'stunserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/stunserver/stunserver_main.cc',
      ],
    },  # target stunserver
    {
      'target_name': 'turnserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/turnserver/turnserver_main.cc',
      ],
    },  # target turnserver
    {
      'target_name': 'login',
      'type': 'executable',
      'dependencies': [
        'libjingle_xmpphelp',
      ],
      'sources': [
        'examples/login/login_main.cc',
      ],
    },  # target login
    {
      'target_name': 'peerconnection_server',
      'type': 'executable',
      'sources': [
        'examples/peerconnection/server/data_socket.cc',
        'examples/peerconnection/server/data_socket.h',
        'examples/peerconnection/server/main.cc',
        'examples/peerconnection/server/peer_channel.cc',
        'examples/peerconnection/server/peer_channel.h',
        'examples/peerconnection/server/utils.cc',
        'examples/peerconnection/server/utils.h',
      ],
      'dependencies': [
        'libjingle.gyp:libjingle',
      ],
      # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
      'msvs_disabled_warnings': [ 4309, ],
    }, # target peerconnection_server
  ],
  'conditions': [
    # TODO(ronghuawu): Reenable building call.
    # ['OS!="android"', {
    #   'targets': [
    #     {
    #       'target_name': 'call',
    #       'type': 'executable',
    #       'dependencies': [
    #         'libjingle.gyp:libjingle_p2p',
    #         'libjingle_xmpphelp',
    #       ],
    #       'sources': [
    #         'examples/call/call_main.cc',
    #         'examples/call/callclient.cc',
    #         'examples/call/callclient.h',
    #         'examples/call/console.cc',
    #         'examples/call/console.h',
    #         'examples/call/friendinvitesendtask.cc',
    #         'examples/call/friendinvitesendtask.h',
    #         'examples/call/mediaenginefactory.cc',
    #         'examples/call/mediaenginefactory.h',
    #         'examples/call/muc.h',
    #         'examples/call/mucinviterecvtask.cc',
    #         'examples/call/mucinviterecvtask.h',
    #         'examples/call/mucinvitesendtask.cc',
    #         'examples/call/mucinvitesendtask.h',
    #         'examples/call/presencepushtask.cc',
    #         'examples/call/presencepushtask.h',
    #       ],
    #       'conditions': [
    #         ['OS=="linux"', {
    #           'link_settings': {
    #             'libraries': [
    #               '<!@(pkg-config --libs-only-l gobject-2.0 gthread-2.0'
    #                   ' gtk+-2.0)',
    #             ],
    #           },
    #         }],
    #         ['OS=="win"', {
    #           'msvs_settings': {
    #             'VCLinkerTool': {
    #               'AdditionalDependencies': [
    #                 'strmiids.lib',
    #               ],
    #             },
    #           },
    #         }],
    #       ],  # conditions
    #     },  # target call
    #   ], # targets
    # }],  # OS!="android"
    ['OS=="linux" or OS=="win"', {
      'targets': [
        {
          'target_name': 'peerconnection_client',
          'type': 'executable',
          'sources': [
            'examples/peerconnection/client/conductor.cc',
            'examples/peerconnection/client/conductor.h',
            'examples/peerconnection/client/defaults.cc',
            'examples/peerconnection/client/defaults.h',
            'examples/peerconnection/client/peer_connection_client.cc',
            'examples/peerconnection/client/peer_connection_client.h',
          ],
          'dependencies': [
            '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
            'libjingle.gyp:libjingle_peerconnection',
          ],
          'conditions': [
            # TODO(ronghuawu): Move these files to a win/ directory then they
            # can be excluded automatically.
            ['OS=="win"', {
              'sources': [
                'examples/peerconnection/client/flagdefs.h',
                'examples/peerconnection/client/main.cc',
                'examples/peerconnection/client/main_wnd.cc',
                'examples/peerconnection/client/main_wnd.h',
              ],
              'msvs_settings': {
                'VCLinkerTool': {
                 'SubSystem': '2',  # Windows
                },
              },
            }],  # OS=="win"
            ['OS=="linux"', {
              'sources': [
                'examples/peerconnection/client/linux/main.cc',
                'examples/peerconnection/client/linux/main_wnd.cc',
                'examples/peerconnection/client/linux/main_wnd.h',
              ],
              'cflags': [
                '<!@(pkg-config --cflags glib-2.0 gobject-2.0 gtk+-2.0)',
              ],
              'link_settings': {
                'ldflags': [
                  '<!@(pkg-config --libs-only-L --libs-only-other glib-2.0'
                      ' gobject-2.0 gthread-2.0 gtk+-2.0)',
                ],
                'libraries': [
                  '<!@(pkg-config --libs-only-l glib-2.0 gobject-2.0'
                      ' gthread-2.0 gtk+-2.0)',
                  '-lX11',
                  '-lXcomposite',
                  '-lXext',
                  '-lXrender',
                ],
              },
            }],  # OS=="linux"
          ],  # conditions
        },  # target peerconnection_client
      ], # targets
    }],  # OS=="linux" or OS=="win"

    ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")', {
      'targets': [
        {
          'target_name': 'AppRTCDemo',
          'type': 'executable',
          'product_name': 'AppRTCDemo',
          'mac_bundle': 1,
          'mac_bundle_resources': [
            'examples/objc/AppRTCDemo/channel.html',
          ],
          'dependencies': [
            'libjingle.gyp:libjingle_peerconnection_objc',
          ],
          'conditions': [
            ['OS=="ios"', {
              'mac_bundle_resources': [
                'examples/objc/AppRTCDemo/ios/ResourceRules.plist',
                'examples/objc/AppRTCDemo/ios/en.lproj/APPRTCViewController.xib',
                'examples/objc/Icon.png',
              ],
              'sources': [
                'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.h',
                'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.m',
                'examples/objc/AppRTCDemo/ios/APPRTCViewController.h',
                'examples/objc/AppRTCDemo/ios/APPRTCViewController.m',
                'examples/objc/AppRTCDemo/ios/AppRTCDemo-Prefix.pch',
                'examples/objc/AppRTCDemo/ios/main.m',
              ],
              'xcode_settings': {
                'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/ios/Info.plist',
              },
            }],
            ['OS=="mac"', {
              'sources': [
                'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.h',
                'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.m',
                'examples/objc/AppRTCDemo/mac/APPRTCViewController.h',
                'examples/objc/AppRTCDemo/mac/APPRTCViewController.m',
                'examples/objc/AppRTCDemo/mac/main.m',
              ],
              'xcode_settings': {
                'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
                'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/mac/Info.plist',
                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
                'OTHER_LDFLAGS': [
                  '-framework AVFoundation',
                  '-framework WebKit',
                ],
              },
            }],
            ['target_arch=="ia32"', {
              'dependencies' : [
                '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
              ],
            }],
          ],
          'include_dirs': [
            'examples/objc/APPRTCDemo',
          ],
          'sources': [
            'examples/objc/AppRTCDemo/APPRTCAppClient.h',
            'examples/objc/AppRTCDemo/APPRTCAppClient.m',
            'examples/objc/AppRTCDemo/APPRTCConnectionManager.h',
            'examples/objc/AppRTCDemo/APPRTCConnectionManager.m',
            'examples/objc/AppRTCDemo/GAEChannelClient.h',
            'examples/objc/AppRTCDemo/GAEChannelClient.m',
          ],
          'xcode_settings': {
            'CLANG_ENABLE_OBJC_ARC': 'YES',
          },
        },  # target AppRTCDemo
      ],  # targets
    }],  # OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")

    ['OS=="android"', {
      'targets': [
        {
          'target_name': 'AppRTCDemo',
          'type': 'none',
          'dependencies': [
            'libjingle.gyp:libjingle_peerconnection_jar',
          ],
          'actions': [
            {
              # TODO(fischman): convert from a custom script to a standard gyp
              # apk build once chromium's apk-building gyp machinery can be used
              # (http://crbug.com/225101)
              'action_name': 'build_apprtcdemo_apk',
              'inputs' : [
                '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
                '<(PRODUCT_DIR)/libjingle_peerconnection_so.so',
                'examples/android/AndroidManifest.xml',
                'examples/android/README',
                'examples/android/ant.properties',
                'examples/android/assets/channel.html',
                'examples/android/build.xml',
                'examples/android/jni/Android.mk',
                'examples/android/project.properties',
                'examples/android/res/drawable-hdpi/ic_launcher.png',
                'examples/android/res/drawable-ldpi/ic_launcher.png',
                'examples/android/res/drawable-mdpi/ic_launcher.png',
                'examples/android/res/drawable-xhdpi/ic_launcher.png',
                'examples/android/res/values/strings.xml',
                'examples/android/src/org/appspot/apprtc/AppRTCClient.java',
                'examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java',
                'examples/android/src/org/appspot/apprtc/AppRTCGLView.java',
                'examples/android/src/org/appspot/apprtc/UnhandledExceptionHandler.java',
                'examples/android/src/org/appspot/apprtc/GAEChannelClient.java',
              ],
              'outputs': [
                '<(PRODUCT_DIR)/AppRTCDemo-debug.apk',
              ],
              'variables': {
                'ant_log': '../../<(INTERMEDIATE_DIR)/ant.log', # ../.. to compensate for the cd examples/android below.
              },
              'action': [
                'bash', '-ec',
                'rm -fr <(_outputs) examples/android/{bin,libs} && '
                'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
                'mkdir -p examples/android/libs/<(android_app_abi) && '
                'cp <(PRODUCT_DIR)/libjingle_peerconnection.jar examples/android/libs/ &&'
                '<(android_strip) -o examples/android/libs/<(android_app_abi)/libjingle_peerconnection_so.so  <(PRODUCT_DIR)/libjingle_peerconnection_so.so &&'
                'cd examples/android && '
                '{ ANDROID_SDK_ROOT=<(android_sdk_root) '
                'ant debug > <(ant_log) 2>&1 || '
                '  { cat <(ant_log) ; exit 1; } } && '
                'cd - > /dev/null && '
                'cp examples/android/bin/AppRTCDemo-debug.apk <(_outputs)'
              ],
            },
          ],
        },  # target AppRTCDemo
      ],  # targets
    }],  # OS=="android"
  ],
}
<commit_msg>(Auto)update libjingle 71753329-> 71766184<commit_after>#
# libjingle
# Copyright 2012, Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#  1. Redistributions of source code must retain the above copyright notice,
#     this list of conditions and the following disclaimer.
#  2. Redistributions in binary form must reproduce the above copyright notice,
#     this list of conditions and the following disclaimer in the documentation
#     and/or other materials provided with the distribution.
#  3. The name of the author may not be used to endorse or promote products
#     derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

{
  'includes': [
    'build/common.gypi',
  ],
  'targets': [
    {
      'target_name': 'libjingle_xmpphelp',
      'type': 'static_library',
      'dependencies': [
        '<(DEPTH)/third_party/expat/expat.gyp:expat',
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'xmpp/jingleinfotask.cc',
        'xmpp/jingleinfotask.h',
      ],
    },  # target libjingle_xmpphelp
    {
      'target_name': 'relayserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/relayserver/relayserver_main.cc',
      ],
    },  # target relayserver
    {
      'target_name': 'stunserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/stunserver/stunserver_main.cc',
      ],
    },  # target stunserver
    {
      'target_name': 'turnserver',
      'type': 'executable',
      'dependencies': [
        'libjingle.gyp:libjingle',
        'libjingle.gyp:libjingle_p2p',
      ],
      'sources': [
        'examples/turnserver/turnserver_main.cc',
      ],
    },  # target turnserver
    {
      'target_name': 'login',
      'type': 'executable',
      'dependencies': [
        'libjingle_xmpphelp',
      ],
      'sources': [
        'examples/login/login_main.cc',
      ],
    },  # target login
    {
      'target_name': 'peerconnection_server',
      'type': 'executable',
      'sources': [
        'examples/peerconnection/server/data_socket.cc',
        'examples/peerconnection/server/data_socket.h',
        'examples/peerconnection/server/main.cc',
        'examples/peerconnection/server/peer_channel.cc',
        'examples/peerconnection/server/peer_channel.h',
        'examples/peerconnection/server/utils.cc',
        'examples/peerconnection/server/utils.h',
      ],
      'dependencies': [
        'libjingle.gyp:libjingle',
      ],
      # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
      'msvs_disabled_warnings': [ 4309, ],
    }, # target peerconnection_server
  ],
  'conditions': [
    # TODO(ronghuawu): Reenable building call.
    # ['OS!="android"', {
    #   'targets': [
    #     {
    #       'target_name': 'call',
    #       'type': 'executable',
    #       'dependencies': [
    #         'libjingle.gyp:libjingle_p2p',
    #         'libjingle_xmpphelp',
    #       ],
    #       'sources': [
    #         'examples/call/call_main.cc',
    #         'examples/call/callclient.cc',
    #         'examples/call/callclient.h',
    #         'examples/call/console.cc',
    #         'examples/call/console.h',
    #         'examples/call/friendinvitesendtask.cc',
    #         'examples/call/friendinvitesendtask.h',
    #         'examples/call/mediaenginefactory.cc',
    #         'examples/call/mediaenginefactory.h',
    #         'examples/call/muc.h',
    #         'examples/call/mucinviterecvtask.cc',
    #         'examples/call/mucinviterecvtask.h',
    #         'examples/call/mucinvitesendtask.cc',
    #         'examples/call/mucinvitesendtask.h',
    #         'examples/call/presencepushtask.cc',
    #         'examples/call/presencepushtask.h',
    #       ],
    #       'conditions': [
    #         ['OS=="linux"', {
    #           'link_settings': {
    #             'libraries': [
    #               '<!@(pkg-config --libs-only-l gobject-2.0 gthread-2.0'
    #                   ' gtk+-2.0)',
    #             ],
    #           },
    #         }],
    #         ['OS=="win"', {
    #           'msvs_settings': {
    #             'VCLinkerTool': {
    #               'AdditionalDependencies': [
    #                 'strmiids.lib',
    #               ],
    #             },
    #           },
    #         }],
    #       ],  # conditions
    #     },  # target call
    #   ], # targets
    # }],  # OS!="android"
    ['OS=="linux" or OS=="win"', {
      'targets': [
        {
          'target_name': 'peerconnection_client',
          'type': 'executable',
          'sources': [
            'examples/peerconnection/client/conductor.cc',
            'examples/peerconnection/client/conductor.h',
            'examples/peerconnection/client/defaults.cc',
            'examples/peerconnection/client/defaults.h',
            'examples/peerconnection/client/peer_connection_client.cc',
            'examples/peerconnection/client/peer_connection_client.h',
          ],
          'dependencies': [
            '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
            'libjingle.gyp:libjingle_peerconnection',
            '<@(libjingle_tests_additional_deps)',
          ],
          'conditions': [
            # TODO(ronghuawu): Move these files to a win/ directory then they
            # can be excluded automatically.
            ['OS=="win"', {
              'sources': [
                'examples/peerconnection/client/flagdefs.h',
                'examples/peerconnection/client/main.cc',
                'examples/peerconnection/client/main_wnd.cc',
                'examples/peerconnection/client/main_wnd.h',
              ],
              'msvs_settings': {
                'VCLinkerTool': {
                 'SubSystem': '2',  # Windows
                },
              },
            }],  # OS=="win"
            ['OS=="linux"', {
              'sources': [
                'examples/peerconnection/client/linux/main.cc',
                'examples/peerconnection/client/linux/main_wnd.cc',
                'examples/peerconnection/client/linux/main_wnd.h',
              ],
              'cflags': [
                '<!@(pkg-config --cflags glib-2.0 gobject-2.0 gtk+-2.0)',
              ],
              'link_settings': {
                'ldflags': [
                  '<!@(pkg-config --libs-only-L --libs-only-other glib-2.0'
                      ' gobject-2.0 gthread-2.0 gtk+-2.0)',
                ],
                'libraries': [
                  '<!@(pkg-config --libs-only-l glib-2.0 gobject-2.0'
                      ' gthread-2.0 gtk+-2.0)',
                  '-lX11',
                  '-lXcomposite',
                  '-lXext',
                  '-lXrender',
                ],
              },
            }],  # OS=="linux"
          ],  # conditions
        },  # target peerconnection_client
      ], # targets
    }],  # OS=="linux" or OS=="win"

    ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")', {
      'targets': [
        {
          'target_name': 'AppRTCDemo',
          'type': 'executable',
          'product_name': 'AppRTCDemo',
          'mac_bundle': 1,
          'mac_bundle_resources': [
            'examples/objc/AppRTCDemo/channel.html',
          ],
          'dependencies': [
            'libjingle.gyp:libjingle_peerconnection_objc',
          ],
          'conditions': [
            ['OS=="ios"', {
              'mac_bundle_resources': [
                'examples/objc/AppRTCDemo/ios/ResourceRules.plist',
                'examples/objc/AppRTCDemo/ios/en.lproj/APPRTCViewController.xib',
                'examples/objc/Icon.png',
              ],
              'sources': [
                'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.h',
                'examples/objc/AppRTCDemo/ios/APPRTCAppDelegate.m',
                'examples/objc/AppRTCDemo/ios/APPRTCViewController.h',
                'examples/objc/AppRTCDemo/ios/APPRTCViewController.m',
                'examples/objc/AppRTCDemo/ios/AppRTCDemo-Prefix.pch',
                'examples/objc/AppRTCDemo/ios/main.m',
              ],
              'xcode_settings': {
                'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/ios/Info.plist',
              },
            }],
            ['OS=="mac"', {
              'sources': [
                'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.h',
                'examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.m',
                'examples/objc/AppRTCDemo/mac/APPRTCViewController.h',
                'examples/objc/AppRTCDemo/mac/APPRTCViewController.m',
                'examples/objc/AppRTCDemo/mac/main.m',
              ],
              'xcode_settings': {
                'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
                'INFOPLIST_FILE': 'examples/objc/AppRTCDemo/mac/Info.plist',
                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
                'OTHER_LDFLAGS': [
                  '-framework AVFoundation',
                  '-framework WebKit',
                ],
              },
            }],
            ['target_arch=="ia32"', {
              'dependencies' : [
                '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
              ],
            }],
          ],
          'include_dirs': [
            'examples/objc/APPRTCDemo',
          ],
          'sources': [
            'examples/objc/AppRTCDemo/APPRTCAppClient.h',
            'examples/objc/AppRTCDemo/APPRTCAppClient.m',
            'examples/objc/AppRTCDemo/APPRTCConnectionManager.h',
            'examples/objc/AppRTCDemo/APPRTCConnectionManager.m',
            'examples/objc/AppRTCDemo/GAEChannelClient.h',
            'examples/objc/AppRTCDemo/GAEChannelClient.m',
          ],
          'xcode_settings': {
            'CLANG_ENABLE_OBJC_ARC': 'YES',
          },
        },  # target AppRTCDemo
      ],  # targets
    }],  # OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.8")

    ['OS=="android"', {
      'targets': [
        {
          'target_name': 'AppRTCDemo',
          'type': 'none',
          'dependencies': [
            'libjingle.gyp:libjingle_peerconnection_jar',
          ],
          'actions': [
            {
              # TODO(fischman): convert from a custom script to a standard gyp
              # apk build once chromium's apk-building gyp machinery can be used
              # (http://crbug.com/225101)
              'action_name': 'build_apprtcdemo_apk',
              'inputs' : [
                '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
                '<(PRODUCT_DIR)/libjingle_peerconnection_so.so',
                'examples/android/AndroidManifest.xml',
                'examples/android/README',
                'examples/android/ant.properties',
                'examples/android/assets/channel.html',
                'examples/android/build.xml',
                'examples/android/jni/Android.mk',
                'examples/android/project.properties',
                'examples/android/res/drawable-hdpi/ic_launcher.png',
                'examples/android/res/drawable-ldpi/ic_launcher.png',
                'examples/android/res/drawable-mdpi/ic_launcher.png',
                'examples/android/res/drawable-xhdpi/ic_launcher.png',
                'examples/android/res/values/strings.xml',
                'examples/android/src/org/appspot/apprtc/AppRTCClient.java',
                'examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java',
                'examples/android/src/org/appspot/apprtc/AppRTCGLView.java',
                'examples/android/src/org/appspot/apprtc/UnhandledExceptionHandler.java',
                'examples/android/src/org/appspot/apprtc/GAEChannelClient.java',
              ],
              'outputs': [
                '<(PRODUCT_DIR)/AppRTCDemo-debug.apk',
              ],
              'variables': {
                'ant_log': '../../<(INTERMEDIATE_DIR)/ant.log', # ../.. to compensate for the cd examples/android below.
              },
              'action': [
                'bash', '-ec',
                'rm -fr <(_outputs) examples/android/{bin,libs} && '
                'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
                'mkdir -p examples/android/libs/<(android_app_abi) && '
                'cp <(PRODUCT_DIR)/libjingle_peerconnection.jar examples/android/libs/ &&'
                '<(android_strip) -o examples/android/libs/<(android_app_abi)/libjingle_peerconnection_so.so  <(PRODUCT_DIR)/libjingle_peerconnection_so.so &&'
                'cd examples/android && '
                '{ ANDROID_SDK_ROOT=<(android_sdk_root) '
                'ant debug > <(ant_log) 2>&1 || '
                '  { cat <(ant_log) ; exit 1; } } && '
                'cd - > /dev/null && '
                'cp examples/android/bin/AppRTCDemo-debug.apk <(_outputs)'
              ],
            },
          ],
        },  # target AppRTCDemo
      ],  # targets
    }],  # OS=="android"
  ],
}
<|endoftext|>


<commit_before>import setuptools

setuptools.setup(name="AutoSklearn",
                 description="Scikit-Learn wrapper for automatic "
                             "hyperparameter configuration.",
                 version="0.1dev",
                 packages=setuptools.find_packages(),
                 install_requires=["numpy",
                                   "scipy",
                                   "scikit_learn==0.15.1",
                                   "HPOlibConfigSpace==0.1dev"],
                 dependency_links=[
                     'git+https://github.com/mfeurer/HPOlibConfigSpace/'],
                     #'/tarball'/master#egg=HPOlibConfigSpace-0.1dev'],
                 package_data={'': ['*.txt', '*.md']},
                 author="Matthias Feurer",
                 author_email="feurerm@informatik.uni-freiburg.de",
                 license="BSD",
                 platforms=['Linux'],
                 classifiers=[],
                 url="github.com/mfeurer/autosklearn")
<commit_msg>setup.py edited online with Bitbucket<commit_after>import setuptools

setuptools.setup(name="AutoSklearn",
                 description="Scikit-Learn wrapper for automatic "
                             "hyperparameter configuration.",
                 version="0.1dev",
                 packages=setuptools.find_packages(),
                 install_requires=["numpy",
                                   "scipy",
                                   "scikit_learn==0.15.1",
                                   "HPOlibConfigSpace==0.1dev"],
                 package_data={'': ['*.txt', '*.md']},
                 author="Matthias Feurer",
                 author_email="feurerm@informatik.uni-freiburg.de",
                 license="BSD",
                 platforms=['Linux'],
                 classifiers=[],
                 url="github.com/mfeurer/autosklearn")
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup
from setuptools.command.test import test as TestCommand
import re
import os
import sys

# This command has been borrowed from
# https://github.com/getsentry/sentry/blob/master/setup.py
class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = ['tests']
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)

def get_packages(package):
    """
    Return root package and all sub-packages.
    """
    return [dirpath
            for dirpath, dirnames, filenames in os.walk(package)
            if os.path.exists(os.path.join(dirpath, '__init__.py'))]

def get_package_data(package):
    """
    Return all files under the root package, that are not in a
    package themselves.
    """
    walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
            for dirpath, dirnames, filenames in os.walk(package)
            if not os.path.exists(os.path.join(dirpath, '__init__.py'))]

    filepaths = []
    for base, filenames in walk:
        filepaths.extend([os.path.join(base, filename)
                          for filename in filenames])
    return {package: filepaths}

version = get_version('rest_framework')

if sys.argv[-1] == 'publish':
    os.system("python setup.py sdist upload")
    os.system("python setup.py bdist_wheel upload")
    print("You probably want to also tag the version now:")
    print("  git tag -a %s -m 'version %s'" % (version, version))
    print("  git push --tags")
    sys.exit()

setup(
    name='djangorestframework',
    version=version,
    url='http://www.django-rest-framework.org',
    license='BSD',
    description='Web APIs for Django, made easy.',
    author='Tom Christie',
    author_email='tom@tomchristie.com',  # SEE NOTE BELOW (*)
    packages=get_packages('rest_framework'),
    package_data=get_package_data('rest_framework'),
    cmdclass={'test': PyTest},
    install_requires=[],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP',
    ]
)

# (*) Please direct queries to the discussion group, rather than to me directly
#     Doing so helps ensure your question is helpful to other users.
#     Queries directly to my email are likely to receive a canned response.
#
#     Many thanks for your understanding.
<commit_msg>Enforce wheel check before allowing 'setup.pu publish'<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup
from setuptools.command.test import test as TestCommand
import re
import os
import sys

# This command has been borrowed from
# https://github.com/getsentry/sentry/blob/master/setup.py
class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = ['tests']
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)

def get_packages(package):
    """
    Return root package and all sub-packages.
    """
    return [dirpath
            for dirpath, dirnames, filenames in os.walk(package)
            if os.path.exists(os.path.join(dirpath, '__init__.py'))]

def get_package_data(package):
    """
    Return all files under the root package, that are not in a
    package themselves.
    """
    walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
            for dirpath, dirnames, filenames in os.walk(package)
            if not os.path.exists(os.path.join(dirpath, '__init__.py'))]

    filepaths = []
    for base, filenames in walk:
        filepaths.extend([os.path.join(base, filename)
                          for filename in filenames])
    return {package: filepaths}

version = get_version('rest_framework')

if sys.argv[-1] == 'publish':
    if os.system("pip freeze | grep wheel"):
        print "wheel not installed.\nUse `pip install wheel`.\nExiting."
        sys.exit()
    os.system("python setup.py sdist upload")
    os.system("python setup.py bdist_wheel upload")
    print("You probably want to also tag the version now:")
    print("  git tag -a %s -m 'version %s'" % (version, version))
    print("  git push --tags")
    sys.exit()

setup(
    name='djangorestframework',
    version=version,
    url='http://www.django-rest-framework.org',
    license='BSD',
    description='Web APIs for Django, made easy.',
    author='Tom Christie',
    author_email='tom@tomchristie.com',  # SEE NOTE BELOW (*)
    packages=get_packages('rest_framework'),
    package_data=get_package_data('rest_framework'),
    cmdclass={'test': PyTest},
    install_requires=[],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP',
    ]
)

# (*) Please direct queries to the discussion group, rather than to me directly
#     Doing so helps ensure your question is helpful to other users.
#     Queries directly to my email are likely to receive a canned response.
#
#     Many thanks for your understanding.
<|endoftext|>


<commit_before>import codecs
import os
import re
import sys
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()

def get_entity(package, entity):
    """
    eg, get_entity('ditto', 'version') returns `__version__` value in
    `__init__.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    find = "__%s__ = ['\"]([^'\"]+)['\"]" % entity
    return re.search(find, init_py).group(1)

def get_version():
    return get_entity('ditto', 'version')

def get_license():
    return get_entity('ditto', 'license')

def get_author():
    return get_entity('ditto', 'author')

def get_author_email():
    return get_entity('ditto', 'author_email')

# Do `python setup.py tag` to tag with the current version number.
if sys.argv[-1] == 'tag':
    os.system("git tag -a %s -m 'version %s'" % (get_version(), get_version()))
    os.system("git push --tags")
    sys.exit()

# Do `python setup.py publish` to send current version to PyPI.
if sys.argv[-1] == 'publish':
    os.system("python setup.py sdist upload -r pypi")
    # os.system("python setup.py bdist_wheel upload")
    sys.exit()

# Do `python setup.py testpublish` to send current version to Test PyPI.
if sys.argv[-1] == 'testpublish':
    os.system("python setup.py sdist upload -r pypitest")
    # os.system("python setup.py bdist_wheel upload")
    sys.exit()

setup(
    name='django-ditto',
    version=get_version(),
    packages=['ditto'],
    install_requires=[
        'django-imagekit>=4.0,<4.1',
        'django-sortedm2m>=1.5.0,<1.6',
        'django-taggit>=0.22.0,<0.30',
        'flickrapi>=2.3,<2.4',
        'pillow>=4.2.1,<4.3',
        'pytz',
        'twitter-text-python',
        'twython>=3.5.0,<3.6',
    ],
    dependency_links=[
    ],
    tests_require=[
        'factory-boy>=2.9.2,<2.10',
        'freezegun>=0.3.9,<0.4',
        'responses>=0.7.0,<0.8',
        'coverage',
    ],
    include_package_data=True,
    license=get_license(),
    description='A Django app to copy stuff from your accounts on Flickr, Last.fm, Pinboard and Twitter.',
    long_description=read(os.path.join(os.path.dirname(__file__), 'README.rst')),
    url='https://github.com/philgyford/django-ditto',
    author=get_author(),
    author_email=get_author_email(),
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
    ],
    keywords='ditto twitter flickr pinboard last.fm',
)
<commit_msg>Increase twython version to 3.6.0<commit_after>import codecs
import os
import re
import sys
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()

def get_entity(package, entity):
    """
    eg, get_entity('ditto', 'version') returns `__version__` value in
    `__init__.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    find = "__%s__ = ['\"]([^'\"]+)['\"]" % entity
    return re.search(find, init_py).group(1)

def get_version():
    return get_entity('ditto', 'version')

def get_license():
    return get_entity('ditto', 'license')

def get_author():
    return get_entity('ditto', 'author')

def get_author_email():
    return get_entity('ditto', 'author_email')

# Do `python setup.py tag` to tag with the current version number.
if sys.argv[-1] == 'tag':
    os.system("git tag -a %s -m 'version %s'" % (get_version(), get_version()))
    os.system("git push --tags")
    sys.exit()

# Do `python setup.py publish` to send current version to PyPI.
if sys.argv[-1] == 'publish':
    os.system("python setup.py sdist upload -r pypi")
    # os.system("python setup.py bdist_wheel upload")
    sys.exit()

# Do `python setup.py testpublish` to send current version to Test PyPI.
if sys.argv[-1] == 'testpublish':
    os.system("python setup.py sdist upload -r pypitest")
    # os.system("python setup.py bdist_wheel upload")
    sys.exit()

setup(
    name='django-ditto',
    version=get_version(),
    packages=['ditto'],
    install_requires=[
        'django-imagekit>=4.0,<4.1',
        'django-sortedm2m>=1.5.0,<1.6',
        'django-taggit>=0.22.0,<0.30',
        'flickrapi>=2.3,<2.4',
        'pillow>=4.2.1,<4.3',
        'pytz',
        'twitter-text-python',
        'twython>=3.6.0,<3.7',
    ],
    dependency_links=[
    ],
    tests_require=[
        'factory-boy>=2.9.2,<2.10',
        'freezegun>=0.3.9,<0.4',
        'responses>=0.7.0,<0.8',
        'coverage',
    ],
    include_package_data=True,
    license=get_license(),
    description='A Django app to copy stuff from your accounts on Flickr, Last.fm, Pinboard and Twitter.',
    long_description=read(os.path.join(os.path.dirname(__file__), 'README.rst')),
    url='https://github.com/philgyford/django-ditto',
    author=get_author(),
    author_email=get_author_email(),
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
    ],
    keywords='ditto twitter flickr pinboard last.fm',
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(
    name="cfgen",
    version="0.1.4",
    description="Configuration tool for configuration files",
    author="Renat Zhilkibaev",
    author_email="rzhilkibaev@gmail.com",
    license="MIT",
    url="https://github.com/rzhilkibaev/cfgen",
    packages=["cfgen"],
    install_requires=["docopt", "future", "jinja2"],
    scripts=["bin/cfgen"],
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Natural Language :: English",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python :: 2.7",
        "Topic :: Utilities",
        ],
)
<commit_msg>new version<commit_after>from setuptools import setup

setup(
    name="cfgen",
    version="0.2.0",
    description="Configuration tool for configuration files",
    author="Renat Zhilkibaev",
    author_email="rzhilkibaev@gmail.com",
    license="MIT",
    url="https://github.com/rzhilkibaev/cfgen",
    packages=["cfgen"],
    install_requires=["docopt", "future", "jinja2"],
    scripts=["bin/cfgen"],
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Natural Language :: English",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python :: 2.7",
        "Topic :: Utilities",
        ],
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages

readme = open("README.rst").read()

setup(
	name = "plantmeter",
	version = "1.7.0",
	description =
		"OpenERP module and library to manage multisite energy generation",
	author = "Som Energia SCCL",
	author_email = "info@somenergia.coop",
	url = 'https://github.com/Som-Energia/plantmeter',
	long_description = readme,
	license = 'GNU General Public License v3 or later (GPLv3+)',
	packages=find_packages(exclude=['*[tT]est*']),
	scripts=[
		],
	install_requires=[
        'pymongo<3.0',
        'numpy',
        'xlrd',
        'yamlns',
        'pytz',
        'erppeek',
        'consolemsg',
        'mock',
        'b2btest',
	],
	include_package_data = True,
	test_suite = 'plantmeter',
#	test_runner = 'colour_runner.runner.ColourTextTestRunner',
	classifiers = [
		'Programming Language :: Python',
		'Programming Language :: Python :: 3',
		'Topic :: Software Development :: Libraries :: Python Modules',
		'Intended Audience :: Developers',
		'Development Status :: 2 - Pre-Alpha',
		'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
		'Operating System :: OS Independent',
	],
)

<commit_msg>setup.py: installling genkwh_production.py script<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages

readme = open("README.rst").read()

setup(
	name = "plantmeter",
	version = "1.7.0",
	description =
		"OpenERP module and library to manage multisite energy generation",
	author = "Som Energia SCCL",
	author_email = "info@somenergia.coop",
	url = 'https://github.com/Som-Energia/plantmeter',
	long_description = readme,
	license = 'GNU General Public License v3 or later (GPLv3+)',
	packages=find_packages(exclude=['*[tT]est*']),
	scripts=[
		'scripts/genkwh_production.py',
		],
	install_requires=[
        'pymongo<3.0',
        'numpy',
        'xlrd',
        'yamlns',
        'pytz',
        'erppeek',
        'consolemsg',
        'mock',
        'b2btest',
	],
	include_package_data = True,
	test_suite = 'plantmeter',
#	test_runner = 'colour_runner.runner.ColourTextTestRunner',
	classifiers = [
		'Programming Language :: Python',
		'Programming Language :: Python :: 3',
		'Topic :: Software Development :: Libraries :: Python Modules',
		'Intended Audience :: Developers',
		'Development Status :: 2 - Pre-Alpha',
		'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
		'Operating System :: OS Independent',
	],
)

<|endoftext|>


<commit_before>from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

from datetime import date

# Create your models here.

@python_2_unicode_compatible
class Project(models.Model):
    name = models.CharField(max_length=50, verbose_name=_('Project name'))
    user = models.ForeignKey(User, null=True, related_name='projects', verbose_name=_('User'))

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _('Project')
        verbose_name_plural = _('Projects')

@python_2_unicode_compatible
class Task(models.Model):
    project = models.ForeignKey(Project, related_name='tasks', verbose_name=_('Project'))
    content = models.CharField(max_length=50, verbose_name=_('Task content'))
    deadline = models.DateTimeField(blank=True, null=True, verbose_name=_('Deadline'))
    done = models.BooleanField(default=False, verbose_name=_('Is done?'))
    order_id = models.PositiveIntegerField(default=1, verbose_name=_('Order id'))

    def is_deadline_today(self):
        return date.today() == self.deadline.date()

    def delete(self, using=None):
        tasks_to_reorder = self.project.tasks.filter(order_id__gte=self.order_id)
        for task in tasks_to_reorder:
            task.order_id -= 1
            task.save()
        return super(Task, self).delete(using)

    def save(self, force_insert=False, force_update=False, using=None,
             update_fields=None):

        max_order = lambda : self.project.tasks.all().aggregate(models.Max("order_id"))['order_id__max']
        # Set order for new model
        if not self.pk:
            max = max_order()

            if max:
                self.order_id = int(max) + 1
            else:
                self.order_id = 1

        # validate order id
        if self.pk:
            max = max_order()
            if self.order_id not in range(1, max + 2): # If last item change order
                raise ValueError("Invalid order id")   # there is moment where max
                                                       # actually will be incorrect
                                                       # so we use + 2 to keep margin

        return super(Task, self).save(force_insert, force_update, using, update_fields)

    def __str__(self):
        return self.content

    class Meta:
        verbose_name = _('Task')
        verbose_name_plural = _('Tasks')
        ordering = ['order_id']<commit_msg>disabled model validation<commit_after>from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

from datetime import date

# Create your models here.

@python_2_unicode_compatible
class Project(models.Model):
    name = models.CharField(max_length=50, verbose_name=_('Project name'))
    user = models.ForeignKey(User, null=True, related_name='projects', verbose_name=_('User'))

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = _('Project')
        verbose_name_plural = _('Projects')

@python_2_unicode_compatible
class Task(models.Model):
    project = models.ForeignKey(Project, related_name='tasks', verbose_name=_('Project'))
    content = models.CharField(max_length=50, verbose_name=_('Task content'))
    deadline = models.DateTimeField(blank=True, null=True, verbose_name=_('Deadline'))
    done = models.BooleanField(default=False, verbose_name=_('Is done?'))
    order_id = models.PositiveIntegerField(default=1, verbose_name=_('Order id'))

    def is_deadline_today(self):
        return date.today() == self.deadline.date()

    def delete(self, using=None):
        tasks_to_reorder = self.project.tasks.filter(order_id__gte=self.order_id)
        for task in tasks_to_reorder:
            task.order_id -= 1
            task.save()
        return super(Task, self).delete(using)

    def save(self, force_insert=False, force_update=False, using=None,
             update_fields=None):

        max_order = lambda : self.project.tasks.all().aggregate(models.Max("order_id"))['order_id__max']
        # Set order for new model
        if not self.pk:
            max = max_order()

            if max:
                self.order_id = int(max) + 1
            else:
                self.order_id = 1

        # validate order id
        # if self.pk:
        #     max = max_order()
        #     if self.order_id not in range(1, max + 2): # If last item change order
        #         raise ValueError("Invalid order id")   # there is moment where max
        #                                                # actually will be incorrect
        #                                                # so we use + 2 to keep margin

        return super(Task, self).save(force_insert, force_update, using, update_fields)

    def __str__(self):
        return self.content

    class Meta:
        verbose_name = _('Task')
        verbose_name_plural = _('Tasks')
        ordering = ['order_id']<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='django-debug-toolbar',
    version='0.9.0-dev',
    description='A configurable set of panels that display various debug information about the current request/response.',
    long_description=open('README.rst').read(),
    # Get more strings from http://www.python.org/pypi?:action=list_classifiers
    author='Rob Hudson',
    author_email='rob@cogit8.org',
    url='https://github.com/django-debug-toolbar/django-debug-toolbar',
    download_url='https://github.com/django-debug-toolbar/django-debug-toolbar/downloads',
    license='BSD',
    packages=find_packages(exclude=('ez_setup', 'tests', 'example')),
    tests_require=[
        'django>=1.1,<1.4',
        'dingus',
    ],
    test_suite='runtests.runtests',
    include_package_data=True,
    zip_safe=False, # because we're including media that Django needs
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)
<commit_msg>Version to 0.9.0<commit_after>from setuptools import setup, find_packages

setup(
    name='django-debug-toolbar',
    version='0.9.0',
    description='A configurable set of panels that display various debug information about the current request/response.',
    long_description=open('README.rst').read(),
    # Get more strings from http://www.python.org/pypi?:action=list_classifiers
    author='Rob Hudson',
    author_email='rob@cogit8.org',
    url='https://github.com/django-debug-toolbar/django-debug-toolbar',
    download_url='https://github.com/django-debug-toolbar/django-debug-toolbar/downloads',
    license='BSD',
    packages=find_packages(exclude=('ez_setup', 'tests', 'example')),
    tests_require=[
        'django>=1.1,<1.4',
        'dingus',
    ],
    test_suite='runtests.runtests',
    include_package_data=True,
    zip_safe=False, # because we're including media that Django needs
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)
<|endoftext|>


<commit_before>import os
import sys
from subprocess import Popen, PIPE, check_call
from distutils.core import setup, Extension

import versioneer

versioneer.versionfile_source = 'llvm/_version.py'
versioneer.versionfile_build = 'llvm/_version.py'
versioneer.tag_prefix = ''
versioneer.parentdir_prefix = 'llvmpy-'

# On win32, there is a fake llvm-config since llvm doesn't supply one
if sys.platform == 'win32':
    default_llvm_config = 'python llvm-config-win32.py'
else:
    default_llvm_config = 'llvm-config'

llvm_config = os.environ.get('LLVM_CONFIG_PATH', default_llvm_config)

def run_llvm_config(extra_args):
    args = llvm_config.split()
    args.extend(extra_args)
    try:
        p = Popen(args, stdout=PIPE, stderr=PIPE)
    except OSError:
        sys.exit("Error: could not invoke %r\n"
                 "Try setting LLVM_CONFIG_PATH=/path/to/llvm-config" % args)
    stdout, stderr = p.communicate()
    if stderr:
        raise Exception("%r stderr is:\n%s" % (args, stderr.decode()))
    return stdout.decode().strip()

llvm_version = run_llvm_config(['--version'])
print('LLVM version = %r' % llvm_version)

def get_libs_and_objs(components):
    parts = run_llvm_config(['--libs'] + components).split()
    libs = []
    objs = []
    for part in parts:
        if part.startswith('-l'):
            libs.append(part[2:])
        elif part.endswith('.o'):
            objs.append(part)
    return libs, objs

def get_enabled_components():
    return run_llvm_config(['--components']).split()

def auto_intrinsic_gen(incdir):
    # let's do auto intrinsic generation
    print("Generate intrinsic IDs")
    from tools import intrgen
    path = "%s/llvm/Intrinsics.gen" % incdir
    with open('llvm/_intrinsic_ids.py', 'w') as fout:
        intrgen.gen(path, fout)

incdir = run_llvm_config(['--includedir'])
libdir = run_llvm_config(['--libdir'])
ldflags = run_llvm_config(['--ldflags'])

auto_intrinsic_gen(incdir)

macros = [('__STDC_CONSTANT_MACROS', None),
          ('__STDC_LIMIT_MACROS', None)]

def determine_to_use_dynlink(libdir, llvm_version):
    user_envvar = os.getenv('LLVMPY_DYNLINK')
    if user_envvar:
        # if users sets LLVMPY_DYNLINK=[0|1]
        # respect the user setting
        print('User sets LLVMPY_DYNLINK to %s' % user_envvar)
        return bool(int(user_envvar))
    else:
        # otherwise, determine by scanning the libdir
        libfile = 'libLLVM-%s' % llvm_version
        print('Searching shared library %s in %s' % (libfile, libdir))
        so = '%s.so' % libfile
        dylib = '%s.dylib' % libfile
        dll = '%s.dll' % libfile
        libdir_content = os.listdir(libdir)
        if sys.platform.startswith('linux'):
            return so in libdir_content
        elif sys.platform.startswith('darwin'):
            return dylib in libdir_content or so in libdir_content
        elif sys.platform.startswith('win32'):
            return dll in libdir_content
        else: # other platforms
            return any((x in libdir_content) for x in [so, dylib, dll])

dynlink = determine_to_use_dynlink(libdir, llvm_version)
ptx_support = ''

if dynlink:
    print('Using dynamic linking')
    libs_core = ['LLVM-%s' % llvm_version]
    objs_core = []
else:
    enabled_components = set(get_enabled_components())
    ptx_components = set(['ptx',
                          'ptxasmprinter',
                          'ptxcodegen',
                          'ptxdesc',
                          'ptxinfo'])
    nvptx_components = set(['nvptx',
                            'nvptxasmprinter',
                            'nvptxcodegen',
                            'nvptxdesc',
                            'nvptxinfo'])

    extra_components = []
    if (nvptx_components & enabled_components) == nvptx_components:
        print("Using NVPTX")
        extra_components.extend(nvptx_components)
        ptx_support = 'NVPTX'
    elif (ptx_components & enabled_components) == ptx_components:
        print("Using PTX")
        extra_components.extend(ptx_components)
        ptx_support = 'PTX'
    else:
        print("No CUDA support")

    libs_core, objs_core = get_libs_and_objs(
        ['core', 'analysis', 'scalaropts', 'executionengine',
         'jit',  'native', 'interpreter', 'bitreader', 'bitwriter',
         'instrumentation', 'ipa', 'ipo', 'transformutils',
         'asmparser', 'linker', 'support', 'vectorize']
        + extra_components)

if sys.platform == 'win32':
    # If no PTX lib got added, disable PTX in the build
    if 'LLVMPTXCodeGen' in libs_core:
        ptx_support = 'ptx'
else:
    macros.append(('_GNU_SOURCE', None))

# auto generate bindings
os.environ['LLVMPY_PTX_SUPPORT'] = ptx_support
os.environ['LLVMPY_LLVM_VERSION'] = llvm_version
check_call([sys.executable, 'llvmpy/build.py'])

# generate shared objects
extra_link_args = ldflags.split()
kwds = dict(
    ext_modules = [
        Extension(
            name='llvmpy._api',
            sources=['llvmpy/api.cpp'],
            define_macros = macros,
            include_dirs = [incdir, 'llvmpy/include'],
            library_dirs = [libdir],
            libraries = libs_core,
            extra_objects = objs_core,
            extra_link_args = extra_link_args),

        Extension(
            name='llvmpy._capsule',
            sources=['llvmpy/capsule.cpp'],
            include_dirs=['llvmpy/include'],
        )
#        Extension(name='llvm._dwarf',
#                  sources=['llvm/_dwarf.cpp'],
#                  include_dirs=[incdir])
        ],
    cmdclass = versioneer.get_cmdclass(),
)

if sys.version_info[0] == 3:
    from distutils.command.build_py import build_py_2to3
    kwds["cmdclass"]['build_py'] = build_py_2to3

kwds['long_description'] = open('README.rst').read()

setup(
    name = 'llvmpy',
    version=versioneer.get_version(),
    description = 'Python bindings for LLVM',
    author = 'R Mahadevan, Siu Kwan Lam',
    maintainer = 'Continuum Analytics, Inc.',
    maintainer_email = 'llvmpy@continuum.io',
    url = 'http://www.llvmpy.org/',
    packages = ['llvm', 'llvm.workaround',
                'llvm_cbuilder',
                'llpython',
                'llvmpy.api', 'llvmpy.api.llvm'],
    py_modules = ['llvmpy',
                  'llvmpy._capsule',
                  'llvmpy._api',
                  'llvmpy.capsule',
                  'llvmpy.extra'],
    license = "BSD",
    classifiers = [
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
        "Programming Language :: C++",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
    ],
    **kwds
)
<commit_msg>disable lib2to3 conversion<commit_after>import os
import sys
from subprocess import Popen, PIPE, check_call
from distutils.core import setup, Extension

import versioneer

versioneer.versionfile_source = 'llvm/_version.py'
versioneer.versionfile_build = 'llvm/_version.py'
versioneer.tag_prefix = ''
versioneer.parentdir_prefix = 'llvmpy-'

# On win32, there is a fake llvm-config since llvm doesn't supply one
if sys.platform == 'win32':
    default_llvm_config = 'python llvm-config-win32.py'
else:
    default_llvm_config = 'llvm-config'

llvm_config = os.environ.get('LLVM_CONFIG_PATH', default_llvm_config)

def run_llvm_config(extra_args):
    args = llvm_config.split()
    args.extend(extra_args)
    try:
        p = Popen(args, stdout=PIPE, stderr=PIPE)
    except OSError:
        sys.exit("Error: could not invoke %r\n"
                 "Try setting LLVM_CONFIG_PATH=/path/to/llvm-config" % args)
    stdout, stderr = p.communicate()
    if stderr:
        raise Exception("%r stderr is:\n%s" % (args, stderr.decode()))
    return stdout.decode().strip()

llvm_version = run_llvm_config(['--version'])
print('LLVM version = %r' % llvm_version)

def get_libs_and_objs(components):
    parts = run_llvm_config(['--libs'] + components).split()
    libs = []
    objs = []
    for part in parts:
        if part.startswith('-l'):
            libs.append(part[2:])
        elif part.endswith('.o'):
            objs.append(part)
    return libs, objs

def get_enabled_components():
    return run_llvm_config(['--components']).split()

def auto_intrinsic_gen(incdir):
    # let's do auto intrinsic generation
    print("Generate intrinsic IDs")
    from tools import intrgen
    path = "%s/llvm/Intrinsics.gen" % incdir
    with open('llvm/_intrinsic_ids.py', 'w') as fout:
        intrgen.gen(path, fout)

incdir = run_llvm_config(['--includedir'])
libdir = run_llvm_config(['--libdir'])
ldflags = run_llvm_config(['--ldflags'])

auto_intrinsic_gen(incdir)

macros = [('__STDC_CONSTANT_MACROS', None),
          ('__STDC_LIMIT_MACROS', None)]

def determine_to_use_dynlink(libdir, llvm_version):
    user_envvar = os.getenv('LLVMPY_DYNLINK')
    if user_envvar:
        # if users sets LLVMPY_DYNLINK=[0|1]
        # respect the user setting
        print('User sets LLVMPY_DYNLINK to %s' % user_envvar)
        return bool(int(user_envvar))
    else:
        # otherwise, determine by scanning the libdir
        libfile = 'libLLVM-%s' % llvm_version
        print('Searching shared library %s in %s' % (libfile, libdir))
        so = '%s.so' % libfile
        dylib = '%s.dylib' % libfile
        dll = '%s.dll' % libfile
        libdir_content = os.listdir(libdir)
        if sys.platform.startswith('linux'):
            return so in libdir_content
        elif sys.platform.startswith('darwin'):
            return dylib in libdir_content or so in libdir_content
        elif sys.platform.startswith('win32'):
            return dll in libdir_content
        else: # other platforms
            return any((x in libdir_content) for x in [so, dylib, dll])

dynlink = determine_to_use_dynlink(libdir, llvm_version)
ptx_support = ''

if dynlink:
    print('Using dynamic linking')
    libs_core = ['LLVM-%s' % llvm_version]
    objs_core = []
else:
    enabled_components = set(get_enabled_components())
    ptx_components = set(['ptx',
                          'ptxasmprinter',
                          'ptxcodegen',
                          'ptxdesc',
                          'ptxinfo'])
    nvptx_components = set(['nvptx',
                            'nvptxasmprinter',
                            'nvptxcodegen',
                            'nvptxdesc',
                            'nvptxinfo'])

    extra_components = []
    if (nvptx_components & enabled_components) == nvptx_components:
        print("Using NVPTX")
        extra_components.extend(nvptx_components)
        ptx_support = 'NVPTX'
    elif (ptx_components & enabled_components) == ptx_components:
        print("Using PTX")
        extra_components.extend(ptx_components)
        ptx_support = 'PTX'
    else:
        print("No CUDA support")

    libs_core, objs_core = get_libs_and_objs(
        ['core', 'analysis', 'scalaropts', 'executionengine',
         'jit',  'native', 'interpreter', 'bitreader', 'bitwriter',
         'instrumentation', 'ipa', 'ipo', 'transformutils',
         'asmparser', 'linker', 'support', 'vectorize']
        + extra_components)

if sys.platform == 'win32':
    # If no PTX lib got added, disable PTX in the build
    if 'LLVMPTXCodeGen' in libs_core:
        ptx_support = 'ptx'
else:
    macros.append(('_GNU_SOURCE', None))

# auto generate bindings
os.environ['LLVMPY_PTX_SUPPORT'] = ptx_support
os.environ['LLVMPY_LLVM_VERSION'] = llvm_version
check_call([sys.executable, 'llvmpy/build.py'])

# generate shared objects
extra_link_args = ldflags.split()
kwds = dict(
    ext_modules = [
        Extension(
            name='llvmpy._api',
            sources=['llvmpy/api.cpp'],
            define_macros = macros,
            include_dirs = [incdir, 'llvmpy/include'],
            library_dirs = [libdir],
            libraries = libs_core,
            extra_objects = objs_core,
            extra_link_args = extra_link_args),

        Extension(
            name='llvmpy._capsule',
            sources=['llvmpy/capsule.cpp'],
            include_dirs=['llvmpy/include'],
        )
#        Extension(name='llvm._dwarf',
#                  sources=['llvm/_dwarf.cpp'],
#                  include_dirs=[incdir])
        ],
    cmdclass = versioneer.get_cmdclass(),
)

#if sys.version_info[0] == 3:
#    from distutils.command.build_py import build_py_2to3
#    kwds["cmdclass"]['build_py'] = build_py_2to3

kwds['long_description'] = open('README.rst').read()

setup(
    name = 'llvmpy',
    version=versioneer.get_version(),
    description = 'Python bindings for LLVM',
    author = 'R Mahadevan, Siu Kwan Lam',
    maintainer = 'Continuum Analytics, Inc.',
    maintainer_email = 'llvmpy@continuum.io',
    url = 'http://www.llvmpy.org/',
    packages = ['llvm', 'llvm.workaround',
                'llvm_cbuilder',
                'llpython',
                'llvmpy.api', 'llvmpy.api.llvm'],
    py_modules = ['llvmpy',
                  'llvmpy._capsule',
                  'llvmpy._api',
                  'llvmpy.capsule',
                  'llvmpy.extra'],
    license = "BSD",
    classifiers = [
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
        "Programming Language :: C++",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
    ],
    **kwds
)
<|endoftext|>


<commit_before>from setuptools import setup
import sys

execfile('yas3fs/_version.py')

install_requires = ['boto>=2.25.0', 'fusepy>=2.0.2']

# Versions of Python pre-2.7 require argparse separately. 2.7+ and 3+ all
# include this as the replacement for optparse.
if sys.version_info[:2] < (2, 7):
    install_requires.append("argparse")

setup(
    name='yas3fs',
    version=__version__,
    description='YAS3FS (Yet Another S3-backed File System) is a Filesystem in Userspace (FUSE) interface to Amazon S3.',
    packages=['yas3fs'],
    author='Danilo Poccia',
    author_email='dpoccia@gmail.com',
    install_requires=install_requires,
    entry_points = { 'console_scripts': ['yas3fs = yas3fs:main'] },
    )
<commit_msg>setup fix.<commit_after>from setuptools import setup, find_packages
import sys

execfile('yas3fs/_version.py')

requires = ['boto>=2.25.0', 'fusepy>=2.0.2']

# Versions of Python pre-2.7 require argparse separately. 2.7+ and 3+ all
# include this as the replacement for optparse.
if sys.version_info[:2] < (2, 7):
    requires.append("argparse")

setup(
    name='yas3fs',
    version=__version__,
    description='YAS3FS (Yet Another S3-backed File System) is a Filesystem in Userspace (FUSE) interface to Amazon S3.',
    packages=find_packages(),
    author='Danilo Poccia',
    author_email='dpoccia@gmail.com',
    url='https://github.com/danilop/yas3fs',
    install_requires=requires,
    entry_points = { 'console_scripts': ['yas3fs = yas3fs:main'] },
    )
<|endoftext|>


<commit_before>from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

fastavro = Extension("fastavro", ["fastavro.pyx"])

setup(
    name='fastavro',
    version='0.1.0',
    description='Fast iteration of AVRO files',
    author='Miki Tebeka',
    author_email='miki.tebeka@gmail.com',
    license='MIT',
    url='https://bitbucket.org/tebeka/fastavro',
    ext_modules = [fastavro],
    cmdclass = {'build_ext': build_ext},
)
<commit_msg>dependencies<commit_after>from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

fastavro = Extension("fastavro", ["fastavro.pyx"])

setup(
    name='fastavro',
    version='0.1.0',
    description='Fast iteration of AVRO files',
    author='Miki Tebeka',
    author_email='miki.tebeka@gmail.com',
    license='MIT',
    url='https://bitbucket.org/tebeka/fastavro',
    ext_modules=[fastavro],
    cmdclass={'build_ext': build_ext},
    install_requires=['cython'],
)
<|endoftext|>


<commit_before># Copyright (C) 2014 Parker Michaels
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import os.path
from cx_Freeze import setup,Executable

includefiles = [
    os.path.join('Generator', 'Emitter', 'Template', 'LexicalAnalyzer.bas'),
    os.path.join('Generator', 'Emitter', 'Template', 'LexicalAnalyzer.bi'),
    os.path.join('Stream', 'Windows', 'MemoryMapWindows.bi'),
    os.path.join('Stream', 'Windows', 'MemoryMapWindows.bas'),
    os.path.join('Stream', 'Linux', 'MemoryMapLinux.bi'),
    os.path.join('Stream', 'Linux', 'MemoryMapLinux.bas'),
    os.path.join('Stream', 'MemoryMap.bas'),
    os.path.join('Stream', 'MemoryMap.bi'),
    os.path.join('Stream', 'Unicode.bas'),
    os.path.join('Stream', 'Unicode.bi'),
    os.path.join('Stream', 'UnicodeConstants.bas'),
    os.path.join('Stream', 'UnicodeConstants.bi'),
    os.path.join('Stream', 'UTF8Stream.bas'),
    os.path.join('Stream', 'UTF8Stream.bi'),
    os.path.join('Stream', 'UTF16Stream.bas'),
    os.path.join('Stream', 'UTF16Stream.bi'),
    os.path.join('Stream', 'UTF32Stream.bas'),
    os.path.join('Stream', 'UTF32Stream.bi'),
    os.path.join('Stream', 'ASCIIStream.bas'),
    os.path.join('Stream', 'ASCIIStream.bi'),
    os.path.join('Stream', 'CharacterStream.bas'),
    os.path.join('Stream', 'CharacterStream.bi'),
    os.path.join('Stream', 'CharacterStreamFromFile.bas'),
    os.path.join('Stream', 'CharacterStreamFromFile.bi'),
    os.path.join('Test', 'Test.txt'),
    os.path.join('Test', 'make_test.bat'),
    os.path.join('Test', 'make_test.sh'),
    os.path.join('Test', 'Test.bas'),
    os.path.join('Test', 'Test.rules'),
    'README',
    'LICENSE'
]
includes = []
excludes = []
packages = ['blist']

setup(
    name = 'Poodle-Lex',
    version = '0.5',
    description = 'A lexical analyzer generator which emits FreeBASIC code',
    author = 'Parker Michaels',
    author_email = 'parkertomatoes@gmail.com',
    options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
    executables = [Executable('__main__.py', targetName="Poodle-Lex.exe")]
)
<commit_msg>Don't use .exe for non-Windows builds<commit_after># Copyright (C) 2014 Parker Michaels
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

import os.path
import platform
from cx_Freeze import setup,Executable

includefiles = [
    os.path.join('Generator', 'Emitter', 'Template', 'LexicalAnalyzer.bas'),
    os.path.join('Generator', 'Emitter', 'Template', 'LexicalAnalyzer.bi'),
    os.path.join('Stream', 'Windows', 'MemoryMapWindows.bi'),
    os.path.join('Stream', 'Windows', 'MemoryMapWindows.bas'),
    os.path.join('Stream', 'Linux', 'MemoryMapLinux.bi'),
    os.path.join('Stream', 'Linux', 'MemoryMapLinux.bas'),
    os.path.join('Stream', 'MemoryMap.bas'),
    os.path.join('Stream', 'MemoryMap.bi'),
    os.path.join('Stream', 'Unicode.bas'),
    os.path.join('Stream', 'Unicode.bi'),
    os.path.join('Stream', 'UnicodeConstants.bas'),
    os.path.join('Stream', 'UnicodeConstants.bi'),
    os.path.join('Stream', 'UTF8Stream.bas'),
    os.path.join('Stream', 'UTF8Stream.bi'),
    os.path.join('Stream', 'UTF16Stream.bas'),
    os.path.join('Stream', 'UTF16Stream.bi'),
    os.path.join('Stream', 'UTF32Stream.bas'),
    os.path.join('Stream', 'UTF32Stream.bi'),
    os.path.join('Stream', 'ASCIIStream.bas'),
    os.path.join('Stream', 'ASCIIStream.bi'),
    os.path.join('Stream', 'CharacterStream.bas'),
    os.path.join('Stream', 'CharacterStream.bi'),
    os.path.join('Stream', 'CharacterStreamFromFile.bas'),
    os.path.join('Stream', 'CharacterStreamFromFile.bi'),
    os.path.join('Test', 'Test.txt'),
    os.path.join('Test', 'make_test.bat'),
    os.path.join('Test', 'make_test.sh'),
    os.path.join('Test', 'Test.bas'),
    os.path.join('Test', 'Test.rules'),
    'README',
    'LICENSE'
]
includes = []
excludes = []
packages = ['blist']
target_name = "Poodle-Lex"
if platform.system() == "Windows":
    target_name += ".exe"
setup(
    name = 'Poodle-Lex',
    version = '0.5',
    description = 'A lexical analyzer generator which emits FreeBASIC code',
    author = 'Parker Michaels',
    author_email = 'parkertomatoes@gmail.com',
    options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
    executables = [Executable('__main__.py', targetName=target_name)]
)
<|endoftext|>