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

Support latest Python versions, drop Python 2 #10

Closed
eyeseast opened this issue Oct 6, 2023 · 4 comments
Closed

Support latest Python versions, drop Python 2 #10

eyeseast opened this issue Oct 6, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@eyeseast
Copy link

eyeseast commented Oct 6, 2023

Python 2 has been dead for a bit and the current version is 3.12. This library says it supports Python 2.7 to 3.8.

@duckduckgrayduck duckduckgrayduck added the question Further information is requested label Oct 12, 2023
@duckduckgrayduck
Copy link

Need to triage this at project planning, we may want to remain backwards compatible for legacy users.

@duckduckgrayduck
Copy link

So to enable pylint and black automatically on commits and PRs for python-documentcloud we have some choices to make.

We use one f string in python-documentcloud thus far:
./addon.py:280: self.query, sort="id", id=f"[{self.data['_id_start']} TO *]"

Which needs to either be converted to a Python 2 compatible string and we need to add f string checks to be added as an exemption in our .pylintrc file, or we need to convert all of these strings to f strings and drop support for Python2.

************* Module documentcloud.sections
documentcloud/sections.py:19:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/sections.py:23:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/sections.py:37:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
************* Module documentcloud.addon
documentcloud/addon.py:27:8: E1111: Assigning result of a function call, where the function has no return (assignment-from-no-return)
documentcloud/addon.py:27:8: W0612: Unused variable 'client' (unused-variable)
documentcloud/addon.py:66:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/addon.py:120:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
documentcloud/addon.py:174:19: W3101: Missing timeout argument for method 'requests.put' can cause your program to hang indefinitely (missing-timeout)
documentcloud/addon.py:198:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
************* Module documentcloud.documents
documentcloud/documents.py:71:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/documents.py:92:37: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:93:33: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:96:37: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:98:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:107:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:118:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:119:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:120:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:121:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:122:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:123:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:190:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:193:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:198:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:203:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:206:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:209:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:220:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:242:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:290:18: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
documentcloud/documents.py:335:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:366:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:384:4: R0914: Too many local variables (18/15) (too-many-locals)
documentcloud/documents.py:461:34: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
documentcloud/documents.py:384:4: R0912: Too many branches (14/12) (too-many-branches)
documentcloud/documents.py:557:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/documents.py:560:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
************* Module documentcloud.exceptions
documentcloud/exceptions.py:17:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/exceptions.py:21:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
************* Module documentcloud.base
documentcloud/base.py:42:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:45:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:108:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:115:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:129:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/base.py:159:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:172:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:175:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:181:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/base.py:185:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:193:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:199:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:205:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:207:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/base.py:212:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:218:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/base.py:223:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:231:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/base.py:233:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
************* Module documentcloud.client
documentcloud/client.py:88:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/client.py:94:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/client.py:110:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/client.py:139:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/client.py:168:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/client.py:177:16: W0707: Consider explicitly re-raising using 'raise DoesNotExistError(response=exc.response) from exc' (raise-missing-from)
documentcloud/client.py:179:16: W0707: Consider explicitly re-raising using 'raise APIError(response=exc.response) from exc' (raise-missing-from)
************* Module documentcloud.projects
documentcloud/projects.py:24:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/projects.py:33:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/projects.py:42:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/projects.py:81:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/projects.py:88:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/projects.py:97:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/projects.py:111:4: W0237: Parameter 'id_' has been renamed to 'id' in overriding 'ProjectClient.get' method (arguments-renamed)
documentcloud/projects.py:111:4: W0237: Parameter 'expand' has been renamed to 'title' in overriding 'ProjectClient.get' method (arguments-renamed)
documentcloud/projects.py:127:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
documentcloud/projects.py:149:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
************* Module documentcloud.annotations
documentcloud/annotations.py:33:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
documentcloud/annotations.py:74:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)


Your code has been rated at 9.11/10 (previous run: 9.11/10, +0.00)

@duckduckgrayduck
Copy link

Python 2.7 was removed from python-versions on GitHub Actions this past May, so we cannot run tests automatically on Python 2 anymore.
actions/setup-python#672

@duckduckgrayduck
Copy link

I've got a draft of this going here:
https://github.com/duckduckgrayduck/python-documentcloud
I have test failures due to path issues/a teardown issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants