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

Improve development in NixOS #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krishnans2006
Copy link
Member

Improves upon #93 (but does not solve it yet).

This PR allows ruff to be installed and run from the Nix store (instead of as a pip package), making it work. However, ruff will still not work within pre-commit.

@krishnans2006 krishnans2006 self-assigned this Jan 8, 2025
@krishnans2006 krishnans2006 requested a review from a team as a code owner January 8, 2025 09:33
@krishnans2006 krishnans2006 requested a review from alanzhu0 January 8, 2025 09:33
@JasonGrace2282
Copy link
Member

When I try it, I end up with an older version of ruff for some reason. Is this just a me problem?

docker exec -it nixos/nix
git clone https://github.com/tjcsl/tin
cd tin
git fetch origin pull/94/head:nix-ruff
git switch nix-ruff
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
ruff --version

Gives a ruff version of 0.4.4, two major versions behind what's used in CI.

@krishnans2006
Copy link
Member Author

When I try it, I end up with an older version of ruff for some reason. Is this just a me problem?

Nope, happens for me too. It's quite annoying how Nixpkgs does versioning...

One solution here is to use Nixpkgs unstable, but that still requires constant lockfile bumps whenever we upgrade ruff on pre-commit. I'll look into it and see if there's something better.

@JasonGrace2282
Copy link
Member

We can always just have nixpkgs unstable as another flake input, although I'm not quite sure how to pin the ruff version without pinning to a nixpkgs commit hash.

@krishnans2006
Copy link
Member Author

Yeah, and even if we are able to pin a ruff version, I think it would be way too annoying to bump it every time we merge in a pre-commit autoupdate (like #89).

Maybe the best solution is just to use the most recent ruff always, but is that even possible? (add flake.lock to gitignore?)

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.

2 participants