Conversation
caf6cf2 to
527b704
Compare
b4f3052 to
3430b8d
Compare
|
In general, I like this, it indeed leaves less room for mistakes. However, we're changing the function signature and or return type of several functions that are part of our API here:
Even if we wait with merging this for EasyBuild 6.0, we should still deprecate the old function signatures. This could be done by:
I agree that it's unlikely that people would be using one of these functions, but if anyone does (for example in a Python script that leverages EasyBuild framework as a library, see also here), then we would be breaking their script. Backwards compatibility is a strong focus point of EasyBuild, and I very much want to keep it like that... |
NamedTuple(-like)dict by CategorizedPaths object (NamedTuple(-like))
| _log.warning("Failed to import 'git' Python module: %s", err) | ||
|
|
||
|
|
||
| class CategorizedPaths(MutableMapping): # Todo: use NamedTuple or dataclass instead |
There was a problem hiding this comment.
Why not use NamedTuple already? It probably requires a newer Python version as minimal version?
If so, mention that in the comment (and put it above the class line while you're at it)
There was a problem hiding this comment.
We need the dict-interface. Without that the NamedTuple (or dataclass in 3.9) from 4a79421 are enough:
class CategorizedPaths(NamedTuple):
easyconfigs: List[str]
easyconfigs: List[str]
files_to_delete: List[str]
patch_files: List[str]
py_files: List[str]
Enhanced the comment and added another one below
Is that an either-or or both? |
The current dict is pretty opaque and makes spelling mistakes easy. Avoid by using a typed, named tuple.
The test wrongly matched: > 'gzip' unexpectedly found in '== Temporary log file in case of crash /tmp/eb-2gzipb3w/eb-o3rmuvme/eb-p0oq22mq/eb-test-9go8uv1x.log i.e. it matched the path. Use whole-word regex to avoid the short string.
fc1965e to
77cc127
Compare
The current dict is pretty opaque and makes spelling mistakes easy.
Avoid by using a typed, named tuple.
There should be no other entries as this is mostly an internal class but the backwards-compat path allows it for now.
In EB 6.0 this can be a pure
NamedTupleor a dataclass