Example #1
0
    def __init__(self):
        self.navitia = None
        self.parsers = {}
        self.parsers["get"] = reqparse.RequestParser()
        parser_get = self.parsers["get"]

        parser_get.add_argument("start_page", type=int, default=1)
        parser_get.add_argument("items_per_page", type=int, default=20)
        parser_get.add_argument("publication_status[]",
                                type=option_value(publication_status_values),
                                action="append",
                                default=publication_status_values)
        parser_get.add_argument("ends_after_date", type=utils.get_datetime),
        parser_get.add_argument("ends_before_date", type=utils.get_datetime),
        parser_get.add_argument("tag[]", type=utils.get_uuid, action="append")
        parser_get.add_argument("current_time", type=utils.get_datetime)
        parser_get.add_argument("uri", type=str)
        parser_get.add_argument("line_section",
                                type=types.boolean,
                                default=False)
        parser_get.add_argument("status[]",
                                type=option_value(disruption_status_values),
                                action="append",
                                default=disruption_status_values)
        parser_get.add_argument("depth", type=int, default=1)
Example #2
0
 def __init__(self):
     current_datetime = utils.get_current_time()
     default_start_date = current_datetime.replace(hour=0, minute=0, second=0)
     default_end_date = current_datetime.replace(hour=23, minute=59, second=59)
     self.parsers = {}
     self.parsers["get"] = reqparse.RequestParser()
     parser_get = self.parsers["get"]
     parser_get.add_argument("pt_object_type", type=option_value(pt_object_type_values))
     parser_get.add_argument("start_date", type=utils.get_datetime, default=default_start_date)
     parser_get.add_argument("end_date", type=utils.get_datetime, default=default_end_date)
     parser_get.add_argument("uri[]", type=str, action="append")
     self.navitia = None
Example #3
0
 def __init__(self):
     current_datetime = utils.get_current_time()
     default_start_date = current_datetime.replace(hour=0, minute=0, second=0)
     default_end_date = current_datetime.replace(hour=23, minute=59, second=59)
     self.parsers = {}
     self.parsers["get"] = reqparse.RequestParser()
     parser_get = self.parsers["get"]
     parser_get.add_argument("pt_object_type", type=option_value(pt_object_type_values))
     parser_get.add_argument("start_date", type=utils.get_datetime, default=default_start_date)
     parser_get.add_argument("end_date", type=utils.get_datetime, default=default_end_date)
     parser_get.add_argument("uri[]", type=str, action="append")
     self.navitia = None
Example #4
0
    def __init__(self):
        self.navitia = None
        self.parsers = {}
        self.parsers["get"] = reqparse.RequestParser()
        parser_get = self.parsers["get"]

        parser_get.add_argument("start_page", type=int, default=1)
        parser_get.add_argument("items_per_page", type=int, default=20)
        parser_get.add_argument("publication_status[]",
                                type=option_value(publication_status_values),
                                action="append",
                                default=publication_status_values)
        parser_get.add_argument("tag[]",
                                type=utils.get_uuid,
                                action="append")
        parser_get.add_argument("current_time", type=utils.get_datetime)
        parser_get.add_argument("uri", type=str)
        parser_get.add_argument(
            "status[]",
            type=option_value(disruption_status_values),
            action="append",
            default=disruption_status_values
        )
Example #5
0
##
## $QT_END_LICENSE$
##
#############################################################################

from __future__ import print_function
import os
import sys
import shutil
from subprocess import PIPE, Popen
from utils import option_value
from utils import run_process

git_server = "git://code.qt.io"

QT_CI_TESTED_SUBMODULE = option_value("module")
SUBMODULE_BRANCH = option_value("branch")

submodules = {
    "shiboken2": "shiboken",
    "pyside2": "pyside",
    "pyside2-tools": "pyside-tools",
    "pyside2-examples": "examples"
}


def usage():
    print("""\
This is a utility script for pyside-setup to prepare its source tree for testing
by the Qt Continuous Integration (CI). The script will checkout all submodules in the
pyside-setup/ sources directory except the one under test in the CI. The submodule
Example #6
0
from qtinfo import QtInfo
from utils import rmtree
from utils import makefile
from utils import copyfile
from utils import copydir
from utils import run_process
from utils import has_option
from utils import option_value
from utils import update_env_path
from utils import init_msvc_env

# Declare options
OPTION_DEBUG = has_option("debug")
OPTION_RELWITHDEBINFO = has_option('relwithdebinfo')
OPTION_QMAKE = option_value("qmake")
OPTION_CMAKE = option_value("cmake")
OPTION_OPENSSL = option_value("openssl")
OPTION_ONLYPACKAGE = has_option("only-package")
OPTION_STANDALONE = has_option("standalone")
OPTION_VERSION = option_value("version")
OPTION_LISTVERSIONS = has_option("list-versions")
OPTION_MAKESPEC = option_value("make-spec")
OPTION_IGNOREGIT = has_option("ignore-git")
OPTION_MSVCVERSION = option_value("msvc-version")

if OPTION_QMAKE is None:
    OPTION_QMAKE = find_executable("qmake")
if OPTION_CMAKE is None:
    OPTION_CMAKE = find_executable("cmake")
Example #7
0
            found = re.search(pattern, line)
            if found:
                major = int(found.group(1))
                minor = int(found.group(2))
                supported.append( (major, minor) )
    this_py = sys.version_info[:2]
    if this_py not in supported:
        print("only these python versions are supported:", supported)
        sys.exit(1)

check_allowed_python_version()

# Declare options
OPTION_DEBUG = has_option("debug")
OPTION_RELWITHDEBINFO = has_option('relwithdebinfo')
OPTION_QMAKE = option_value("qmake")
OPTION_CMAKE = option_value("cmake")
OPTION_OPENSSL = option_value("openssl")
OPTION_ONLYPACKAGE = has_option("only-package")
OPTION_STANDALONE = has_option("standalone")
OPTION_VERSION = option_value("version")
OPTION_LISTVERSIONS = has_option("list-versions")
OPTION_MAKESPEC = option_value("make-spec")
OPTION_IGNOREGIT = has_option("ignore-git")
OPTION_NOEXAMPLES = has_option("no-examples")     # don't include pyside2-examples
OPTION_JOBS = option_value('jobs')                # number of parallel build jobs
OPTION_JOM = has_option('jom')                    # use jom instead of nmake with msvc
OPTION_BUILDTESTS = has_option("build-tests")
OPTION_OSXARCH = option_value("osx-arch")
OPTION_XVFB = has_option("use-xvfb")
Example #8
0
            if found:
                major = int(found.group(1))
                minor = int(found.group(2))
                supported.append((major, minor))
    this_py = sys.version_info[:2]
    if this_py not in supported:
        print("only these python versions are supported:", supported)
        sys.exit(1)


check_allowed_python_version()

# Declare options
OPTION_DEBUG = has_option("debug")
OPTION_RELWITHDEBINFO = has_option('relwithdebinfo')
OPTION_QMAKE = option_value("qmake")
OPTION_CMAKE = option_value("cmake")
OPTION_OPENSSL = option_value("openssl")
OPTION_ONLYPACKAGE = has_option("only-package")
OPTION_STANDALONE = has_option("standalone")
OPTION_VERSION = option_value("version")
OPTION_LISTVERSIONS = has_option("list-versions")
OPTION_MAKESPEC = option_value("make-spec")
OPTION_IGNOREGIT = has_option("ignore-git")
OPTION_NOEXAMPLES = has_option("no-examples")  # don't include pyside-examples
OPTION_JOBS = option_value('jobs')  # number of parallel build jobs
OPTION_JOM = has_option('jom')  # use jom instead of nmake with msvc
OPTION_BUILDTESTS = has_option("build-tests")
OPTION_OSXARCH = option_value("osx-arch")

if OPTION_QMAKE is None:
Example #9
0
def main():
    __version__ = '1.1.3'

    OPTION_MATLAB = option_value('matlab')
    OPTION_DEVENV = option_value('devenv')


    # global variables begin

    MATLAB_COMMAND = 'matlab'   # specify a full path if not in PATH
    MATLAB_VERSION = 7.3       # e.g: 6 (one of (6, 6.5, 7, 7.3))
                                #      7.3 includes later versions as well
    #MATLAB_DIR = find_matlab()
    MATLAB_DIR = os.path.dirname(os.path.dirname(OPTION_MATLAB))
    if not MATLAB_DIR:
        print('You must set environment variable MATLAB_HOME first.')
        return 1

    PLATFORM_DIR = None           # e.g: 'glnx86'; r'win32/microsoft/msvc60'
    EXTRA_COMPILE_ARGS = None     # e.g: ['-G']

    # hopefully these 3 won't need modification
    MATLAB_LIBRARIES = None       # e.g: ['eng', 'mx', 'mat', 'mi', 'ut']
    USE_NUMERIC = None            # use obsolete Numeric instead of numpy?
    PYTHON_INCLUDE_DIR = None     # where to find numpy/*.h

    SUPPORT_MODULES = ["awmstools"]  # set to [] if already
                                    # installed
    ########################### WINDOWS ONLY ###########################
    #  Option 1: Visual Studio
    #  -----------------------
    #  only needed for Windows Visual Studio (tm) build
    #  (adjust if necessary if you use a different version/path of VC)
    #VC_DIR='C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC'
    # NOTE: You'll also need to adjust PLATFORM_DIR accordingly
    #
    #  Option 2: Borland C++
    #  ---------------------
    #  uncomment (and adjust if necessary) the following lines to use Borland C++
    #  instead of VC:
    #
    #VC_DIR=None
    VC_DIR = find_visual_studio(OPTION_DEVENV)
    #PLATFORM_DIR="win32/borland/bc54"
    PLATFORM = '32'

    # global variables end

    ####################################################################
    ### NO MODIFICATIONS SHOULD BE NECESSARY BEYOND THIS POINT       ###
    ####################################################################
    # *******************************************************************

    if sys.version_info < (2, 2):
        print >> sys.stderr, "You need at least python 2.2"
        return 1

    if PYTHON_INCLUDE_DIR is None and not USE_NUMERIC:
        try:
            import numpy
            PYTHON_INCLUDE_DIR = numpy.get_include()
        except ImportError:
            print("Warning: numpy not found. Still using Numeric?")
            try:
                import Numeric
                if USE_NUMERIC is None:
                    USE_NUMERIC = True
            except ImportError:
                print("CANNOT FIND EITHER NUMPY *OR* NUMERIC")

    def matlab_params(cmd, is_windows, extra_args):
        fh = tempfile.NamedTemporaryFile(delete=False)
        param_fname = fh.name
        # XXX I have no idea why '\n' instead of the ``%c...,10`` hack fails - bug
        # in matlab's cmdline parsing? (``call`` doesn't do shell mangling, so that's not it...)
        code = ("fid = fopen('%s', 'wt');" % param_fname +
                r"fprintf(fid, '%s%c%s%c%s%c', version, 10, matlabroot, 10, computer, 10);" +
                "fclose(fid); quit")
        if is_windows:
            code = '"' + code + '"'
        cmd += ['-r', code]
        fh = None
        try:
            error = sp.call(cmd, **extra_args)
            if error:
                print('''INSTALL ABORT: %r RETURNED ERROR CODE %d
    PLEASE MAKE SURE matlab IS IN YOUR PATH!
    ''' % (" ".join(cmd), error))
                return 1
            with open(param_fname, 'r') as fh:
                ver, pth, platform = iter(fh)
                return (float(re.match(r'\d+.\d+', ver).group()), \
                        pth.rstrip(), platform.rstrip().lower())
        finally:
            try:
                os.unlink(fh.name)
            except OSError as msg:  # FIXME
                print(dedent('''\
                        windows SPECIFIC ISSUE? Unable to remove %s;
                        please delete it manually
                        %s''' % (param_fname, msg)))

    # windows
    windows = sys.platform.startswith('win')
    if None in (MATLAB_VERSION, MATLAB_DIR, PLATFORM_DIR):
        cmd = [MATLAB_COMMAND, "-nodesktop",  "-nosplash"]
        if windows:
            extra_args = {}
            cmd += ["-wait"]
        else:
            extra_args = dict(stdout=open('/dev/null', 'wb'))
        ## FIXME: it is necessary to call matlab to figure out unspecified install
        ## parameters but only if the user actually intends to build something
        ## (e.g. not for making a sdist or running a clean or --author-email etc.).
        ## Unfortunately I can't see a clean way to do that, so this nasty kludge
        ## attempts to avoid calling matlab unless required.
        #if len(sys.argv) > 1 and not (
            #re.search("sdist|clean", sys.argv[1]) or
            #len(sys.argv) == 2 and sys.argv[1].startswith('--') or
            #sys.argv[-1].startswith('--help')):
            #queried_version, queried_dir, queried_platform_dir = matlab_params(cmd, windows, extra_args)
        #else:
            #queried_version, queried_dir, queried_platform_dir = ["WHATEVER"] * 3
        #MATLAB_VERSION = MATLAB_VERSION or queried_version
        #MATLAB_DIR = MATLAB_DIR or queried_dir
        PLATFORM_DIR = 'win{}/microsoft'.format(PLATFORM)

    if windows:
        EXTENSION_NAME = 'mlabraw'
        MATLAB_LIBRARIES = MATLAB_LIBRARIES or 'libeng libmx'.split()
        CPP_LIBRARIES = []  # XXX shouldn't need CPP libs for windoze

    # unices
    else:
        EXTENSION_NAME = 'mlabrawmodule'
        if not MATLAB_LIBRARIES:
            if MATLAB_VERSION >= 6.5:
                MATLAB_LIBRARIES = 'eng mx mat ut'.split()
            else:
                MATLAB_LIBRARIES = 'eng mx mat mi ut'.split()
        CPP_LIBRARIES = ['stdc++']  # XXX strangely  only needed on some linuxes
        if sys.platform.startswith('sunos'):
            EXTRA_COMPILE_ARGS = EXTRA_COMPILE_ARGS or ['-G']

    if MATLAB_VERSION >= 7 and not windows:
        MATLAB_LIBRARY_DIRS = [MATLAB_DIR + "/bin/" + PLATFORM_DIR]
    else:
        MATLAB_LIBRARY_DIRS = [MATLAB_DIR + "/extern/lib/" + PLATFORM_DIR]
    MATLAB_INCLUDE_DIRS = [MATLAB_DIR + "/extern/include"]  # "/usr/include"
    if windows:
        if VC_DIR:
            MATLAB_INCLUDE_DIRS += find_vc_include_dirs()
            MATLAB_LIBRARY_DIRS += find_vc_library_dirs()
        else:
            print("Not using Visual C++; fiddling paths for Borland C++ compatibility")
            MATLAB_LIBRARY_DIRS = [mld.replace('/', '\\') for mld in  MATLAB_LIBRARY_DIRS]
    DEFINE_MACROS = []
    if MATLAB_VERSION >= 6.5:
        DEFINE_MACROS.append(('_V6_5_OR_LATER', 1))
    if MATLAB_VERSION >= 7.3:
        DEFINE_MACROS.append(('_V7_3_OR_LATER', 1))
    if USE_NUMERIC:
        DEFINE_MACROS.append(('MLABRAW_USE_NUMERIC', 1))

    MATLAB_INCLUDE_DIRS = [d for d in MATLAB_INCLUDE_DIRS if d]
    MATLAB_LIBRARY_DIRS = [d for d in MATLAB_LIBRARY_DIRS if d]

    setup(  # Distribution meta-data
            name="mlabwrap",
            version=__version__,
            description="A high-level bridge to matlab",
            author="Alexander Schmolck",
            author_email="*****@*****.**",
            py_modules=["mlabwrap"] + SUPPORT_MODULES,
            url='http://mlabwrap.sourceforge.net',
            ext_modules=[
                Extension(EXTENSION_NAME, ['mlabraw.cpp'],
                        define_macros=DEFINE_MACROS,
                        library_dirs=MATLAB_LIBRARY_DIRS,
                        #runtime_library_dirs=MATLAB_LIBRARY_DIRS,
                        libraries=MATLAB_LIBRARIES + CPP_LIBRARIES,
                        include_dirs=MATLAB_INCLUDE_DIRS + [PYTHON_INCLUDE_DIR],
                        extra_compile_args=EXTRA_COMPILE_ARGS,
                        ),
            ],
            use_2to3=True
        )

    return 0
Example #10
0
## https://www.gnu.org/licenses/gpl-3.0.html.
##
## $QT_END_LICENSE$
##
#############################################################################
from utils import has_option
from utils import option_value
from utils import install_pip_dependencies
from utils import get_qtci_virtualEnv
from utils import run_instruction
from utils import rmtree
from sys import exit
import os

# Values must match COIN thrift
CI_HOST_OS = option_value("os")
CI_TARGET_OS = option_value("targetOs")
CI_HOST_ARCH = option_value("hostArch")
CI_TARGET_ARCH = option_value("targetArch")
CI_HOST_OS_VER = option_value("osVer")
CI_ENV_INSTALL_DIR = option_value("instdir")
CI_ENV_AGENT_DIR = option_value("agentdir")
CI_COMPILER = option_value("compiler")
CI_FEATURES = []
_ci_features = option_value("features")
if _ci_features is not None:
    for f in _ci_features.split(', '):
        CI_FEATURES.append(f)
CI_RELEASE_CONF = has_option("packaging")

Example #11
0
            if found:
                major = int(found.group(1))
                minor = int(found.group(2))
                supported.append((major, minor))
    this_py = sys.version_info[:2]
    if this_py not in supported:
        print("only these python versions are supported:", supported)
        sys.exit(1)


check_allowed_python_version()

# Declare options
OPTION_DEBUG = has_option("debug")
OPTION_RELWITHDEBINFO = has_option('relwithdebinfo')
OPTION_QMAKE = option_value("qmake")
OPTION_CMAKE = option_value("cmake")
OPTION_OPENSSL = option_value("openssl")
OPTION_ONLYPACKAGE = has_option("only-package")
OPTION_STANDALONE = True  #has_option("standalone")
OPTION_VERSION = option_value("version")
OPTION_LISTVERSIONS = has_option("list-versions")
OPTION_MAKESPEC = option_value("make-spec")
OPTION_IGNOREGIT = True
OPTION_NOEXAMPLES = True  #has_option("no-examples")     # don't include pyside-examples
OPTION_JOBS = '6'  # number of parallel build jobs
OPTION_JOM = has_option('jom')  # use jom instead of nmake with msvc
OPTION_BUILDTESTS = has_option("build-tests")
OPTION_OSXARCH = option_value("osx-arch")

if OPTION_QMAKE is None: