-
Notifications
You must be signed in to change notification settings - Fork 632
Separate static analysis, move tests out of the package #1528
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
Conversation
- job: static_analysis | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.8' | ||
displayName: 'Use Python 3.8' | ||
|
||
- script: pip install black docutils | ||
displayName: 'Install dependencies' |
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'm not sure this should be a separate job. I would prefer we use the jobs we have for other operating systems. Azure allows us to have multiple checks within a job, so I'm not sure it's that useful to put static analysis in it's own build.
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 way it runs much faster, so people see earlier if they didn’t format things properly
Why move the tests out of the package? It's what I've done in the past, but it certainly doesn't seem like the norm ( I personally think fixtures in |
Pytest architecture
Fixture visibility is hierarchical, so a conftest.py in a subfolder is able to override fixtures from higher-up.
|
4cf1e09
to
480737c
Compare
I also just found this: https://docs.pytest.org/en/stable/pythonpath.html#import-modes
|
I've thought about it a bit more, and now think I agree with having the static tests in a separate job. I would like if this could also add I don't think I agree with the rest, but am only going to give a partial response for now. I'm not convinced we should move the tests out of the package. Broadly, I don't think But: isaac@Mimir:~/github/scanpy ‹master›
$ pytest --version
pytest 6.1.2
isaac@Mimir:~/github/scanpy ‹master›
$ pytest -n 6 --import-mode=importlib
...
================================ 587 passed, 17 skipped, 1 xfailed, 172 warnings in 84.39s (0:01:24) ================================ For good measure I also chucked a |
We should also move them out because of file size, I don’t think everyone should be forced to download all our test data when installing scanpy. We should separate importable test tools (that e.g. other packages can import too) and our internal test tools. We can then document the test tools
yes, my PR fixes that But even if you don’t fully agree with all of my arguments, there’s still arguments, and zero for not doing it. Since there’s no obvious reason to not do it, why struggle to find any? We can just take the obvious advantages (however slight or non-slight they may be) and do it. So is it OK if I go ahead and merge this before more PRs come in with conflicts? It’s getting a bit tiring to resolve those. |
No. There are already open PRs which I'm working on merging, and this will cause conflicts in those.
I've only partially responded because I'm low on time. At first glance, there are a number of things I'm against here. But I'll be able to consider them more thoroughly, and tell you my arguments, once I've got more time – sometime after the 1.7.0 release. |
@ivirshup I'd actually be interest in hearing those. My packages also have the test folder outside the package, but I am happy to learn why many major packages have theirs in the actual package and why that might be a good idea. |
Me too, but we can sidestep the issue now with my plan in #2225 |
This also fixes a few problems namely that tests are no modules, so you should use fixtures instead of importing.
If we want test tools that dependent packages can use we should create a submodule like
scanpy.test_utils
or so.I forgot to add the new locations to
tool.black.exclude
, so the files got reformatted. I hope that’s OK?