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

Small optimization to not compute the highest version when it isn't displayed #6360

Merged
merged 2 commits into from Nov 14, 2019

Conversation

@ericholscher
Copy link
Member

ericholscher commented Nov 7, 2019

We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.

@humitos does this break your extension, or is it respecting this setting also?

@ericholscher ericholscher requested review from humitos and stsewd Nov 7, 2019
@stsewd
stsewd approved these changes Nov 7, 2019
Copy link
Member

stsewd left a comment

Tests need to be updated self.pip.show_version_warning = True.

ericholscher and others added 2 commits Nov 7, 2019
…isplayed

We added a setting about whether to show this to the user or not,
but always calculated the data regardless of the setting.
@stsewd stsewd force-pushed the dont-compute-highest-if-not-shown branch from 8300f63 to 6acceea Nov 13, 2019
@@ -152,7 +171,7 @@ def test_highest_version_from_lower(self):
self.assertDictEqual(valid_data, returned_data)

def test_highest_version_from_latest(self):
Version.objects.create_latest(project=self.pip, built=True)
self.pip.versions.filter(slug=LATEST).update(built=True)

This comment has been minimized.

Copy link
@stsewd

stsewd Nov 13, 2019

Member

latest is created when we call pip.save() in the setup method

@stsewd

This comment has been minimized.

Copy link
Member

stsewd commented Nov 13, 2019

Tests should be passing now

@humitos

This comment has been minimized.

Copy link
Member

humitos commented Nov 14, 2019

@humitos does this break your extension, or is it respecting this setting also?

It should not affect it. The extension does not use the footer API, it uses the versions endpoint directly /api/versions/

@stsewd stsewd merged commit 14cee97 into master Nov 14, 2019
3 checks passed
3 checks passed
continuous-documentation/read-the-docs Read the Docs build succeeded!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details
@stsewd stsewd deleted the dont-compute-highest-if-not-shown branch Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.