diff --git a/.travis.yml b/.travis.yml index 28522faa..a6ff0dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: python dist: focal python: - - 2.7 - 3.5 - 3.6.8 - 3.7 diff --git a/dev-requirements.in b/dev-requirements.in index e9c5b93c..df5cbaf6 100644 --- a/dev-requirements.in +++ b/dev-requirements.in @@ -8,13 +8,3 @@ jupyter-core>=4.1.0,<4.7 pytest>=4.6.5,<4.6.11 pytest-cov~=2.8.1 pre-commit~=1.21.0 -cfgv~=2.0.1 - -# python2 pins -more-itertools<=5.0.0 -nbformat<=4.4.0 -ipykernel<5 -ipython<=5.10.0 -pyzmq<=19.0.2 -testpath<=0.4.4 -tornado<=5.1.1 diff --git a/dev-requirements.txt b/dev-requirements.txt index 3911112f..98ce2348 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,6 +4,7 @@ # # pip-compile dev-requirements.in # + aspy.yaml==1.3.0 # via pre-commit atomicwrites==1.4.0 @@ -18,9 +19,7 @@ backports.entry-points-selectable==1.1.0 bleach==3.3.1 # via nbconvert cfgv==2.0.1 - # via - # -r dev-requirements.in - # pre-commit + # via pre-commit coverage==5.5 # via pytest-cov decorator==4.4.2 @@ -53,7 +52,6 @@ importlib-resources==3.2.1 # virtualenv ipykernel==4.10.1 # via - # -r dev-requirements.in # ipywidgets # jupyter # jupyter-console @@ -67,7 +65,6 @@ ipython-genutils==0.2.0 # traitlets ipython==5.10.0 # via - # -r dev-requirements.in # ipykernel # ipywidgets # jupyter-console @@ -107,16 +104,13 @@ markupsafe==1.1.1 mistune==0.8.4 # via nbconvert more-itertools==5.0.0 - # via - # -r dev-requirements.in - # pytest + # via pytest nbconvert==5.6.1 # via # jupyter # notebook nbformat==4.4.0 # via - # -r dev-requirements.in # ipywidgets # nbconvert # notebook @@ -133,7 +127,7 @@ packaging==20.9 # pytest pandocfilters==1.4.3 # via nbconvert -pathlib2==2.3.6 +pathlib2==2.3.7.post1 # via pytest pexpect==4.8.0 # via ipython @@ -177,7 +171,6 @@ pyyaml==5.3.1 # pre-commit pyzmq==19.0.2 # via - # -r dev-requirements.in # jupyter-client # qtconsole qtconsole==4.7.7 @@ -196,21 +189,17 @@ six==1.15.0 # pathlib2 # pre-commit # prompt-toolkit - # pyrsistent # pytest # traitlets # virtualenv terminado==0.8.3 # via notebook testpath==0.4.4 - # via - # -r dev-requirements.in - # nbconvert + # via nbconvert toml==0.10.2 # via pre-commit tornado==5.1.1 # via - # -r dev-requirements.in # ipykernel # notebook # terminado diff --git a/gdcdatamodel/models/__init__.py b/gdcdatamodel/models/__init__.py index e0be12ec..cb0fd79f 100644 --- a/gdcdatamodel/models/__init__.py +++ b/gdcdatamodel/models/__init__.py @@ -12,19 +12,12 @@ - jsm """ -import os -import sys - -import six - -try: - from functools import lru_cache -except ImportError: - from functools32 import lru_cache - import hashlib import logging +import os +import sys from collections import defaultdict +from functools import lru_cache from types import ModuleType from psqlgraph import Edge, Node, ext, pg_property @@ -375,11 +368,11 @@ def get_tag_property_values(self): if not property_val: raise ValueError( - "Property {0} must have a value on instance {1} for tagging to proceed".format( + "Property {} must have a value on instance {} for tagging to proceed".format( prop, self ) ) - keys.append(six.ensure_str(property_val)) + keys.append(str(property_val)) return keys @property diff --git a/gdcdatamodel/models/versioning.py b/gdcdatamodel/models/versioning.py index 00935126..82f5300f 100644 --- a/gdcdatamodel/models/versioning.py +++ b/gdcdatamodel/models/versioning.py @@ -1,15 +1,9 @@ import os import uuid +from functools import lru_cache -import six from sqlalchemy import and_, event, select -try: - from functools import lru_cache -except ImportError: - from functools32 import lru_cache - - UUID_NAMESPACE_SEED = os.getenv( "UUID_NAMESPACE_SEED", "86bb916a-24c5-48e4-8a46-5ea73a379d47" ) @@ -113,7 +107,7 @@ def is_taggable(self, node): def __generate_hash(seed, label): namespace = UUID_NAMESPACE name = "{}-{}".format(seed, label) - return six.ensure_str(str(uuid.uuid5(namespace, name))) + return str(uuid.uuid5(namespace, name)) @lru_cache(maxsize=None) @@ -126,11 +120,9 @@ def compute_tag(node): """ keys = node.get_tag_property_values() keys += sorted( - [ - six.ensure_str(compute_tag(p.dst)) - for p in node.edges_out - if p.dst.is_taggable() and p.label != "relates_to" - ] + compute_tag(p.dst) + for p in node.edges_out + if p.dst.is_taggable() and p.label != "relates_to" ) return __generate_hash(keys, node.label) diff --git a/gdcdatamodel/validators/json_validators.py b/gdcdatamodel/validators/json_validators.py index 506713a7..65d6ac85 100644 --- a/gdcdatamodel/validators/json_validators.py +++ b/gdcdatamodel/validators/json_validators.py @@ -5,7 +5,7 @@ missing_prop_re = re.compile("'([a-zA-Z_-]+)' is a required property") extra_prop_re = re.compile( - "Additional properties are not allowed \(u'([a-zA-Z_-]+)' was unexpected\)" + r"Additional properties are not allowed \(u'([a-zA-Z_-]+)' was unexpected\)" ) diff --git a/requirements.txt b/requirements.txt index 2cfa5610..5ce396bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,16 +1,17 @@ # -# This file is autogenerated by pip-compile with python 3.9 +# This file is autogenerated by pip-compile # To update, run: # # pip-compile # + attrs==21.2.0 # via jsonschema decorator==4.4.2 # via gdcdatamodel (setup.py) -gdc-ng-models @ git+https://github.com/NCI-GDC/gdc-ng-models.git@1.5.2 +git+https://github.com/NCI-GDC/gdc-ng-models.git@1.5.2#egg=gdc-ng-models # via gdcdatamodel (setup.py) -gdcdictionary @ git+https://github.com/NCI-GDC/gdcdictionary.git@2.5.0-rc.0 +git+https://github.com/NCI-GDC/gdcdictionary.git@2.5.0-rc.0#egg=gdcdictionary # via gdcdatamodel (setup.py) graphviz==0.14.2 # via gdcdatamodel (setup.py) @@ -20,7 +21,7 @@ jsonschema==3.2.0 # via # gdcdatamodel (setup.py) # gdcdictionary -psqlgraph @ git+https://github.com/NCI-GDC/psqlgraph.git@3.4.0 +git+https://github.com/NCI-GDC/psqlgraph.git@3.4.0#egg=psqlgraph # via gdcdatamodel (setup.py) psycopg2==2.8.6 # via psqlgraph @@ -36,7 +37,6 @@ rstr==2.2.6 # via psqlgraph six==1.15.0 # via - # gdcdatamodel (setup.py) # jsonschema # psqlgraph # pyrsistent diff --git a/setup.py b/setup.py index bf8d52d6..14821f85 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ setup_requires=["setuptools_scm<6"], packages=find_packages(), install_requires=[ - "six~=1.15", "pytz~=2020.1", "graphviz>=0.4.10,<0.17", "jsonschema~=3.2", @@ -19,12 +18,6 @@ "gdc-ng-models @ git+https://github.com/NCI-GDC/gdc-ng-models.git@1.5.2#egg=gdc-ng-models", "psqlgraph @ git+https://github.com/NCI-GDC/psqlgraph.git@3.4.0#egg=psqlgraph", ], - extras_require={ - 'python_version == "2.7"': [ - "futures~=3.3", - "functools32~=3.2", - ] - }, package_data={ "gdcdatamodel": [ "xml_mappings/*.yaml", diff --git a/tox.ini b/tox.ini index 655248b2..e1006763 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py35,py36,py37,py38 +envlist = py35,py36,py37,py38 [pytest] testpaths =