-
Notifications
You must be signed in to change notification settings - Fork 199
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
parsl vs typeguard 4 doesn't work #3017
Comments
can you look which version of |
|
ok, that shouldn't be happening - because parsl install requirements should be constrained by pip to this (in requirements.txt): |
I see. I have another package installed that needs a more recent version of typeguard. I guess that upgraded the typeguard requirement. However, is there a chance that this can be fixed (instead of constraining typeguard?) |
it's been in the works for a while - there are some API changes that are awkward if maintaining support for typeguard 2, which I'd like to also keep supporting for a while |
crossref #2812 which fixes v4 but breaks v2 |
This PR loosens some type checking to accomodate both typeguard 2.x and 4.x as large parsl users (eg. LSST DESC) still package version 2.x but other users want the latest - 4.x In typeguard 4.x, local variables are instrumented for type-checking, which is incompatible with using multiprocessing.Queue: multiprocessing.Queue is not a type as far as typeguard is concerned, so a single use of that, in MonitoringHub, is commented out by this PR. Typeguard 2.x and 4.x have different type error classes, so explicit type checking of exception classes cannot happen in tests as the typeguard 4.x TypeCheckError class does not exist when typeguard 2.x is installed. This PR makes that type-check of type-checking errors happen using string matching of the name of the type-check error class in test_bash_apps/test_stdout.py See for example issue #3017 This PR is ugly but attempts to be pragmatic about user packaging needs.
This PR loosens some type checking to accomodate both typeguard 2.x and 4.x as large parsl users (eg. LSST DESC) still package version 2.x but other users want the latest - 4.x In typeguard 4.x, local variables are instrumented for type-checking, which is incompatible with using multiprocessing.Queue: multiprocessing.Queue is not a type as far as typeguard is concerned, so a single use of that, in MonitoringHub, is commented out by this PR. Typeguard 2.x and 4.x have different type error classes, so explicit type checking of exception classes cannot happen in tests as the typeguard 4.x TypeCheckError class does not exist when typeguard 2.x is installed. This PR makes that type-check of type-checking errors happen using string matching of the name of the type-check error class in test_bash_apps/test_stdout.py See for example issue #3017 This PR is ugly but attempts to be pragmatic about user packaging needs.
@parantapa you might try Parsl now that #3044 has been merged |
@benclifford thanks for the heads up! this is really helpful. |
Describe the bug
multiprocessing.Queue is used as a generic type in "monitoring/monitoring.py"; example case; see [1]
multiprocessing.Queue is not a "type" (at-least in Python 3.11.7)
Quoting pydoc:
"multiprocessing.Queue = Queue(maxsize=0) method of multiprocessing.context.DefaultContext instance
Returns a queue object"
This is causing code that uses MonitoringHub to fail.
[1]: See:
parsl/parsl/monitoring/monitoring.py
Line 171 in 479cf9d
To Reproduce
Expected behavior
Code to not crash
Environment
Distributed Environment
Where are you running the Parsl script from ? [e.g. Laptop/Workstation, Login node, Compute node]
Laptop
Where do you need the workers to run ? [e.g. Same as Parsl script, Compute nodes, Cloud nodes]
Laptop
The text was updated successfully, but these errors were encountered: