From 3777fecb69b8ccd83cabedd998e4d581e1e15244 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 14:15:01 +0800 Subject: [PATCH 01/10] fix issue with older black release and click Relevant issue: https://github.com/psf/black/issues/2634 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 74cfee9..8aa86bd 100644 --- a/tox.ini +++ b/tox.ini @@ -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} From 8af1dced112705e4374437c0852d37514a76cbcf Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 14:17:11 +0800 Subject: [PATCH 02/10] add test runs for Python 3.9 and 3.10 --- .github/workflows/tests.yaml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5cf5d27..e219d94 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: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2 - name: Setup Python diff --git a/tox.ini b/tox.ini index 8aa86bd..9b5d5b5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35,36,37,38}, flake8, black +envlist = py{27,35,36,37,38,39,310}, flake8, black [testenv] sitepackages = False From 9cfdc727bde285d2c9de8406fb1340bb1fe1c563 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 15:02:19 +0800 Subject: [PATCH 03/10] Remove unavailable Python 3.5 image from the test matrix. Keep it in tox though, as we cannot automatically test, but could test manually. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e219d94..210b0b7 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, 3.9, '3.10'] + python: [2.7, 3.6, 3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2 - name: Setup Python From 2eb727989b6be6a28f11958e6287e141ae449426 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 15:11:19 +0800 Subject: [PATCH 04/10] cover the same Python versions as "faculty" does Same Python versions as thats the core dependency. --- .github/workflows/tests.yaml | 2 +- setup.py | 2 +- tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 210b0b7..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.6, 3.7, 3.8, 3.9, '3.10'] + python: [3.6, 3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v2 - name: Setup Python diff --git a/setup.py b/setup.py index 91f1088..7260059 100644 --- a/setup.py +++ b/setup.py @@ -45,13 +45,13 @@ 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", diff --git a/tox.ini b/tox.ini index 9b5d5b5..daaf804 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35,36,37,38,39,310}, flake8, black +envlist = py{36,37,38,39,310}, flake8, black [testenv] sitepackages = False From fa0152dae64af36c048ff1aead93f52f8cdba46b Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 15:16:58 +0800 Subject: [PATCH 05/10] update setuptools_scm usage as recommended through pyproject.toml --- pyproject.toml | 7 +++++++ setup.py | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eed356f..66a6573 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,3 +9,10 @@ exclude = ''' | \.eggs )/ ''' + +[tool.setuptools_scm] +version_scheme = "post-release" + +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 7260059..0a92744 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,6 @@ def read_long_description(): ], keywords="data science platform", packages=find_packages(), - use_scm_version={"version_scheme": "post-release"}, setup_requires=["setuptools_scm"], python_requires=">=3.6", install_requires=[ From 48544419559a34d25e797dc957e15b89160d1cce Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 20:08:26 +0800 Subject: [PATCH 06/10] remove the build-system part of pyproject.toml update Currently not needed as setup.py is used for all those parts. --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 66a6573..409553c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,3 @@ exclude = ''' [tool.setuptools_scm] version_scheme = "post-release" - -[build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] -build-backend = "setuptools.build_meta" From e31a306c7fff18722408c458e555cdc6fa00b8e8 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 20:39:44 +0800 Subject: [PATCH 07/10] remove other pre-Python 3.6 dependencies and imports --- faculty_cli/cli.py | 2 -- faculty_cli/shell.py | 46 ++++++++++++++------------------------------ setup.py | 1 - 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/faculty_cli/cli.py b/faculty_cli/cli.py index 7be1d65..87ec881 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 diff --git a/faculty_cli/shell.py b/faculty_cli/shell.py index a9e1e18..fc06e57 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 diff --git a/setup.py b/setup.py index 0a92744..c59e3f5 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,6 @@ def read_long_description(): "click", "python-dateutil", "requests", - "six", "tabulate", "faculty>=0.26.0", ], From 379b2bb0404958fce637a2227773951e18eee967 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 20:44:52 +0800 Subject: [PATCH 08/10] fixing up black and flake8 issues that were overlooked --- faculty_cli/cli.py | 8 ++++---- faculty_cli/shell.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/faculty_cli/cli.py b/faculty_cli/cli.py index 87ec881..1709ce3 100644 --- a/faculty_cli/cli.py +++ b/faculty_cli/cli.py @@ -1196,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 ), ] @@ -1228,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), @@ -1248,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 fc06e57..e55a8a8 100644 --- a/faculty_cli/shell.py +++ b/faculty_cli/shell.py @@ -14,4 +14,4 @@ """Shell helper functions.""" -from shlex import quote +from shlex import quote # noqa: F401 From 568bef038264910955c6b41b7bbea4ab7586fcf7 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 23:07:13 +0800 Subject: [PATCH 09/10] remove universal setting as no longer supporting Python 2 --- setup.cfg | 4 ---- 1 file changed, 4 deletions(-) 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 - From 40a0f1b9e73fbbaee2789f87941f671ee09abf2c Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Fri, 13 May 2022 23:08:04 +0800 Subject: [PATCH 10/10] bumping minimum faculty SDK version to ensure fixes are pulled in --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c59e3f5..393278c 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ def read_long_description(): "python-dateutil", "requests", "tabulate", - "faculty>=0.26.0", + "faculty>=0.30.2", ], entry_points={"console_scripts": ["faculty=faculty_cli.cli:cli"]}, )