Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Highlight package when a new version is available #79

Open
systemallica opened this issue Jul 31, 2020 · 12 comments
Open

Highlight package when a new version is available #79

systemallica opened this issue Jul 31, 2020 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@systemallica
Copy link
Contributor

Add package highlighting in pyproject.toml when a new version is available, in the same way that it's done for requirements.txt:

Screenshot 2020-07-31 at 11 38 26

@koxudaxi koxudaxi self-assigned this Aug 1, 2020
@koxudaxi koxudaxi added the enhancement New feature or request label Aug 1, 2020
@koxudaxi
Copy link
Owner

koxudaxi commented Aug 1, 2020

@systemallica
Thank you for creating this issue.
I think it's a great idea.
I will try it.

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 2, 2020

@systemallica
I can't see the popup in my environment 🤔
How do I reproduce showing the popup?
Screenshot_2020-08-03_01-57-18

@systemallica
Copy link
Contributor Author

@koxudaxi I think it's a feature of this plugin: https://plugins.jetbrains.com/plugin/10837-requirements

Sorry I forgot go mention it.

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 2, 2020

@systemallica
OK, I will check it.

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 5, 2020

I have understood how do I implement it.
I will try it 🚀

@systemallica
Copy link
Contributor Author

Glad to hear that! Keep up the good work 😁

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 9, 2020

@systemallica
I have implemented the feature.
This plugin run poetry show --outdated to get outdated version.

Screenshot_2020-08-10_02-28-39

The feature only shows a warning when there is the latest version.
It doesn't provide QuickFix that is an action to resolve the warning (exp install a new version)
because I don't know what does the plugin should do it.

How did you think about it?

@systemallica
Copy link
Contributor Author

That looks awesome! Thank you very much.

It's ok if it doesn't offer you a quickfix, knowing that there's a new version is the most important part imo. Then the user can change the version manually and run 'poetry update' ☺️

@koxudaxi
Copy link
Owner

OK, I have pushed the latest version to the JetBrains server via GitHub Action.
It will be approved within two business days.
After, we can download it.

@systemallica
Copy link
Contributor Author

systemallica commented Aug 11, 2020

@koxudaxi I just installed 0.1.2 and it works pretty well, thank you!

However I noticed that the plugin does not look for new versions until I modify the pyproject.toml file. If I'm not mistaken, with a requirements.txt file, the inspection happens automatically without the need of modifying the file. Is this something that could be done withe your plugin?

Another thing I noticed is that, once a package is highlighted, it will remain highlighted until you:

  1. Change the version
  2. Run poetry update
  3. Change something in the file so that the inspection runs again

Imo, it should stop being highlighted after step 1. What do you think?

Anyway thank you for your work :D

@koxudaxi
Copy link
Owner

@systemallica

However I noticed that the plugin does not look for new versions until I modify the pyproject.toml file.

I may have to change the way to inspect pyproject.toml 🤔

Imo, it should stop being highlighted after step 1. What do you think?

Now, The plugin calls poetry show --outdated when pycharm detect package updated.
And, outdated versions will be highlighted.
It means the plugin doesn't parse pyproject.toml.

Change the version

If we want to detect the version in the plugin then I have to implement a version parser.
I need the time to do it.

Sorry, I am not a PyCharm master. I must learn PyCharm APIs to develop plugins 🤓

I don't close this issue. I will improve the feature when I get the time.

@wakemaster39
Copy link

I just wanted to add an edge case here to be aware of. poetry show --outdated compares against the installed lock version and whats available. Starting to use the plugin it was highlighting some of my dependencies with versions like ^8.0.0. saying the version is outdated and a newer one is available like 8.1.0.

This technically is correct from the lock standpoint but incorrect from the pyproject.toml standpoint.

As you mentioned you do not parse the version in the plugin so this is hard to avoid, but stating that the lock file is out of date or something there might aid in confusion when the version string would catch the latest version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants