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

Allow conda autoupdate #346

Closed
wants to merge 4 commits into from

Conversation

emanspeaks
Copy link
Contributor

Disabled by default, but provides the option to allow autoupdating fortls when installed in a conda environment for those of us who do desire that functionality and don't mind it changing the environment.

Additionally fixes bug in unit test for updater where config file was not being properly loaded by the LangServer instance.

@emanspeaks emanspeaks requested a review from gnikit as a code owner January 4, 2024 17:35
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (8263781) 87.51% compared to head (4182503) 87.36%.

Files Patch % Lines
fortls/langserver.py 60.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #346      +/-   ##
==========================================
- Coverage   87.51%   87.36%   -0.15%     
==========================================
  Files          35       35              
  Lines        4756     4771      +15     
==========================================
+ Hits         4162     4168       +6     
- Misses        594      603       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@gnikit gnikit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the responsibility of the language server. How one chooses to install the fortls should not affect the language server.

There is a notification emitted when fortls is out-of-date that should prompt for user action, however the responsibility to update is up to the user. PyPi is supported because it is the official Python package manager. Embedding anything more about third-party package managers and custom installation steps falls outside of the scope of the tool.

@emanspeaks
Copy link
Contributor Author

You do provide a conda-forge feedstock for this repo, though. That implies it should be a supported way to install and update the package. I am not advocating for supporting all environment managers (e.g. poetry) because you aren't offering those. If not here, though, would the vscode extension be a better place to implement this? I feel like that should be opinionated about how it is installed even if the language server itself is not. I don't want my teammates to just never update their fortls because they will ignore the messages. I think it would be a convenient feature for others to have as well.

@gnikit
Copy link
Member

gnikit commented Jan 4, 2024

We offer multiple ways of installing, at no point does that imply that we should add code to handle autoupdates for each package manager and distribution channel. This is simply not sustainable nor a good way of separating responsibilities between the application and the various installers.

The conda exclusion was added explicitly because Anaconda users didn't want to have Python module self-updating. For homebrew such functionality can be considered a disqualifying feature for a package see. If one is using a proper package manager like conda or brew it is ultimately their responsibility to keep it updated and the tool's responsibility not to break their environment.

@emanspeaks
Copy link
Contributor Author

If not here, though, would the vscode extension be a better place to implement this?

Since this change is not desired here, would it be better entertained in the vscode-fortran-support extension? In hindsight, that seems a better place for something like this in any case; I pushed the PR here primarily since the PyPI feature was here. I can try to recreate that capability there instead if you would be supportive of allowing that feature there.

There is still a bug in the server interface unit tests captured here I'd like to merge, so I can create a new PR targeted for that fix and, pending resolution of this conversation, this one could then be closed.

Just let me know what you think about me moving this feature to the vscode extension so I don't spin my wheels on it over there too!

@emanspeaks
Copy link
Contributor Author

Closing this in lieu of #347 and fortran-lang/vscode-fortran-support#1037

@emanspeaks emanspeaks closed this Jan 7, 2024
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.

2 participants