Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# CHANGELONG
# CHANGELOG

## 2.3.1

### Fixed

- Fixed remote coverage report line diff
([#101](https://github.com/gnikit/fortls/issues/101))

## 2.3.0

Expand Down
6 changes: 3 additions & 3 deletions fortls/langserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, conn, settings: dict):
self.workspace: dict[str, fortran_file] = {}
self.obj_tree: dict = {}
self.link_version = 0
self._version = version.parse(__version__)
# Parse a dictionary of the command line interface and make them into
# class variable. This way the command line and the file interfaces
# are always on sync, with the same default arguments
Expand Down Expand Up @@ -1719,9 +1720,8 @@ def _update_version_pypi(self, test: bool = False):
"""
if self.disable_autoupdate:
return False
v = version.parse(__version__)
# Do not run for prerelease and dev release
if v.is_prerelease and not test:
if self._version.is_prerelease and not test:
return False
try:
# For security reasons register as Request before opening
Expand All @@ -1733,7 +1733,7 @@ def _update_version_pypi(self, test: bool = False):
if remote_v.is_prerelease:
return False
# This is the only reliable way to compare version semantics
if remote_v > v or test:
if remote_v > self._version or test:
self.post_message(
"A newer version of fortls is available for download",
Severity.info,
Expand Down
2 changes: 2 additions & 0 deletions test/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def test_config_file_codeactions_options():
def test_version_update_pypi():
from fortls.jsonrpc import JSONRPC2Connection, ReadWriter
from fortls.langserver import LangServer
from packaging import version

parser = commandline_args("fortls")
args = parser.parse_args("-c f90_config.json".split())
Expand All @@ -186,5 +187,6 @@ def test_version_update_pypi():
assert not did_update

s.disable_autoupdate = False
s._version = version.parse("999.0.0")
did_update = s._update_version_pypi()
assert not did_update