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

Create extension pack "inwt Python IDE" #1

Open
chamaoskurumi opened this issue Nov 2, 2023 · 12 comments
Open

Create extension pack "inwt Python IDE" #1

chamaoskurumi opened this issue Nov 2, 2023 · 12 comments
Assignees

Comments

@chamaoskurumi
Copy link

  • Minimal set an Python extensions bundled into a pack
  • Should represent as good as possible our inwt best practices
@chamaoskurumi chamaoskurumi changed the title Create extension pack "INWT Python IDE" Create extension pack "inwt Python IDE" Nov 2, 2023
@chamaoskurumi
Copy link
Author

@chamaoskurumi
Copy link
Author

chamaoskurumi commented Nov 29, 2023

What do we actually need?

VSCode extensions needed

  • Python ms-python.python (includes Pylance as language server. inwt-smart-execute has Python as a dependency anyway, but we want to make it explicit)
  • Jupyter ms-toolsai.jupyter (also dependency, but we make it explicit)
  • black jaakko.black (auto-formatting) I realized ruff can also do formatting and if that works fine, we don't need black anymore...so one dependency less
  • ruff charliermarsh.ruff (linting - replaces isort, flake8, etc... according to here)
  • mypy ms-python.mypy-type-checker (typechecking) Can be handled by Pylance (pyright) which is automatically installed as language server. I simply enabled the capability via the configuration. It is also faster and works out of the box. When there are no type annotations, pyright is doing type inference to some extend, which will give you hints none the less (different to mypy which always assumes ANY if annotations are missing)
  • rewrap stkb.rewrap (comment rewrapping, not yet implemented in ruff but maybe soon)
  • autoDocstring njpwerner.autodocstring (creates nice docstrings for functions and classes via TAB)
  • Python Environment Manager donjayamanne.python-environment-manager
  • inwt-smart-execute inwtlab.python-smart-execute
  • Python-indent KevinRose.vsc-python-indent

Settings

  • Configuration of ruff (line length, etc....)
    • line-length: 100
    • Ignore: ANN: We do not enforce type annotations by default
    • Ignore: D: We do not enforce doc strings by default
    • enable auto-format and sort imports on save
  • Configuration of black (used by default and automatically)
  • Configuration of rewrap (set line length and enable automatically and autoformat)
    • line-length: 100
  • Configuration of autoDocstring (set default docstring format to "google")

@wahani
Copy link
Member

wahani commented Nov 30, 2023

I removed the smart execute logic and also most of the extensions from the bundle. When we start to configure ruff, black and so on, we have to check if this is now possible using configurationDefaults:

image

Maybe with this we do not need to create a settings.json after all.

Also we now have a gh action to publish the extension. This happens as soon as we create a tag on gh.

@chamaoskurumi
Copy link
Author

I added python-indent KevinRose.vsc-python-indent to the list above

chamaoskurumi pushed a commit that referenced this issue Dec 8, 2023
@wahani
Copy link
Member

wahani commented Dec 11, 2023

Did a first release. Had to strip some more configuration to get there. But also verified the gh action works: https://marketplace.visualstudio.com/items?itemName=inwtlab.inwt-python-ide-v2

@wahani
Copy link
Member

wahani commented Dec 15, 2023

@chamaoskurumi do we actually need python-indent when we autoformat at the same time?

@chamaoskurumi
Copy link
Author

Well I trusted the author of python-indent when he says

image

But tbh I didn't try it out, maybe this information is outdated and python-indent is not needed.

@chamaoskurumi
Copy link
Author

Besides, I tried to updated the npm packages in this branch, but unfortunately it created all sorts of problems. We either accept that we work with (very) old package versions or we need to update one by one to see how far we get without breaking things.

@wahani
Copy link
Member

wahani commented Dec 20, 2023

Besides, I tried to updated the npm packages in this branch, but unfortunately it created all sorts of problems. We either accept that we work with (very) old package versions or we need to update one by one to see how far we get without breaking things.

Since they are only relevant for development and we do not need them for the extension, I would leave them as they are. If you want to follow that road, I would start from scratch, following https://code.visualstudio.com/api/get-started/your-first-extension for an extension pack, and simply update/copy the contents from the package.json.

@wahani
Copy link
Member

wahani commented Dec 20, 2023

Well I trusted the author of python-indent when he says

I went through some of the examples and I think with autoformatting, there is not much you gain. Also some of the mentioned tickets are closed, because they have become part of pylance and got implemented.

@chamaoskurumi
Copy link
Author

chamaoskurumi commented Jul 15, 2024

@wahani I guess we can close this issue, since all relevant python extensions were included in the inwt Python IDE v2 already, right? (I'm referring to these extensions here )

@wahani
Copy link
Member

wahani commented Jul 15, 2024

I think the doc string extension is missing.

chamaoskurumi pushed a commit that referenced this issue Jul 15, 2024
@chamaoskurumi chamaoskurumi removed their assignment Oct 23, 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

No branches or pull requests

2 participants