MCPcopy Create free account
hub / github.com/nodejs/node / prereleases

Method prereleases

tools/gyp/pylib/packaging/specifiers.py:257–278  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

255 # https://github.com/python/mypy/pull/13475#pullrequestreview-1079784515
256 @property # type: ignore[override]
257 def prereleases(self) -> bool:
258 # If there is an explicit prereleases set for this, then we'll just
259 # blindly use that.
260 if self._prereleases is not None:
261 return self._prereleases
262
263 # Look at all of our specifiers and determine if they are inclusive
264 # operators, and if they are if they are including an explicit
265 # prerelease.
266 operator, version = self._spec
267 if operator in ["==", ">=", "<=", "~=", "==="]:
268 # The == specifier can include a trailing .*, if it does we
269 # want to remove before parsing.
270 if operator == "==" and version.endswith(".*"):
271 version = version[:-2]
272
273 # Parse the version, and if it is a pre-release than this
274 # specifier allows pre-releases.
275 if Version(version).is_prerelease:
276 return True
277
278 return False
279
280 @prereleases.setter
281 def prereleases(self, value: bool) -> None:

Callers

nothing calls this directly

Calls 1

VersionClass · 0.70

Tested by

no test coverage detected