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

Question: is python 2.7 still supported? #1373

Open
HoussemNasri opened this issue Apr 17, 2024 · 3 comments · May be fixed by #1374
Open

Question: is python 2.7 still supported? #1373

HoussemNasri opened this issue Apr 17, 2024 · 3 comments · May be fixed by #1374

Comments

@HoussemNasri
Copy link

HoussemNasri commented Apr 17, 2024

Python 2.7 is listed in the trove classifiers, but using the library in a Python 2 project yields errors due to the usage of f-strings.

"Programming Language :: Python :: 2.7",

This is the error:

from atlassian import Bitbucket
  File "C:\Python27\lib\site-packages\atlassian\__init__.py", line 5, in <module>
    from .confluence import Confluence
  File "C:\Python27\lib\site-packages\atlassian\confluence.py", line 1343
    r = self._session.get(f"{download_link}")

I ran python -m compileall . using python2.7 and got the following result. It suggests that there has been 3 occasions where backward compatibility was broken. Do you think we can change these 3 cases to maintain python2.7 compatibility in upstream or you want to keep using python 3?

Listing . ...
Compiling .\__init__.py ...
Compiling .\bamboo.py ...
Listing .\bitbucket ...
Compiling .\bitbucket\__init__.py ...
Compiling .\bitbucket\base.py ...
Listing .\bitbucket\cloud ...
Compiling .\bitbucket\cloud\__init__.py ...
Compiling .\bitbucket\cloud\base.py ...
Listing .\bitbucket\cloud\common ...
Compiling .\bitbucket\cloud\common\__init__.py ...
Compiling .\bitbucket\cloud\common\builds.py ...
Compiling .\bitbucket\cloud\common\comments.py ...
Compiling .\bitbucket\cloud\common\users.py ...
Listing .\bitbucket\cloud\repositories ...
Compiling .\bitbucket\cloud\repositories\__init__.py ...
  File ".\bitbucket\cloud\repositories\__init__.py", line 266
    **self._new_session_args,
                            ^
SyntaxError: invalid syntax

Compiling .\bitbucket\cloud\repositories\branchRestrictions.py ...
Compiling .\bitbucket\cloud\repositories\commits.py ...
Compiling .\bitbucket\cloud\repositories\defaultReviewers.py ...
Compiling .\bitbucket\cloud\repositories\deploymentEnvironments.py ...
Compiling .\bitbucket\cloud\repositories\diffstat.py ...
Compiling .\bitbucket\cloud\repositories\groupPermissions.py ...
Compiling .\bitbucket\cloud\repositories\hooks.py ...
Compiling .\bitbucket\cloud\repositories\issues.py ...
Compiling .\bitbucket\cloud\repositories\pipelines.py ...
Compiling .\bitbucket\cloud\repositories\pullRequests.py ...
Compiling .\bitbucket\cloud\repositories\refs.py ...
Compiling .\bitbucket\cloud\repositories\repositoryVariables.py ...
Listing .\bitbucket\cloud\workspaces ...
Compiling .\bitbucket\cloud\workspaces\__init__.py ...
Compiling .\bitbucket\cloud\workspaces\members.py ...
Compiling .\bitbucket\cloud\workspaces\permissions.py ...
Compiling .\bitbucket\cloud\workspaces\projects.py ...
Listing .\bitbucket\server ...
Compiling .\bitbucket\server\__init__.py ...
Compiling .\bitbucket\server\base.py ...
Listing .\bitbucket\server\common ...
Compiling .\bitbucket\server\common\__init__.py ...
Compiling .\bitbucket\server\common\permissions.py ...
Compiling .\bitbucket\server\globalPermissions.py ...
Listing .\bitbucket\server\projects ...
Compiling .\bitbucket\server\projects\__init__.py ...
Listing .\bitbucket\server\projects\repos ...
Compiling .\bitbucket\server\projects\repos\__init__.py ...
Compiling .\cloud_admin.py ...
Compiling .\confluence.py ...
  File ".\confluence.py", line 1343
    r = self._session.get(f"{download_link}")
                                           ^
SyntaxError: invalid syntax

Compiling .\crowd.py ...
Compiling .\errors.py ...
Compiling .\insight.py ...
Compiling .\jira.py ...
  File ".\jira.py", line 258
    url = self.url + f"/secure/issueAttachments/{issue_id}.zip"
                                                              ^
SyntaxError: invalid syntax

Compiling .\marketplace.py ...
Compiling .\portfolio.py ...
Compiling .\request_utils.py ...
Compiling .\rest_client.py ...
Compiling .\service_desk.py ...
Compiling .\statuspage.py ...
Compiling .\utils.py ...
Compiling .\xray.py ...
@HoussemNasri HoussemNasri linked a pull request Apr 17, 2024 that will close this issue
@gkowalc
Copy link
Contributor

gkowalc commented Apr 18, 2024

hmm.. in my opinion setup.py should be updated to remove python2.7 - it hit EOL long time ago so there is no reason to be worried about backward compatibility with already obsolete version.

@MarcelWilson
Copy link

hmm.. in my opinion setup.py should be updated to remove python2.7 - it hit EOL long time ago so there is no reason to be worried about backward compatibility with already obsolete version.

It would certainly make supporting the library a bit easier.

@gonchik
Copy link
Member

gonchik commented Jun 18, 2024

So Let's drop python 2, as I see stats goes down

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

Successfully merging a pull request may close this issue.

4 participants