Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2753)

Unified Diff: app/models/package_version.py

Issue 1140493005: Improve package version constraint suggestions. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang.git@master
Patch Set: cr Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/models/package_version.py
diff --git a/app/models/package_version.py b/app/models/package_version.py
index b38891d74556aa6956fdce8c47dfa06a3aa14d35..44a32d856e72ab3ef7a0736114617761bd96f3b6 100644
--- a/app/models/package_version.py
+++ b/app/models/package_version.py
@@ -244,11 +244,10 @@ class PackageVersion(db.Model):
@property
def example_version_constraint(self):
"""Return the example version constraint for this package."""
- if self.version.in_initial_development:
- return json.dumps(">=%s <%d.%d.0" %
- (self.version, self.version.major, self.version.minor + 1))
- return json.dumps(
- ">=%s <%d.0.0" % (self.version, self.version.major + 1))
+ # TODO(nweiz): Once the 1.11 SDK is out and pub supports ">=1.2.3-pre
+ # <1.2.3", suggest that as the version constraint for prerelease
+ # versions.
+ return json.dumps("^%s" % self.version)
@property
def storage_path(self):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698