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

Update Python chapter #302

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Update Python chapter #302

merged 4 commits into from
Nov 6, 2023

Conversation

egpbos
Copy link
Member

@egpbos egpbos commented Nov 2, 2023

Below, describe what this Pull Request adds:

Was trying to fix some links, but came across prospector references, so I removed those first (one of the broken links was to our prospector config file in the python-template, which no longer exists there) and added mention of Ruff.

Will fix other links later.

Fixed other links as well and updated some details on Conda (miniforge now includes mamba, mambaforge is discouraged).

@egpbos egpbos marked this pull request as ready for review November 3, 2023 08:01
Copy link
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

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

Looks good already! Just some suggestions for further improvement

best_practices/language_guides/python.md Outdated Show resolved Hide resolved
best_practices/language_guides/python.md Outdated Show resolved Hide resolved
best_practices/language_guides/python.md Outdated Show resolved Hide resolved
best_practices/language_guides/python.md Show resolved Hide resolved
@jiskattema
Copy link

hi all! i'm not sure this is the right place, please let me know if not ;)
I'm using a language server whenever i can, and for python the best (only?) is https://github.com/python-lsp/python-lsp-server
This comes with its own choice for linter/formatter etc. I really recommend using an LSP to catch errors and find docs!

@egpbos egpbos merged commit 0a41a21 into main Nov 6, 2023
1 check passed
@egpbos egpbos deleted the python_chapter_update branch November 6, 2023 15:43
@egpbos egpbos mentioned this pull request Nov 6, 2023
@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

@jiskattema let's discuss in #317 :)

@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

@bouweandela I merged, since you approved before, but if you'd like to still check the changes, see the last commit :)


Most of the above tools can be integrated in text editors and IDEs for convenience.

Autoformatting tools like [`yapf`](https://github.com/google/yapf) and [`black`](https://black.readthedocs.io/en/stable/index.html) can automatically format code for optimal readability. `yapf` is configurable to suit your (team's) preferences, whereas `black` enforces the style chosen by the `black` authors. The [`isort`](http://timothycrosley.github.io/isort/) package automatically formats and groups all imports in a standard, readable way.

Ruff can do autoformatting as well and can function as a drop-in replacement of `black` and `isort`.
Copy link
Member

Choose a reason for hiding this comment

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

As far as I'm aware, Ruff can only correct small bits of lint, not full autofomatting..

@bouweandela
Copy link
Member

I merged, since you approved before, but if you'd like to still check the changes, see the last commit :)

Thanks! Looks great now, except for the addition on auto formatting. I created a new issue for it..

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.

3 participants