hypermodern-python icon indicating copy to clipboard operation
hypermodern-python copied to clipboard

IDE question

Open Alexfinkelshtein opened this issue 5 years ago • 5 comments

Hi thanks for the guide, very interesting so far, What would be the reason IDEs where left out of the discussion?

Alexfinkelshtein avatar May 31 '20 14:05 Alexfinkelshtein

What would be the reason IDEs where left out of the discussion?

You should be able to use all the popular IDEs and editors with this workflow, for example Visual Studio Code, or PyCharm. (If you have any problems using your IDE or editor with it, do let me know.)

There are several reasons why I did not talk about IDEs.

  • IDEs generally come with their own ways of integrating tools. That's great, but if you collaborate with other people, you need a way of setting up a development environment that does not depend on a specific IDE. Ideally, anybody with a shell and an editor should be up and running with your project in a short time, and be able to contribute to it.

  • Another reason is that the article series tries to stay out of the business of surveying available tools and weighing their advantages and disadvantages. Instead, it attempts to trace one clear path through the maze that I have found to work, without giving you a lot of options. IDEs are too much of a matter of personal preference for that approach.

  • I don't use an IDE 😊

cjolowicz avatar Jun 01 '20 04:06 cjolowicz

Thanks for the answer, I can see your point... It was probably a good call to leave it out of this article series. I am still curious about the approach of not using and IDE, pros/cons, why do you prefer it.. I'll be happy if you would elaborate on this. Thanks!

Alexfinkelshtein avatar Jun 01 '20 07:06 Alexfinkelshtein

Sure. I've just always used emacs, nowadays in the form of spacemacs with vi bindings. It still integrates with black, flake8, and mypy, for example. But I like a workflow where everything is quite decoupled and flexible, and you always keep a terminal window close. (Not saying you can't get that with modern IDEs as well, this is just what I'm most productive in right now.)

cjolowicz avatar Jun 01 '20 08:06 cjolowicz

I have a question link to some issue with the pre-commit hook. before this article I used to manage git taks in git VSC git tab or in Github Desktop. Since I set-up the pre-commit hook, I have an error with VSC and Github Desktop who seem to not find poetry.

> git commit --quiet --allow-empty-message --file -
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
black....................................................................Failed
- hook id: black
- exit code: 1

Executable `poetry` not found

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

Executable `poetry` not found

Any idea how to solve that ? Except using only terminal to manage git stuff ;-)

oncleben31 avatar Jun 22 '20 21:06 oncleben31

It's hard to give concrete advice here, as I know too little about your specific setup. But basically it boils down to this: The process running git must have poetry on its PATH. So you need to find out two things:

  • Where is poetry installed on your filesystem?
  • What is the value of the PATH environment variable in the git process? Usually the environment is just inherited from the program invoking git, which would be VS Code or GitHub Desktop in your case. So you could start there.

If you installed Poetry as recommended in the article, your shell startup file should take care of getting Poetry on your PATH. If your editor does not see this, it was not started from a shell (directly or indirectly), so you need to find out how to configure the editor to set PATH correctly (or just start the editor from a terminal session).

cjolowicz avatar Jun 24 '20 09:06 cjolowicz