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

uv fails to pip compile nb-black #2638

Closed
owenlamont opened this issue Mar 24, 2024 · 4 comments
Closed

uv fails to pip compile nb-black #2638

owenlamont opened this issue Mar 24, 2024 · 4 comments

Comments

@owenlamont
Copy link

owenlamont commented Mar 24, 2024

uv pip compile fails with nb-black package (while pip compile works with it). I think uv is just being stricter about the version data type in the nb-black's setup.py while pip compile is apparently more lenient. I'm happy to accept this is just something broken in nb-black and I don't plan to keep that dependency... I just noticed the behaviour was different between pip compile and uv pip compile.

image
  • A minimal code snippet that reproduces the bug (requirements.in)
nb-black
  • The command you invoked
uv pip compile requirements.in -o requirements.txt
  • The current uv platform.

Running on Windows, pipx installed uv (with a Python 3.12.2 env). Created a Python 3.11.2 venv and attempted the above uv pip compile (I have reproduced the same issue on Ubuntu too also with a Python 3.11.2 venv).

  • The current uv version (uv --version).
uv 0.1.24 (a5cae0292 2024-03-22)
@notatallshaw
Copy link

I get the same error with pip:

PS C:\Users\damia> py -V
Python 3.12.2
PS C:\Users\damia> py -m pip -V
pip 24.0 from C:\Users\damia\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)
PS C:\Users\damia> py -m pip install --dry-run nb-black
Collecting nb-black
  Downloading nb_black-1.0.7.tar.gz (4.8 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      error in nb_black setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after name and no valid version specifier)
          yapf >= '0.28'; python_version < '3.6'
               ^
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@owenlamont
Copy link
Author

Oh, apologies. For me this was running in the context of a larger repo and CI pipeline which didn't give me errors with nb-black but did after I tried migrating to uv.

Not sure if there was some other difference/logic that was handling the error there or whether it was using an older version of pip or setuptools.

I'll investigate the differences further.

@owenlamont
Copy link
Author

I'll close this issue now assuming it's not directly uv related.

@owenlamont owenlamont closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
@notatallshaw
Copy link

Yeah, I can't help with your larger pipeline without understanding it, but it seems nb_black has been broken for awhile and there has been no response from maintainers, I would suggest removing it from your dependency chain if you can:

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

No branches or pull requests

2 participants