Skip to content
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

remove should_use_ephemeral_cache #7268

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Oct 29, 2019

follow-up to #7262, towards #6852

A simple refactoring, no behavior change.

@sbidoul sbidoul force-pushed the remove-should_use_ephem_cache-sbi branch from b41f949 to 234f1e9 Compare October 29, 2019 08:08
Copy link
Member

@chrahunt chrahunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactoring in wheel looks good to me. Regarding the tests - do we have coverage on these cases elsewhere (like in integration tests) to ensure that we don't get unnoticed regressions?

@sbidoul
Copy link
Member Author

sbidoul commented Oct 29, 2019

I've been extra careful to cover all previous test cases of should_use_ephemeral_cache in the new should_build and should_cache tests. So in terms of unit tests, I'd say we'll now have a better coverage.

Regarding integration tests, I found this one that exercises caching:

def test_install_builds_wheels(script, data, with_wheel):
# We need to use a subprocess to get the right value on Windows.
res = script.run('python', '-c', (
'from pip._internal.utils import appdirs; '
'print(appdirs.user_cache_dir("pip"))'
))
wheels_cache = os.path.join(res.stdout.rstrip('\n'), 'wheels')

I suppose there are plenty of integration tests for pip wheel and pip install that go through this part of the code.

BTW, are there instructions to run tests with coverage? I could not immediately succeed at running tox -e coverage-py3.

@chrahunt
Copy link
Member

chrahunt commented Oct 29, 2019

Not that I've found - we still need some work in this area to ensure

  1. coverage execution happens in the dynamically-created venvs associated with our script fixture
  2. coverage for the pip code which would have different paths between integration and unit tests gets merged

If there's not one already we can make an issue to track that activity.

@pradyunsg
Copy link
Member

I don't think there's one for tracking that.

It's a good idea to do so, and based on my past preliminary investigation, there's support for subprocesses in coverage? Maybe we can use that?

@sbidoul
Copy link
Member Author

sbidoul commented Oct 29, 2019

@chrahunt tests with _builds_ in their name seem relevant.

Copy link
Member

@chrahunt chrahunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads much more clearly to me, and I think we have enough coverage with our integration tests that the loss of some of the overlapping behavior expressed in the removed unit tests is OK.

@chrahunt
Copy link
Member

chrahunt commented Nov 1, 2019

Thank you as always. :)

@chrahunt chrahunt merged commit 2a2794e into pypa:master Nov 1, 2019
@sbidoul sbidoul deleted the remove-should_use_ephem_cache-sbi branch November 1, 2019 09:51
@sbidoul
Copy link
Member Author

sbidoul commented Nov 1, 2019

Thank you as always

Well it's not much compared to the tremendous work you and other pip maintainers accomplish. So thank your for that, as always too :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants