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

ruff-check is not provider aware #259

Closed
ahammond opened this issue Dec 16, 2024 · 4 comments
Closed

ruff-check is not provider aware #259

ahammond opened this issue Dec 16, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@ahammond
Copy link

Current Behavior

const commandArgs = ['ruff', 'check']

Currently does not reference provider, so is not aware of uv

Expected Behavior

ruff-check should be running

uvx ruff check

Steps to Reproduce

  1. generate a poetry project
  2. change it to a uv project
  3. cleanup and remove poetry venvs
  4. notice that ruff fails because the python venv it wants to depend on no longer exists

Nx Report

n/a

Failure Logs

❯ pnpm nx run lambda-aurora-user-rotation:lint

> nx run lambda-aurora-user-rotation:lint


Running ruff check on project  lambda-aurora-user-rotation ...

dyld[38950]: Library not loaded: /Users/andrewhammond/.pyenv/versions/3.13.0/lib/libpython3.13.dylib
  Referenced from: <F20756FD-8531-3CBA-B4E2-DF2B56F7324F> /Users/andrewhammond/Library/Application Support/pypoetry/venv/bin/python
  Reason: tried: '/Users/andrewhammond/.pyenv/versions/3.13.0/lib/libpython3.13.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/andrewhammond/.pyenv/versions/3.13.0/lib/libpython3.13.dylib' (no such file), '/Users/andrewhammond/.pyenv/versions/3.13.0/lib/libpython3.13.dylib' (no such file)

   ERROR  poetry run ruff check src test command failed with exit code null

Additional Information

No response

@ahammond ahammond added bug Something isn't working needs-triage This issue needs triage labels Dec 16, 2024
@avadhanij
Copy link

Want to provide additional context. @ahammond and I work together and so, I checked out his branch to test changes.

It seems to expect poetry even when we want to use uv. I even tried generating a new project from scratch and the error logs you see below are from that blank project.

$ npx nx run lambda-aurora-user-rotation:lint

> nx run lambda-aurora-user-rotation:lint

Running ruff check on project  lambda-aurora-user-rotation ...


[tool.poetry] section not found in /Users/ajonnavithula/Dev/clickup/apps/lambda-aurora-user-rotation/pyproject.toml

   ERROR  poetry run ruff check lambda_aurora_user_rotation tests command failed with exit code 1


———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Ran target lint for project lambda-aurora-user-rotation (827ms)

   ✖  1/1 failed
   ✔  0/1 succeeded [0 read from cache]

$ npx nx run lambda-aurora-user-rotation:build

> nx run lambda-aurora-user-rotation:build

  Building project  lambda-aurora-user-rotation ...

  Copying project files to a temporary folder
  Resolving dependencies...

   ERROR  Cannot read properties of undefined (reading 'extras')

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Ran target build for project lambda-aurora-user-rotation (555ms)

   ✖  1/1 failed
   ✔  0/1 succeeded [0 read from cache]

It seems like the provider expected is defaulting to poetry?

@lucasvieirasilva
Copy link
Owner

Hey guys, thanks for raising this issue, I'm gonna fix it today!

@lucasvieirasilva
Copy link
Owner

@ahammond and @avadhanij I've checked the issue, and apparently, that only happens if you delete the root pyproject.toml and root uv.lock files.

did you guys figure out a way to ignore all the node projects (ref: #258 (comment)) so you can keep the root pyproject.toml and root uv.lock files?

@lucasvieirasilva lucasvieirasilva added help wanted Extra attention is needed and removed bug Something isn't working needs-triage This issue needs triage labels Dec 17, 2024
@ahammond
Copy link
Author

Trying with the root pyproject.toml as follows:

[project]
name = "nx-workspace"
version = "1.0.0"
dependencies = [
  "lambda-aurora-user-rotation",
]

[dependency-groups]
dev = [
  "ruff>=0.8.2",
  "autopep8>=2.3.1",
  "pytest>=8.3.4",
  "pytest-sugar>=1.0.0",
  "pytest-cov>=6.0.0",
  "pytest-html>=4.1.1"
]

[tool.uv.sources.lambda-aurora-user-rotation]
workspace = true

[tool.uv.workspace]
members = [
  "apps/lambda-aurora-user-rotation/",
  "apps/lambda-demo-pkg/",
]

And it's generating a uv.lock file. Tried linting and... huzzah! It worked!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants