-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
pyperclip upgrade #28471
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
pyperclip upgrade #28471
Conversation
are there any tests to go with this? |
We could add pyperclip's tests to pandas'. I'm not sure of a specific way to test #22707 |
Looks like CI is failing because an Exception subclass was removed |
971200b
to
3acd9df
Compare
What's the reasoning behind moving everything out of submodules into one |
I don't know why they changed
I don't mind doing a manual merge if needed, but I wasn't sure if it mattered.
Not to my knowledge. |
Honestly I'm not even sure why
or something to that effect. Is it to reduce the number of dependencies? Or purely historical reasons? |
Have to excuse my ignorance on this part of the codebase - I wasn't even aware we vendored this :-) OK I think I'm on board with this, since it's just an update to 1.7.0. Can you check if this also solves #11720 ? cc @datapythonista as well for #26887 |
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.
Can you also add a whatsnew for v1.0.0?
I'm not sure if the clipboard tests are running in the CI, so we need to be very careful here. I fixed it in #26949, but it made the tests be much slower, and the PR wasn't finally merged. Not sure if anyone else worked on it, but it may be that tests for the clipboard are not running at all, so we can't merge this without fixing that or proper "manual" testing. Also, I guess there was a reason to copy the dependency to pandas, but may be things changed and now we can simply have it as a dependency? |
I don't think we should do that. If starting from scratch might make sense but I don't see the churn being worth it. These aren't a huge burden to keep included |
I see the advantage of getting updates automatically, not a risky PR like this for every new version of pyperclip. And I don't see a disadvantage, I don't think a PR to make it a dependency is a big change, is it? |
@datapythonista Agreed. The change is literally #28471 (comment) (and changing some imports in the tests) |
Like Will, I'd prefer to keep vendoring it. I don't think it's worth adding
as a dependency.
…On Tue, Sep 17, 2019 at 9:53 AM krey ***@***.***> wrote:
@datapythonista <https://github.com/datapythonista> Agreed.
The change is literally #28471 (comment)
<#28471 (comment)>
(and changing some imports in the tests)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#28471?email_source=notifications&email_token=AAKAOIWQCHZKV74OZ3DZAYDQKDVOTA5CNFSM4IXHUSOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD64ZVOA#issuecomment-532257464>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIQEIXW2M5SFMNJY4A3QKDVOTANCNFSM4IXHUSOA>
.
|
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.
this is fine to vendor and update to current; we don't want to add actual required dependencies (and making this optional is actually somewhat non-trivial).
pls add a whatsnew note on the issue resolution. do we need a test for this issue?
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.
I think I found out the problem that made tests very slow when trying to restore the clipboard tests (afaik they are not yet working).
Once #28482 is merged, I'll give it a try. Probably worth waiting here until we have the clipboard tests back, to make sure this upgrade is not breaking anything.
@krey looks like the above fix is in. Can you merge master and address comments around the whatsnew / test? |
dec0f6c
to
9c519bd
Compare
Shall we add pyperclip's tests?https://github.com/asweigart/pyperclip/blob/master/tests/test_pyperclip.py |
I think that makes sense to include as part of this |
@krey can you fix merge conflicts and pull in the tests? |
pandas/tests/io/test_pyperclip.py
Outdated
random.seed(42) # Make the "random" tests reproducible. | ||
|
||
|
||
class _TestClipboard(unittest.TestCase): |
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 we don't use unittest so would need to change these - can you see how much effort it is to convert to pytest idiom?
Trying to balance asking a lot here versus getting this to work; unfortunately our current tests for this are suspect
Do we want to run pyperclip tests? I understand that we don't want to add pyperclip as a hard dependency, and it's too complex to have it as an optional dependency for now. But I think we just want to have it as a vendored dependency, trusting that they run their own tests, and I don't see which value adds to pandas to run their tests (or include them in the project). What are we going to do if tests fail in our CI? I don't think we want to touch our copy of their source, do we? Am I missing something? |
I'm not tied to it. I guess I'm unclear as to how we are currently validating / testing these though. Is this back up and running in CI? Or something we need to do as a pre-cursor? Just hesitant to blanket vendor these changes without some kind of CI validation |
we don’t need the tests; straight vendor is enough |
pyperclip itself should be tested. And we should have tests for our functions that use it, so if the new version breaks something in our code, the CI should be failing. So I'm with Jeff, we don't need the tests. |
OK reverted just reverted that for @krey let's see |
@krey this looks good. can you merge master and I think have a linting issue in the whatsnew. ping on green. |
@jreback It's mostly green... |
codecov is sometimes wonky so no worries there; rest lgtm as well |
Thanks @krey |
if not isinstance(text, acceptedTypes): | ||
raise PyperclipException( | ||
"only str, int, float, and bool values" | ||
"can be copied to the clipboard, not".format(text.__class__.__name__) |
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.
mypy error: Not all arguments converted during string formatting [str-format]
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff