-
Notifications
You must be signed in to change notification settings - Fork 192
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
ProcessBuilder
: ensure instances do not interfere
#4984
ProcessBuilder
: ensure instances do not interfere
#4984
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4984 +/- ##
===========================================
- Coverage 80.38% 80.38% -0.00%
===========================================
Files 529 529
Lines 36862 36867 +5
===========================================
+ Hits 29628 29632 +4
- Misses 7234 7235 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I take it this is built on (and requires first merging) #4983? |
It does indeed. The changes in this PR are minimal and can already be reviewed, but it is not the easiest to distill them from the other changes. Thats why I marked it blocked so we can merge the other first and then this should be straightforward |
f97b216
to
188a988
Compare
188a988
to
12fdfae
Compare
ugghh, this doesn't look quite kosher lol. Are sure we cannot use |
I think you mean doesn't ?
Feel free to try. But with the properties we can get add the help string of the port to the |
@chrisjsewell I am merging this tomorrow. So if you still want to have a look at another solution, please do so a.s.a.p. |
ok gimme til midday tomorrow |
There was a bug in the `ProcessBuilderNamespace` constructor where it converts the ports of the port namespace into dynamic properties and assigns them to the class. The problem here is that the property is added to the class instead of the instance. This meant that if you have two classes that happen to have ports with overlapping names, when constructing the builder for the second, the properties of the first builder that have port names. The simple solution of simply add the dynamic properties to the instance instead of the class won't work, because properties are descriptors and can only be assigned to a class. The workaround is to create a subclass on the fly and attach the properties to that new class.
12fdfae
to
d9f4940
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, ok I'll approve this.
I get that the dynamic attribute access help in the context of ipython shells, but urgh, it does feel these builders are getting overly complex.
Then again, I don't have a better solution right now 🤷
Fixes #4420
There was a bug in the
ProcessBuilderNamespace
constructor where itconverts the ports of the port namespace into dynamic properties and
assigns them to the class. The problem here is that the property is
added to the class instead of the instance. This meant that if you have
two classes that happen to have ports with overlapping names, when
constructing the builder for the second, the properties of the first
builder that have port names.
The simple solution of simply add the dynamic properties to the instance
instead of the class won't work, because properties are descriptors and
can only be assigned to a class. The workaround is to create a subclass
on the fly and attach the properties to that new class.