3 ms·
I completely agree. Hope something like this is eventually standardized. Problem is that uv probably does not want to execute anything to find out dependencies
by petters 2y ago
I completely agree. Hope something like this is eventually standardized.
Problem is that uv probably does not want to execute anything to find out dependencies, so it would have to be a very restrictive subset of python syntax.
The fact that is is needed at all of course highlights a weakness in the language. The import statements themselves should be able to convey all information about dependencies
- stared 2y agoIt can be specified that it is a valid, static structure before imports.
- nemetroid 2y agoBetween future statements and other imports, then?
- deleted 2y ago[deleted]
- pedrosorio 2y ago> The fact that is is needed at all of course highlights a weakness in the language. The import statements themselves should be able to convey all information about dependencies What languages convey the version of the dependencies in a script’s import statements?
- SAI_Peregrinus 2y agoUV just implemented PEP 723[1], which is now PyPA Inline Script Metadata[2]. That's no longer provisional, it is standardized already! It's unfortunate that Python didn't have some non-comment way to provide this functionality. [1] https://peps.python.org/pep-0723/ https://peps.python.org/pep-0723/ [2] https://packaging.python.org/en/latest/specifications/inline-script-metadata/#inline-script-metadata https://packaging.python.org/en/latest/specifications/inline...