Use standard mechanism for stdlib names#81520
Use standard mechanism for stdlib names#81520Erotemic wants to merge 3 commits intopytorch:masterfrom
Conversation
🔗 Helpful links
❌ 1 New Failures, 32 PendingAs of commit 500b434 (more details on the Dr. CI page): Expand to see more
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
malfet
left a comment
There was a problem hiding this comment.
Looks good to me, but please fix lint (apply the suggested edits)
Fixes lint
|
Looks like the linter is still upset? Not sure what to do with this: |
@Erotemic it wants 2 spaces before |
|
@pytorchbot merge -f |
|
@pytorchbot successfully started a merge job. Check the current status here |
|
Hey @Erotemic. |
|
I don't see a way I can add the topic: not user facing label |
|
I've just added it, but it's not too important. |
Summary: I noticed that in #81261 all of the stdlib module names were explicitly listed, however as of Python 3.10 the stdlib now has a mechanism for this. python/cpython#87121 I figured it was better to use `sys.stdlib_module_names` going forward for 3.10+ instead of having to maintain this file for every new Python release. For docs see: https://docs.python.org/3/library/sys.html#sys.stdlib_module_names I did a symmetric difference to determine what the effective change would be. I verified that everything listed in this file ins included in sys.stdlib_module_names. However, there are files in sys.stdlib_module_names that are not included in the previous hard coded definition. Namely these are: ``` frozenset({'__future__', '_abc', '_aix_support', '_asyncio', '_bisect', '_blake2', '_bootsubprocess', '_bz2', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_collections', '_collections_abc', '_compat_pickle', '_compression', '_contextvars', '_crypt', '_csv', '_ctypes', '_curses', '_curses_panel', '_datetime', '_dbm', '_decimal', '_elementtree', '_frozen_importlib', '_frozen_importlib_external', '_functools', '_gdbm', '_hashlib', '_heapq', '_imp', '_io', '_json', '_locale', '_lsprof', '_lzma', '_markupbase', '_md5', '_msi', '_multibytecodec', '_multiprocessing', '_opcode', '_operator', '_osx_support', '_overlapped', '_pickle', '_posixshmem', '_posixsubprocess', '_py_abc', '_pydecimal', '_pyio', '_queue', '_random', '_scproxy', '_sha1', '_sha256', '_sha3', '_sha512', '_signal', '_sitebuiltins', '_socket', '_sqlite3', '_sre', '_ssl', '_stat', '_statistics', '_string', '_strptime', '_struct', '_symtable', '_threading_local', '_tkinter', '_tracemalloc', '_uuid', '_warnings', '_weakref', '_weakrefset', '_winapi', '_zoneinfo', 'antigravity', 'genericpath', 'idlelib', 'nt', 'nturl2path', 'opcode', 'pydoc_data', 'pyexpat', 'this'}) ``` I'm not sure if excluding these matters. I wouldn't think it would, but if it does and it is better to explicitly update this file each time, then feel free to close this. Pull Request resolved: #81520 Approved by: https://github.com/malfet Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/4c9eae331b2695be011d96534a5ece44ba629601 Reviewed By: DanilBaibak Differential Revision: D37919540 Pulled By: DanilBaibak fbshipit-source-id: 6765556778ecad6edf254ad2ffc0d50d57ee1bbf
I noticed that in #81261 all of the stdlib module names were explicitly listed, however as of Python 3.10 the stdlib now has a mechanism for this. python/cpython#87121
I figured it was better to use
sys.stdlib_module_namesgoing forward for 3.10+ instead of having to maintain this file for every new Python release. For docs see:https://docs.python.org/3/library/sys.html#sys.stdlib_module_names
I did a symmetric difference to determine what the effective change would be. I verified that everything listed in this file ins included in sys.stdlib_module_names. However, there are files in sys.stdlib_module_names that are not included in the previous hard coded definition. Namely these are:
I'm not sure if excluding these matters. I wouldn't think it would, but if it does and it is better to explicitly update this file each time, then feel free to close this.