diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5cf5d27..30d87e0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8] + python: [3.6, 3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2 - name: Setup Python diff --git a/faculty_cli/cli.py b/faculty_cli/cli.py index 7be1d65..1709ce3 100644 --- a/faculty_cli/cli.py +++ b/faculty_cli/cli.py @@ -14,8 +14,6 @@ """Command line interface.""" -from __future__ import division - import contextlib import operator import os @@ -1198,7 +1196,7 @@ def put(project, local, remote, server): "-P", str(details.port), os.path.expanduser(local), - u"{}@{}:{}".format( + "{}@{}:{}".format( details.username, details.hostname, escaped_remote ), ] @@ -1230,7 +1228,7 @@ def get(project, remote, local, server): filename, "-P", str(details.port), - u"{}@{}:{}".format( + "{}@{}:{}".format( details.username, details.hostname, escaped_remote ), os.path.expanduser(local), @@ -1250,11 +1248,11 @@ def _rsync(project, local, remote, server, rsync_opts, up): escaped_remote = faculty_cli.shell.quote(remote) if up: path_from = local - path_to = u"{}@{}:{}".format( + path_to = "{}@{}:{}".format( details.username, details.hostname, escaped_remote ) else: - path_from = u"{}@{}:{}".format( + path_from = "{}@{}:{}".format( details.username, details.hostname, escaped_remote ) path_to = local diff --git a/faculty_cli/shell.py b/faculty_cli/shell.py index a9e1e18..e55a8a8 100644 --- a/faculty_cli/shell.py +++ b/faculty_cli/shell.py @@ -1,35 +1,17 @@ -"""Shell helper functions. - -Vendored from https://github.com/python/cpython/blob/3.6/Lib/shlex.py -""" - -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation; All -# Rights Reserved +# Copyright 2016-2020 Faculty Science Limited # -# This file is distributed under the terms of the Python Software Foundation -# License Version 2: see https://github.com/python/cpython/blob/3.6/LICENSE - -from __future__ import unicode_literals - -import six - - -if six.PY3: - from shlex import quote - -else: - import re - - _find_unsafe = re.compile(r"[^\w@%+=:,./-]").search +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. - def quote(s): - """Return a shell-escaped version of the string *s*.""" - if not s: - return "''" - if _find_unsafe(s) is None: - return s +"""Shell helper functions.""" - # use single quotes, and put single quotes into double quotes - # the string $'b is then quoted as '$'"'"'b' - return "'" + s.replace("'", "'\"'\"'") + "'" +from shlex import quote # noqa: F401 diff --git a/pyproject.toml b/pyproject.toml index eed356f..409553c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,3 +9,6 @@ exclude = ''' | \.eggs )/ ''' + +[tool.setuptools_scm] +version_scheme = "post-release" diff --git a/setup.cfg b/setup.cfg index db4f722..31ad82b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,2 @@ [aliases] test = pytest - -[bdist_wheel] -universal = 1 - diff --git a/setup.py b/setup.py index 91f1088..393278c 100644 --- a/setup.py +++ b/setup.py @@ -45,20 +45,18 @@ def read_long_description(): "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords="data science platform", packages=find_packages(), - use_scm_version={"version_scheme": "post-release"}, setup_requires=["setuptools_scm"], + python_requires=">=3.6", install_requires=[ "click", "python-dateutil", "requests", - "six", "tabulate", - "faculty>=0.26.0", + "faculty>=0.30.2", ], entry_points={"console_scripts": ["faculty=faculty_cli.cli:cli"]}, ) diff --git a/tox.ini b/tox.ini index 74cfee9..daaf804 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35,36,37,38}, flake8, black +envlist = py{36,37,38,39,310}, flake8, black [testenv] sitepackages = False @@ -18,7 +18,7 @@ commands = [testenv:black] skip_install = True deps = - black==18.9b0 + black==22.3.0 commands = black {posargs:--check setup.py faculty_cli test}