-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
BLD: Install scripts tests only during inplace #22413
BLD: Install scripts tests only during inplace #22413
Conversation
Would the other option be to just skip these tests if the scripts folder isn't included? I actually wonder if that would be preferable especially in cases where users install a binary and try to run |
@WillAyd : I don't see why we should be packaging these tests when we do a release of |
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.
shouldn’t you just put a skip in the tests themselves?
Codecov Report
@@ Coverage Diff @@
## master #22413 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 169 169
Lines 50733 50733
=======================================
Hits 46702 46702
Misses 4031 4031
Continue to review full report at Codecov.
|
+1 |
@gfyoung I understand your argument, but I think the added complexity (I would expect to find logic about whether the tests are ran/skipped in the tests itself, our |
agree with @jorisvandenbossche here, pls simply skip these test. We don't want multiple paths for doing things like skips. |
Fair enough. IMHO, these validation tests should not have been located in the |
Not sure what it involves in the CI configuration, but I'm +1 on moving the tests for the scripts to |
@jreback @jorisvandenbossche : Thoughts on moving the tests? As much as I know both of you don't want the extra complexity in We can skip the tests for now, but the long-term solution I think is just moving them elsewhere. |
They wouldn't fail, the idea is that they would be skipped. That said, I am also fine with having the tests live in |
I'm -1 on moving to |
@WillAyd : I'm not sure we can make this assertion yet without giving it a shot first. 😉 |
189c585
to
9f2ad74
Compare
Import the validation scripts from the scripts directory. | ||
|
||
Because the scripts directory is above the top level pandas package, | ||
we need to hack `sys.path` to know where to find it for import. |
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.
avoid the term 'hack'
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.
That word was from the original docstring, but sure thing.
globals()[global_validate_one] = validate_one | ||
except ImportError: | ||
# Import will fail if the pandas installation is not inplace. | ||
raise pytest.skip("scripts directory does not exist") |
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 say pandas/scripts
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.
Done.
If the pandas is not inplace, the scripts directory will not exist, and the tests will fail. Follow-up to pandas-devgh-20061.
96ec3d7
to
c14c540
Compare
globals()[global_validate_one] = validate_one | ||
except ImportError: | ||
# Import will fail if the pandas installation is not inplace. | ||
raise pytest.skip("pandas/scripts directory does not exist") |
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.
Not sure if this causes an issue but from what I've tested locally if using the imperative skip validate_docstrings
stays in globals as does the modification to system path. Perhaps we should ensure that code gets executed in the except
block here?
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.
- Fair point regarding system path modification.
- Not sure how
validate_docstrings
stays in globals if the import fails in the first place...
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.
let's see if this fixes the wheels |
ok wheels fixed: https://travis-ci.org/MacPython/pandas-wheels/builds/418513881 |
If the pandas is not inplace, the scripts directory will not exist, and the tests will fail. Follow-up to pandas-devgh-20061.
The
scripts
directory is not visible if the installation is not inplace.Follow-up to #20061.
cc @WillAyd @datapythonista