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

Dropping __future__ from cmssw #46762

Closed
smuzaffar opened this issue Nov 22, 2024 · 9 comments
Closed

Dropping __future__ from cmssw #46762

smuzaffar opened this issue Nov 22, 2024 · 9 comments

Comments

@smuzaffar
Copy link
Contributor

smuzaffar commented Nov 22, 2024

We have many python files (over 900) with statements like [a] which we had added for python2/3 compatibility. As CMSSW only supports python3, so I suggest to remove all these lines.

We will open PRs (one per category) to remove these statements.

[a]

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
@smuzaffar
Copy link
Contributor Author

FYI @cms-sw/all-l2

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 22, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @smuzaffar.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@makortel,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks

@kpedro88
Copy link
Contributor

@smuzaffar according to https://docs.python.org/3/library/__future__.html#module-contents, I do not think from __future__ import annotations should be dropped in this cleanup. This is a python3-specific feature. (generator_stop is also on the list of newer python3-only __future__ features, but that one does not currently appear to be used anywhere in CMSSW.)

@smuzaffar
Copy link
Contributor Author

thanks @kpedro88 , you are right annotations will be default in python 4 so yes from __future__ import annotations should not be removed. Luckily we only have one place where it is used. I have updated the PR to reintroduce it.

@smuzaffar
Copy link
Contributor Author

+core
closing this as all __future__ statements except one from __future__ import annotations from https://github.com/cms-sw/cmssw/blob/master/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py#L2 are removed from cmssw

@cmsbuild
Copy link
Contributor

This issue is fully signed and ready to be closed.

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

No branches or pull requests

4 participants