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

Added fortls autoupdate during initialisation #75

Merged
merged 4 commits into from
Mar 8, 2022

Conversation

gnikit
Copy link
Member

@gnikit gnikit commented Mar 8, 2022

The server will ping PyPi and check if a version is available greater
than the currently installed version. If an old version is detected
fortls will download the new version to the pip localtion of the
current Python distribution.

This should allow for fortls to be correctly installed most times.
Obviously if running from a directory structure that does not
adhere to how pip/conda install packages this might not work.

The server will ping PyPi and check if a version is available greater
than the currently installed version. If an old version is detected
fortls will download the new version to the pip localtion of the
current Python distribution.

This should allow for fortls to be correctly installed most times.
Obviously if running from a directory structure that does not
adhere to how pip/conda install packages this might not work.
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #75 (40fa549) into master (65bfb20) will increase coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
+ Coverage   81.71%   81.73%   +0.01%     
==========================================
  Files           9        9              
  Lines        4338     4368      +30     
==========================================
+ Hits         3545     3570      +25     
- Misses        793      798       +5     
Impacted Files Coverage Δ
fortls/objects.py 81.16% <ø> (ø)
fortls/parse_fortran.py 86.42% <ø> (ø)
fortls/langserver.py 73.03% <82.75%> (+0.28%) ⬆️
fortls/interface.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65bfb20...40fa549. Read the comment docs.

@gnikit gnikit linked an issue Mar 8, 2022 that may be closed by this pull request
@gnikit gnikit merged commit 9723617 into master Mar 8, 2022
@gnikit gnikit deleted the feature/fetch-updates branch March 8, 2022 17:55
@band-a-prend
Copy link

band-a-prend commented Dec 1, 2022

@gnikit
Could you please give a cue how to patch fortls for permanent disabling of update check without passing command line parameter?

I disable update check for tests for networkless
sandbox with

sed -i -e 's/"--incremental_sync",/"--incremental_sync", "--disable_autoupdate",/' test setup_tests.py

but I also would like to disable it for package installed into system directory too.
It's sufficient to add default=True value where option is specified in interface.py?

@gnikit
Copy link
Member Author

gnikit commented Dec 7, 2022

Sorry I missed this @band-a-prend, I cannot in good consciousness recommend this, since historically it leads to people opening reports for already resolved issues simply because they run an outdated version of fortls, which ultimately increases the maintenance work for us. I don't see why you would want to run the dev tests in a networkless environment, the only reason to do that is if you want to contribute to fortls which you can easily do with 2 clicks in a browser using GitHub CodeSpaces.

@band-a-prend
Copy link

I don't see why you would want to run the dev tests in a networkless environment

This is just a specifics Gentoo Linux packaging process when tests are ran in networkless sandbox env to be sure of it's reproducibility, have no side effects, dependence of external service availability etc... and to posibility run tests on isolated systems without internet connection.

I will try to avoid store outdated versions in repository. I assume even if fortls unable to update due to permission restriction of system directory there will be no problems for further processing.

@gnikit
Copy link
Member Author

gnikit commented Dec 8, 2022

This will potentially come back to haunt me but if you want to disable fortls version checking you can create a patch removing or constantly evaluating the if-conditional to False here:

fortls/fortls/langserver.py

Lines 203 to 207 in 833755e

if self._update_version_pypi():
self.post_message(
"Please restart the server for the new version to activate",
Severity.info,
)

run tests on isolated systems without internet connection.

One of the interface tests would fail in such an environment, because it actually tests the PyPi metadata fetching mechanism, but that shouldn't matter for Users, and yes you are correct, if internet access is missing or inadequate permissions are present, fortls will carry on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoupdate language server version
2 participants