• 1 Post
  • 112 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
    1. let pyproject.toml track the dependencies and dev-dependencies you actually care about
    • dependencies are what you need to run your application
    • dev-dependencies are not necessary to run your app, but to develop it (formatting, linting, utilities, etc)
    1. it can track exactly what’s needed ot run the application via the uv.lock file that contains each and every lib that’s needed.
    2. uv will install the needed Python version for you, completely separate from what your system is running.
    3. uv sync and uv run <application> is pretty much all you need to get going
    4. it’s blazingly fast in everything








  • Same for cd -. Nice if you want to go to /etc/blah, and then back to where you were.

    You can also use pushd and popd which will push and pop directories from a stack, if you need to do something more complex.

    Also, if you want to switch faster between branches, slap this in your ~/.gitconfig under [alias]:

    co = !git checkout $(git for-each-ref refs/heads/ --format='%(refname:short)' | fzf)

    Presuming you’ve got fzf installed, you can now git co (co = checkout) to get a menu with fuzzy find capabilities to switch between branches. Nice if branch names are long/similar/only-different-at-the-end.

    fzf is dope.


  • Kids these days….

    These Ctrl keys are shortcuts from Emacs - there’s a Bash settings to switch to vi-mode if you so wish. Anyway, the first Emacs was written in 1981, probably on a PDP-11, which did not have Home and End! Same reason Neovim uses “yank” instead of “copy”. ctrl-c/ctrl-v did not exist as a shortcut back when vi was being written!

    I know you didn’t intend to be mean or anything, but maaaaaan kids these days don’t know their history (not entirely your fault, btw)😆







  • It comes with built-in ruff and uv, and can handle Python versioning for you!

    Not sure if they want to eventually dissolve Rye into uv or what, but for now it’s one of the best (better than Poetry, IMO)

    edit: it also uses the pypoetry.toml standard, something Poetry doesn’t (because Poetry predates pyproject.toml becoming a standard).

    One possible downside: I’ve heard Rye doesn’t honor XDG, which means it has its own location for its config. I don’t mind, but perhaps you do.

    A second possible downside is that Rye doesn’t let you centralize your venvs, so each .venv goes into each project folder, so no using virtualenvwrapper with workon to jump between projects. zoxide can alleviate that problem, or presuming you have a ~/dev folder or similar, you could write a bash function that ls’ that folder and lets you select a folder via fzf? Go ask ChatGPT about it or something.

    edit2: link: https://rye.astral.sh/guide/installation/