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

DM-15435: Remove python 2 support from pex packages #18

Merged
merged 4 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions bin.src/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#

#
from __future__ import print_function
from builtins import str
from builtins import object
import optparse
import sys
import os
Expand All @@ -40,7 +37,7 @@
"""


class PolicyValidator(object):
class PolicyValidator:
def __init__(self):
self.verbose = False

Expand Down
6 changes: 1 addition & 5 deletions bin/prototype_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import print_function
from builtins import str
from builtins import object

import optparse
import sys
import os
Expand All @@ -39,7 +35,7 @@
"""


class PolicyValidator(object):
class PolicyValidator:
def __init__(self):
self.verbose = False

Expand Down
1 change: 0 additions & 1 deletion python/lsst/pex/policy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import

from .policySource import *
from .supportedFormats import *
Expand Down
1 change: 0 additions & 1 deletion python/lsst/pex/policy/paf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from __future__ import absolute_import
from .pafWriter import *
1 change: 0 additions & 1 deletion python/lsst/pex/policy/policy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import

from .policy import *
from .policyContinued import *
1 change: 0 additions & 1 deletion python/lsst/pex/policy/policy/policyContinued.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import

__all__ = []

Expand Down
8 changes: 1 addition & 7 deletions src/Dictionary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,7 @@ void Definition::validateRecurse(const string& name,
void Definition::validateRecurse(const string& name, const Policy& value,
ValidationError *errs) const
{
if (!getType() == Policy::POLICY) // should have checked this at a higher level
throw LSST_EXCEPT
(pexExcept::LogicError, string("Wrong type: expected ")
+ Policy::typeName[Policy::POLICY] + " for " + getPrefix() + name
+ " but found " + getTypeName() + ". // recurse if we have a sub-definition");
// recurse if we have a sub-definition
else if (_policy->exists(Dictionary::KW_DICT)) {
if (_policy->exists(Dictionary::KW_DICT)) {
if (!_policy->isPolicy(Dictionary::KW_DICT))
throw LSST_EXCEPT
(DictionaryError, string("Wrong type for ") + getPrefix() + name
Expand Down
3 changes: 0 additions & 3 deletions tests/test_BigBool.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
"""
Comprehensive tests reading and retrieving data of all types
"""
from __future__ import print_function

from builtins import range

import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/test_Dictionary_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
from builtins import str
import os
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/test_Dm8654.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
pytest test_Dm8654.py
"""

from __future__ import absolute_import, division, print_function

import unittest

Expand Down
2 changes: 0 additions & 2 deletions tests/test_Get.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
Comprehensive tests reading and retrieving data of all types
"""

from builtins import range

import os
import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_Policy_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import lsst.utils.tests
from lsst.pex.policy import Policy, NameNotFound
import lsst.pex.exceptions
from past.builtins import long


proddir = lsst.utils.getPackageDir('pex_policy')
Expand Down Expand Up @@ -93,7 +92,7 @@ def testPolicySetget(self):
# test types
p.set("pint", 5)
self.assertEqual(p.getInt("pint"), 5, "support for type int failed")
self.assertIsInstance(p.get("pint"), (int, long),
self.assertIsInstance(p.get("pint"), int,
"auto-typing for int failed")
p.set("pdbl", 5.1)
self.assertAlmostEqual(p.getDouble("pdbl"), 5.1, 7,
Expand Down
1 change: 0 additions & 1 deletion tests/test_UrnPolicyFile_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from builtins import str
import os
import unittest

Expand Down
1 change: 0 additions & 1 deletion ups/pex_policy.table
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
setupRequired(daf_base)
setupRequired(utils)
setupRequired(python_future)
setupRequired(pybind11)
setupRequired(python)

Expand Down