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

extension points #58

Closed
koxudaxi opened this issue Jun 7, 2020 · 19 comments
Closed

extension points #58

koxudaxi opened this issue Jun 7, 2020 · 19 comments
Assignees
Labels
Feedback Wanted Meta Need Extension Point We need extension points to resolve this issue.

Comments

@koxudaxi
Copy link
Owner

koxudaxi commented Jun 7, 2020

We must list the extension points that will implement.

Extension points

@koxudaxi koxudaxi added Meta Feedback Wanted Need Extension Point We need extension points to resolve this issue. labels Jun 7, 2020
@koxudaxi koxudaxi changed the title required extension points extension points Jun 8, 2020
@koxudaxi
Copy link
Owner Author

koxudaxi commented Jun 8, 2020

@vlasovskikh
Would you please share a list of extension points to support the plugin in PyCharm?
these extension points would not exist yet.

@vlasovskikh
Copy link

@koxudaxi Meanwhile, I've begun switching some of my personal projects to Poetry as an experiment and I've installed your plugin to get a hands-on experience with it.

See a PR to my own repository vlasovskikh/funcparserlib/pull/61. Feel free to review it if you're interested :)

@vlasovskikh
Copy link

@koxudaxi Could you please set me as the assignee for this issue? It would be easier for me to track it in my list of assigned and pending issues. I will look into the extension points we need and into our PyCharm API around environments and package management in general. I hope I'll do it by the next weekend, but I don't make any promises.

@vlasovskikh
Copy link

@koxudaxi Thank you!

@vlasovskikh
Copy link

vlasovskikh commented Jun 13, 2020

Here's the list I got so far. It's still a work in progress. My next steps will be:

  • Come up with a possible API (extension points) to accommodate these features for Pipenv, Poetry, and potentially other package managers and Python interpreter types
  • Start adding bits of this API into PyCharm 2020.2 EAP

The list of places I had to customise to enable Pipenv support (Poetry is somewhat similar here, but there will be things that are different like several possible environments per project):

Hard-coded:

  • Set up a new project
    • PythonSdkConfigurator
      • Detect and set up a per-project interpreter with Pipenv as the package
        manager
    • PyAddNewEnvironmentPanel
      • New Pipenv environment panel for a new project
  • Settings
    • PyIntegratedToolsConfigurable
      • Path to the Pipenv executable (there is no need to put all the tools
        into this configurable)
  • Inspections
    • PyInterpreterInspection (SDK)
      • Check if the Pipenv interpter is valid
      • A quick-fix action to use or fix the interpreter
    • PyPackageRequirementsInspection (Packaging)
      • A quick-fix action to install the requirements from Pipfile.lock
  • Packaging
    • PyPackageManagersImpl
      • Get a Pipenv package manager for the SDK (list / install / remove)
      • Get a Pipenv package management service (browse package repositories) for the SDK
  • SDK
    • PythonSdkType
      • Load SDK additional data from jdk.table.xml (to know that it is a Pipenv, not just a regular virtualenv, not sure if it's really that necessary)
    • PySdkRendering
      • Get the presentable name for the Pipenv interpreter
      • Get the icon for the Pipenv interpreter
    • PyStatisticTools
      • Collect the stats about the SDK type

Extension points:

  • PyAddSdkProvider
    • A panel for adding an SDK
  • PythonFlavorProvider
    • Get SDK "flavor": customize things like detecting paths, Python version,
      if the path is valid, etc.

@koxudaxi
Copy link
Owner Author

koxudaxi commented Jul 4, 2020

@vlasovskikh
How is progress implementing extension points?
Where do I check the status? tracker? PR? I can't find it 😕
I’m sorry I didn't mean to rush you.

I use the plugin for some projects. It works fine.
The plugin was downloaded over 2.2k.
And, I got good feedback 🎉

I want to proper next stage.

If you don't have time to implement an extension point then I may be able to write it or follow you.
Please feel free to contact me.

@vlasovskikh
Copy link

@koxudaxi Sorry, I had to switch to other tasks, but now I'm back :) Our team will have a meeting about interpreters and API changes this week, I'll post updates here in this issue at the end of the week. I hope I don't block your progress on the plugin too much. I'm glad the plugin has been getting good reviews so far :)

@koxudaxi
Copy link
Owner Author

koxudaxi commented Jul 8, 2020

@vlasovskikh
I’m sorry for the late reply.
No problem. I'm happy your good answer 😄

@vlasovskikh
Copy link

@koxudaxi We've been working on the new API for interpreters and packaging and we've discovered more things we want to change in this API (e.g. add the ability to create Python environments on remote hosts). It seems reasonable to split the work on the interpreter and packaging extension points into two stages:

  • For 2020.2.x releases: Introduce a simple (and non-stable) API that just moves all the mentions of "Pipenv" into this extension point. It will allow poetry-pycharm-plugin to continue with what's already there for Pipenv and use it for Poetry
  • For 2020.3 EAP builds: Switch to the new API that introduces more configurability and allows to implement all other interpreter and packaging types on top of it

We're too close to the 2020.2 release to introduce any changes to this version, so for this simple API I'll target 2020.2.2. Sorry @koxudaxi we keep you waiting for these extension points.

@jwiede
Copy link

jwiede commented Aug 23, 2020

@vlasovskikh another month has passed. Can you please provide interested customers with concrete scheduling info on the plans you mentioned, associated trackers/PR's and so forth? The continued lack of tangible development progress towards Poetry support is quite disappointing.

@vlasovskikh
Copy link

@jwiede We will release the extension points I've mentioned above in PyCharm 2020.2.2 in about a month. The updates will appear in 2020.2.2 RC which we will release in about 3 weeks. I'll post the links to the corresponding commits we've made to update the packaging and interpreters API.

@vlasovskikh
Copy link

@koxudaxi We've implemented PY-44304 about extracting Pipenv support into reusable extension points for PyCharm 2020.2.x (step 1 from my list above). It will appear soon in 2020.2.2 RC.

Check out these interfaces:

and their implementations for Pipenv.

@koxudaxi
Copy link
Owner Author

koxudaxi commented Sep 9, 2020

@vlasovskikh
Thank you for creating extension points.
I will check it and try to change the plugin for the extension points.

@Vozf
Copy link

Vozf commented Sep 19, 2020

@vlasovskikh Is there any new info for the new API for 2020.3 you mentioned? I'm particularly interested in the remote hosts env creation with poetry.
This issue unfortunately doesn't have any new info https://youtrack.jetbrains.com/issue/PY-29642
Should we expect remote host env creation in 2020.3?

@vlasovskikh
Copy link

@Vozf The API will be based on the concept of execution targets, see TargetEnvironment and other interfaces in com.intellij.execution.target. The API is still in progress: it's not complete and not documented yet. We've marked it with @ApiStatus.Experimental. We might release creating environments on remote hosts in 2020.3, but I cannot make any promises at this moment.

@koxudaxi
Copy link
Owner Author

@vlasovskikh @jwiede
I have released a new version as 0.5.0
the version supports the new APIs on PyCharm 2020.2.2 that are below.

  • PySdkProvider
  • PyPackageManagerProvider

@vlasovskikh
Copy link

@koxudaxi Cool! Thanks for switching to the new API! If you have any feedback about the API we've got so far (anything that is still missing, or not convenient), please don't hesitate to discuss it here. As I've mentioned in my comment above, the next step for the PyCharm team regarding this API will be make environment management available for remote hosts. I'll be sharing the status updates about this feature.

@vlasovskikh
Copy link

The API for remote hosts is not ready for 2020.3. Other than that, @koxudaxi do you have ideas about any other extension points at the moment? If most features are covered I would suggest creating issues about individual features and closing this one.

@koxudaxi
Copy link
Owner Author

@vlasovskikh
I agree. I use this plugin for private projects.
I think this version covers basic features.
I close this issue.
Thank you very much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feedback Wanted Meta Need Extension Point We need extension points to resolve this issue.
Projects
None yet
Development

No branches or pull requests

4 participants