Create a modern pre-commit setup for Python using UV, Ruff and more

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 17

  • @kurtke1990
    @kurtke1990 7 วันที่ผ่านมา

    Thank you for sharing. This helps a lot.

  • @SalahSaoud-j5s
    @SalahSaoud-j5s 22 ชั่วโมงที่ผ่านมา

    Thank you so much for the follow up video. Another fantastic video.
    Could you please share your thoughts on the tools and ways to document your python projects.

    • @Timnology-r4s
      @Timnology-r4s  19 ชั่วโมงที่ผ่านมา

      To document the project I typically use www.mkdocs.org/ and use a CI pipeline to push it to a static website provider such as azure.microsoft.com/en-us/products/app-service/static. Alternatively you can host static websites on most cloud storages such as GCP Buckets, Amazon S3 and Azure Storage Accounts.

  • @timothyspottering
    @timothyspottering 16 วันที่ผ่านมา

    You are really motivating me to introduce a CI / CD pipeline for my python startup development!
    Every of your videos is like a friendly reminder, that I should be doing that.

    • @Timnology-r4s
      @Timnology-r4s  16 วันที่ผ่านมา

      I consider that a win!

  •  16 วันที่ผ่านมา

    Your videos are amazing.

  •  16 วันที่ผ่านมา

    Great video! Would you consider making a video about your PyCharm settings? Your setup looks minimalist, similar to my VSCode, and I’m interested in migrating from VSCode to PyCharm. I’ve customized a lot of settings in VSCode, but I’d like to learn more about PyCharm and its benefits. I've tried adjusting some settings and the UI to resemble yours, but I couldn’t quite get it right. I’d also love to know about integrations with tools like Ruff and Pyright in PyCharm and how they work together.

    • @Timnology-r4s
      @Timnology-r4s  13 วันที่ผ่านมา +1

      Thanks for the suggestions. I'll have a think on how to structure such a video! To quickly get what was shown in the video you can install the catppuccin color scheme. The cleanliness mostly comes from enabling view -> appearance -> Presentation Mode. Distraction Free mode also works really well to hide a lot of UI elements.

    •  13 วันที่ผ่านมา

      ​@@Timnology-r4s Thanks i will check!

  • @it_is_ni
    @it_is_ni 5 วันที่ผ่านมา

    @0:44 just so you know: some of the characters in the icons are a lot closer together than the others, looks kinda weird. Maybe a kerning setting in the tool you're using to generate those?

    • @Timnology-r4s
      @Timnology-r4s  19 ชั่วโมงที่ผ่านมา

      Thanks, now I can't unsee that, didn't notice it before :p. I use www.manim.community/ for the animations. I'll have a look if it does something weird with the kerning for non build-in fonts.

  • @alejandroulisessanchezgame6924
    @alejandroulisessanchezgame6924 15 วันที่ผ่านมา

    Can u share your nvim config, or make a video about it ? 🙏

    • @Timnology-r4s
      @Timnology-r4s  13 วันที่ผ่านมา

      In this video I'm using IntelliJ, but in others I'm using neovim. I'll have a think in how to showcase how I've setup my dev environment..

  • @yorailevi6747
    @yorailevi6747 วันที่ผ่านมา

    I love it a lot! 2 questions.
    1) will you update the website to add pre-commit instruction?
    2) the pre-commit versioned hooks aren't updated to stay in sync if pyproject.toml version are updated, do you have any idea how to keep the pre-commit and local project tooling on the same version? example: pyright recently complained:
    ```
    WARNING: there is a new pyright version available (v1.1.387 -> v1.1.390).
    Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`
    ```
    which requires updating both files

    • @Timnology-r4s
      @Timnology-r4s  19 ชั่วโมงที่ผ่านมา

      1. Oh dang, thanks for the heads-up. I forgot to hit publish, the website is updated with the write-up now :).
      2. There are a few ways to go about that, one way is to simply not update to the latest version unless you're missing features or run into bugs. A second is to indeed do it manually, for small projects that is usually fine. Lastly, the more mature option is to use automated systems such as docs.renovatebot.com/ which what I typically use. It supports UV, lock files AND pre-commit!

  • @Aristocle
    @Aristocle 11 วันที่ผ่านมา

    Is there a particular reason why the pre-commit file is inside the tests folder? and not in the project root.
    Also, I believe the pyproject.toml file is in the tests folder just to run this specific example?
    Could you also give an example for gitlab?

    • @Timnology-r4s
      @Timnology-r4s  11 วันที่ผ่านมา

      Both files are in the root. Perhaps they appear to be in the tests folder because of the right pointing chevron, but they are siblings. See the repo: github.com/timvancann/yt-python-ci.
      Pre-commit hooks are fully independent of CI provider, so this setup will work fine for gitlab as well.