Esempio n. 1
0
    def get_parser(self):
        parser = argparse.ArgumentParser(description="Command-line interface " \
                                         "for pySMT problems")
        parser.add_argument(
            '--version',
            action='version',
            version='%(prog)s {version}'.format(version=git_version()))
        parser.add_argument('--file',
                            '-f',
                            metavar='filename',
                            type=str,
                            help='A script file to read from instead of stdin')

        parser.add_argument('--interactive', '-i', action='store_true',
                            help="Start a python interactive shell instead of" \
                            " reading an SMT2 input")

        parser.add_argument('--solver',
                            '-s',
                            metavar='name',
                            type=str,
                            choices=['auto'] + self.solvers,
                            default=None,
                            help='The solver to use (default: auto)')
        return parser
Esempio n. 2
0
def parse_options():
    parser = argparse.ArgumentParser(description='Install SMT Solvers.\n\n'
                                     'This script installs the solvers specified'
                                     ' on the command line or in the environment'
                                     ' variable PYSMT_SOLVER if not already '
                                     'instaled on the system.')
    parser.add_argument('--version', action='version',
                        version='%(prog)s {version}'.format(version=git_version()))

    for i in INSTALLERS:
        name = i.InstallerClass.SOLVER
        parser.add_argument('--%s' % name, dest=name, action='store_true',
                            default=False, help='Install %s' % name)

    parser.add_argument('--all', dest='all_solvers', action='store_true',
                        default=False,
                        help='Install all the solvers')

    parser.add_argument('--force', dest='force_redo', action='store_true',
                        default=False,
                        help='Forcedly rebuild the solvers even if already found')

    parser.add_argument('--check', dest='check', action='store_true',
                        default=False,
                        help='Checks the installation of the solvers')

    parser.add_argument('--env', dest='env', action='store_true',
                        default=False,
                        help='Prints a bash export command to extend the PYTHONPATH')

    parser.add_argument('--powershell', dest='powershell', action='store_true',
                        default=False,
                        help='In combination with --env under windows, prints the commands in powershell format')

    parser.add_argument('--confirm-agreement', dest='skip_intro',
                        action='store_true', default=False,
                        help='Confirm that you agree with the licenses of the'
                             ' solvers and skip the interactive question')

    install_path_default = os.path.join("~", ".smt_solvers")
    parser.add_argument('--install-path', dest='install_path',
                        type=str, default=install_path_default,
                        help='The folder to use for the installation'
                             ' (defaults to: {!r})'.format(install_path_default))

    py_bindings = solver_install_site(plat_specific=True)
    parser.add_argument('--bindings-path', dest='bindings_path',
                        type=str, default=py_bindings,
                        help='The folder to use for the bindings (defaults to the'
                             ' relevant site-packages directory: {!r})'.format(py_bindings))

    options = parser.parse_args()
    return options
Esempio n. 3
0
def parse_options():
    parser = argparse.ArgumentParser(description='Install SMT Solvers.\n\n'
                                     'This script installs the solvers specified'
                                     ' on the command line or in the environment'
                                     ' variable PYSMT_SOLVER if not already '
                                     'instaled on the system.')
    parser.add_argument('--version', action='version',
                        version='%(prog)s {version}'.format(version=git_version()))

    for i in INSTALLERS:
        name = i.InstallerClass.SOLVER
        parser.add_argument('--%s' % name, dest=name, action='store_true',
                            default=False, help='Install %s' % name)

    parser.add_argument('--all', dest='all_solvers', action='store_true',
                        default=False,
                        help='Install all the solvers')

    parser.add_argument('--force', dest='force_redo', action='store_true',
                        default=False,
                        help='Forcedly rebuild the solvers even if already found')

    parser.add_argument('--check', dest='check', action='store_true',
                        default=False,
                        help='Checks the installation of the solvers')

    parser.add_argument('--env', dest='env', action='store_true',
                        default=False,
                        help='Prints a bash export command to extend the PYTHONPATH')

    parser.add_argument('--powershell', dest='powershell', action='store_true',
                        default=False,
                        help='In combination with --env under windows, prints the commands in powershell format')

    parser.add_argument('--confirm-agreement', dest='skip_intro',
                        action='store_true', default=False,
                        help='Confirm that you agree with the licenses of the\
                        solvers and skip the interactive question')

    install_path_default = os.path.join("~", ".smt_solvers")
    parser.add_argument('--install-path', dest='install_path',
                        type=str, default=install_path_default,
                        help='The folder to use for the installation')

    py_bindings = os.path.join(install_path_default,
                               "python-bindings-%d.%d" % sys.version_info[0:2])
    parser.add_argument('--bindings-path', dest='bindings_path',
                        type=str, default=py_bindings,
                        help='The folder to use for the bindings')

    options = parser.parse_args()
    return options
Esempio n. 4
0
def parse_options():
    parser = argparse.ArgumentParser(description='Install SMT Solvers.\n\n'
                                     'This script installs the solvers specified'
                                     ' on the command line or in the environment'
                                     ' variable PYSMT_SOLVER if not already '
                                     'instaled on the system.')
    parser.add_argument('--version', action='version',
                        version='%(prog)s {version}'.format(version=git_version()))

    for i in INSTALLERS:
        name = i.InstallerClass.SOLVER
        parser.add_argument('--%s' % name, dest=name, action='store_true',
                            default=False, help='Install %s' % name)

    parser.add_argument('--all', dest='all_solvers', action='store_true',
                        default=False,
                        help='Install all the solvers')

    parser.add_argument('--force', dest='force_redo', action='store_true',
                        default=False,
                        help='Forcedly rebuild the solvers even if already found')

    parser.add_argument('--check', dest='check', action='store_true',
                        default=False,
                        help='Checks the installation of the solvers')

    parser.add_argument('--env', dest='env', action='store_true',
                        default=False,
                        help='Prints a bash export command to extend the PYTHONPATH')

    parser.add_argument('--confirm-agreement', dest='skip_intro',
                        action='store_true', default=False,
                        help='Confirm that you agree with the licenses of the\
                        solvers and skip the interactive question')

    parser.add_argument('--install-path', dest='install_path',
                        type=str, default="~/.smt_solvers",
                        help='The folder to use for the installation')

    py_bindings = "~/.smt_solvers/python-bindings-%d.%d" % sys.version_info[0:2]
    parser.add_argument('--bindings-path', dest='bindings_path',
                        type=str, default=py_bindings,
                        help='The folder to use for the bindings')

    options = parser.parse_args()
    return options
Esempio n. 5
0
    def get_parser(self):
        parser = argparse.ArgumentParser(description="Command-line interface " \
                                         "for pySMT problems")
        parser.add_argument('--version', action='version',
                        version='%(prog)s {version}'.format(version=git_version()))
        parser.add_argument('--file', '-f', metavar='filename', type=str,
                            help='A script file to read from instead of stdin')

        parser.add_argument('--interactive', '-i', action='store_true',
                            help="Start a python interactive shell instead of" \
                            " reading an SMT2 input")

        parser.add_argument('--solver', '-s', metavar='name', type=str,
                            choices=['auto'] + self.solvers,
                            default=None,
                            help='The solver to use (default: auto)')
        return parser
Esempio n. 6
0
 def test_git_version(self):
     from pysmt import git_version
     v = git_version()
     self.assertIsNotNone(v)
     parts = v.split("-")
     self.assertTrue(len(parts), 4)
Esempio n. 7
0
 def test_git_version(self):
     from pysmt import git_version
     v = git_version()
     self.assertIsNotNone(v)
     parts = v.split("-")
     self.assertTrue(len(parts) , 4)
Esempio n. 8
0
def parse_options():
    parser = argparse.ArgumentParser(
        description="Install SMT Solvers.\n\n"
        "This script installs the solvers specified"
        " on the command line or in the environment"
        " variable PYSMT_SOLVER if not already "
        "instaled on the system."
    )
    parser.add_argument("--version", action="version", version="%(prog)s {version}".format(version=git_version()))

    for i in INSTALLERS:
        name = i.InstallerClass.SOLVER
        parser.add_argument("--%s" % name, dest=name, action="store_true", default=False, help="Install %s" % name)

    parser.add_argument("--all", dest="all_solvers", action="store_true", default=False, help="Install all the solvers")

    parser.add_argument(
        "--force",
        dest="force_redo",
        action="store_true",
        default=False,
        help="Forcedly rebuild the solvers even if already found",
    )

    parser.add_argument(
        "--check", dest="check", action="store_true", default=False, help="Checks the installation of the solvers"
    )

    parser.add_argument(
        "--env",
        dest="env",
        action="store_true",
        default=False,
        help="Prints a bash export command to extend the PYTHONPATH",
    )

    parser.add_argument(
        "--confirm-agreement",
        dest="skip_intro",
        action="store_true",
        default=False,
        help="Confirm that you agree with the licenses of the\
                        solvers and skip the interactive question",
    )

    install_path_default = os.path.join("~", ".smt_solvers")
    parser.add_argument(
        "--install-path",
        dest="install_path",
        type=str,
        default=install_path_default,
        help="The folder to use for the installation",
    )

    py_bindings = os.path.join(install_path_default, "python-bindings-%d.%d" % sys.version_info[0:2])
    parser.add_argument(
        "--bindings-path",
        dest="bindings_path",
        type=str,
        default=py_bindings,
        help="The folder to use for the bindings",
    )

    options = parser.parse_args()
    return options