# ____________________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and Engineering
# Solutions of Sandia, LLC, the U.S. Government retains certain rights in this
# software. This software is distributed under the 3-clause BSD License.
# ____________________________________________________________________________________
from pyomo.scripting.pyomo_parser import add_subparser, CustomHelpFormatter
from pyomo.common.deprecation import deprecated
[docs]
def get_packages():
packages = [
'sympy',
'xlrd',
'openpyxl',
# ('suds-jurko', 'suds'),
('PyYAML', 'yaml'),
'pypyodbc',
'pymysql',
#'openopt',
#'FuncDesigner',
#'DerApproximator',
('ipython[notebook]', 'IPython'),
]
return packages
[docs]
def pyomo_subcommand(options):
return install_extras(options.args, quiet=options.quiet)
_parser = add_subparser(
'install-extras',
func=pyomo_subcommand,
help='Install "extra" packages that Pyomo can leverage.',
description="""
This pyomo subcommand uses PIP to install optional third-party Python
packages that Pyomo could leverage from PyPI. The installation of some
packages may fail, but this subcommand ignore these failures and
provides a summary describing which packages were installed.
""",
epilog="""
Since pip options begin with a dash, the --pip-args option can only be
used with the equals syntax. --pip-args may appear multiple times on
the command line. For example:\n\n
pyomo install-extras --pip-args="--upgrade"
""",
formatter_class=CustomHelpFormatter,
)
_parser.add_argument(
'-q',
'--quiet',
action='store_true',
dest='quiet',
default=False,
help="Suppress some terminal output",
)
_parser.add_argument(
"--pip-args",
dest="args",
action="append",
help=("Arguments that are passed to the 'pip' command when installing packages"),
)