Skip to content

Commit 4e0bb5d

Browse files
authored
Merge pull request #83 from gnikit/feature/remote-update
Disable PyPi autoupdate for prereleases and dev
2 parents 02ea94a + 116fc44 commit 4e0bb5d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELONG
22

3+
## 2.2.8
4+
5+
### Changed
6+
7+
- Disable PyPi autoupdating for pre-releases and dev versions
8+
39
## 2.2.7
410

511
### Changed

fortls/langserver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,8 +1664,12 @@ def _update_version_pypi(self, test: bool = False):
16641664
request = urllib.request.Request("https://pypi.org/pypi/fortls/json")
16651665
with urllib.request.urlopen(request) as resp:
16661666
info = json.loads(resp.read().decode("utf-8"))
1667+
remote_v = version.parse(info["info"]["version"])
1668+
# Do not update from remote if it is a prerelease
1669+
if remote_v.is_prerelease:
1670+
return False
16671671
# This is the only reliable way to compare version semantics
1668-
if version.parse(info["info"]["version"]) > v or test:
1672+
if remote_v > v or test:
16691673
self.post_message(
16701674
"A newer version of fortls is available for download", 3
16711675
)

0 commit comments

Comments
 (0)