Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing testing and support for Python 2.6 #322

Merged
merged 12 commits into from
Apr 26, 2018
6 changes: 2 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ environment:

# For Python versions available on Appveyor, see
# http://www.appveyor.com/docs/installed-software#python
# The list here is complete (excluding Python 2.6, which
# isn't covered by this document) at the time of writing.
# The list here is complete at the time of writing.

- PYTHON_VERSION: 2.7
#PYTHON: "C:\\Python27"
Expand Down Expand Up @@ -78,7 +77,6 @@ install:
- conda config --set auto_update_conda false
#
- "%CONDAFORGE% setuptools pip"
- "IF %PYTHON_VERSION%==2.6 (python -m pip install ordereddict)"
- python -m pip install coverage
- python -m pip install codecov
- IF DEFINED YAML (python -m pip install pyyaml)
Expand All @@ -87,7 +85,7 @@ install:
- python -m pip install openpyxl
- python -m pip install sphinx_rtd_theme
- "%ANACONDA% pandas networkx"
- "IF NOT %PYTHON_VERSION%==2.6 (%ANACONDA% scipy)"
- "%ANACONDA% scipy"
#
# Install GAMS
#
Expand Down
16 changes: 4 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: python
matrix:
include:
# NOTE: EXTRAS is not yet supported on Python 2.6.
- python: '2.6'
env: CATEGORY="nightly"
- python: '2.7'
env: CATEGORY="nightly"
- python: '3.6'
Expand Down Expand Up @@ -72,11 +69,6 @@ install:
- which pip
- pip --version
#
- if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ]; then pip install 'cryptography<2.1.1'; fi
- if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ]; then pip install 'pyOpenSSL<17.5'; fi
- if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ]; then pip install urllib3; fi
- if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ]; then pip install ordereddict; fi
#
- pip install coverage
- pip install codecov
- if [ -n "${YAML}" ]; then
Expand All @@ -91,7 +83,7 @@ install:
- pip install dill
- conda install -q -y -c anaconda pandas networkx

- if [ "${TRAVIS_PYTHON_VERSION}" != "2.6" -a -n "${EXTRAS}" ]; then
- if [ -n "${EXTRAS}" ]; then
conda install -q -y -c anaconda scipy;
fi

Expand All @@ -101,9 +93,9 @@ install:
- wget https://d37drm4t2jghv5.cloudfront.net/distributions/24.8.5/linux/linux_x64_64_sfx.exe
- chmod u+x linux_x64_64_sfx.exe
- ./linux_x64_64_sfx.exe > /dev/null
# Only install GAMS API if EXTRAS is not being installed and Python is
# not 2.6, since those tests segfault on travis for an unknown reason.
- if [ "${TRAVIS_PYTHON_VERSION}" != "2.6" -a -z "${EXTRAS}" ]; then
# Only install GAMS API if EXTRAS is not being installed,
# since those tests segfault on travis for an unknown reason.
- if [ -a -z "${EXTRAS}" ]; then
bash ./.travis_install_gams_api.sh;
fi
- export PATH="$PATH:$PWD/gams24.8_linux_x64_64_sfx"
Expand Down
5 changes: 0 additions & 5 deletions .travis_install_gams_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# Install GAMS-Python API bindings
# No explicit API version for python 3.5, use 3.4
#
if [ "${TRAVIS_PYTHON_VERSION}" = "2.6" ]; then
pushd $PWD/gams24.8_linux_x64_64_sfx/apifiles/Python/api_26;
python setup.py install;
popd;
fi
if [ "${TRAVIS_PYTHON_VERSION}" = "2.7" ]; then
pushd $PWD/gams24.8_linux_x64_64_sfx/apifiles/Python/api;
python setup.py install;
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Pyomo CHANGELOG
Current Development
-------------------------------------------------------------------------------

- Resolved Python 3.4 build errors on Appveyor.
- Resolved Python 3.4 build errors on Appveyor. (#438)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change s a bleed over from #438. At a minimum, we need to resync with master.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already synced with master. This documentation was omitted in that PR. I figured it was a waste of time to have a PR for 7 characters.

- Wrap Vars in value() for assignment to numpy vectors (#436)
- Adding TerminationCondition and SolverStatus to pyomo.environ (#429)
- Removing testing for Python 2.6 (#322)

-------------------------------------------------------------------------------
Pyomo 5.5
Expand Down
6 changes: 1 addition & 5 deletions admin/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
import sys
import os
import subprocess
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know that this was only for python 2.6? (i.e., is the comment correct?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.

from subprocess import check_output as _run_cmd
except:
# python 2.6
from subprocess import check_call as _run_cmd
from subprocess import check_output as _run_cmd
import driver

config = sys.argv[1]
Expand Down
57 changes: 53 additions & 4 deletions doc/OnlineDocs/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,58 @@
Getting Started
===============

Installation, pyomo command, a simple example, etc
Installation
------------

.. doctest::
Pyomo currently supports the following versions of Python:

* CPython: 2.7, 3.5, 3.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still support 3.4

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whart222 you're missing 3.4 in this list

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


Using CONDA
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Conda" not "CONDA"

~~~~~~~~~~~

We recommend installation with *conda*, which is included with the Anaconda
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not recommend conda. I am still confused as to why we don't list pip as the standard install route for pyomo and list conda as a convenience for Anaconda users. Recommending miniconda for non-conda platforms results in a new Python on their system, which will cause problems with IDEs, PATHs, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do recommend conda, because pyomo.extras robustly installs third-party packages. We tried using a similar package for PyPI and users had problem with package installations.

You don't need to install miniconda to use conda.

distribution of Python. If you have a different Python distribution, then
you can install *miniconda* using *pip*:

.. bash::
pip install miniconda

You can install Pyomo in your system Python installation
by executing the following in a shell:

.. bash::
conda install -c conda-forge pyomo

Pyomo also has conditional dependencies on a variety of third-party Python packages. These can also be installed with conda:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document should list the third-party packages, as that is relevant to all distributions /package managers (i.e., pip)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it should. But I'm pretty sure that no one will maintain this list here.


.. bash::
conda install -c conda-forge pyomo.extras

Optimization solvers are not installed with Pyomo, but some open source optimization solvers can be installed with conda as well:

.. bash::
conda install -c conda-forge pyomo.solvers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be conda install -c conda-forge ipopt coin-cbc glpk

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.



Using PIP
~~~~~~~~~

The standard utility for installing Python packages is *pip*. You
can install Pyomo in your system Python installation by executing
the following in a shell:

.. bash::
pip install pyomo

However, *pip* does not support the robust installation of conditional
dependencies (i.e. the third-party Python packages or the solvers
that Pyomo may use).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this statement. pip is the generally recommended installation method for Python packages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a true statement, regardless whether pip is generally recommended. But I'll delete it.



A Simple Example
----------------

TODO pyomo command, importing pyomo, using NEOS, etc

>>> print('Hello World')
Hello World
4 changes: 2 additions & 2 deletions scripts/pyomo_install
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ except ImportError:
from urllib import pathname2url as pathname2url


if sys.version_info < (2, 6):
if sys.version_info < (2, 7):
print('ERROR: %s' % sys.exc_info()[1])
print('ERROR: This script requires Python 2.6 or greater.')
print('ERROR: This script requires Python 2.7 or greater.')
sys.exit(1)

#
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def read(*rnames):
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
Expand All @@ -95,6 +94,7 @@ def read(*rnames):
packages=packages,
keywords=['optimization'],
install_requires=requires,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
entry_points="""
[console_scripts]
runbenders=pyomo.pysp.benders:Benders_main
Expand Down