dnanhkhoa / nb_black

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.
MIT License
367 stars 41 forks source link

Update install requirements #40

Open LauraRichter opened 1 year ago

LauraRichter commented 1 year ago

Setuptools 67.6.1 doesn't work with the way the install_requres is used in the setup.py file:

18:15 $ pip install --no-cache-dir nb_black --no-deps
Collecting nb_black
  Downloading nb_black-1.0.7.tar.gz (4.8 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info 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: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Can we please fix it? I think the fix implimented in @IsaGrue's fork here will do the trick: https://github.com/IsaGrue/nb_black

miklevin commented 1 year ago

[pyenv] ubuntu@LunderVand:~/repos $ pip install 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. [pyenv] ubuntu@LunderVand:~/repos $

julien-blanchon commented 1 year ago

This broke my install too

Burn1n9m4n commented 1 year ago

Slightly off topic, but how would I install @IsaGrue's commit into my environment until this package is updated?

Simon-Lee-UK commented 11 months ago

Slightly off topic, but how would I install @IsaGrue's commit into my environment until this package is updated?

@Burn1n9m4n please see comment from @leifdenby on this earlier issue. Looks like you could run a similar command to the following to install @IsaGrue's fork with one extra commit.

python -m pip install git+https://github.com/leifdenby/nb_black/#egg=nb_black

However, this workaround will not be suitable for everyone. Please can we get a proper fix for this soon? It's stopping people installing what is otherwise a very useful package.

augustobottelli commented 11 months ago

Sharing the link to the Pull Request I opened to fix this. Hopefully it get's reviewed and merged soon.

efab2022 commented 9 months ago

Still affected by this. does anyone know if there's a workaround? downgrading to a previous well known version?

proleu commented 7 months ago

@efab2022 downgrading to 1.0.5 seems to fix this issue during my install