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

Root cause failure using conda env export #32

Open
benslack19 opened this issue Feb 24, 2021 · 2 comments
Open

Root cause failure using conda env export #32

benslack19 opened this issue Feb 24, 2021 · 2 comments

Comments

@benslack19
Copy link

This was discovered while doing conda env export. It seems to fail when nb_black is installed as described in this string but a solution was discovered. Is it possible you can do this simple fix in the next update?

Manually editing the dependencies for nb_black from

Requires-Dist: yapf (>='0.28') ; python_version < "3.6"
Requires-Dist: black (>='19.3') ; python_version >= "3.6"

to

Requires-Dist: yapf (>=0.28) ; python_version < "3.6"
Requires-Dist: black (>=19.3) ; python_version >= "3.6"

in /Users/[USERNAME]/opt/anaconda3/envs/[ENVNAME]/lib/python3.6/site-packages/nb_black-1.0.7.dist-info/ resolves the issue as a work-around.

The relevant text was found in the METADATA file in this folder.

@adriantre
Copy link

Poetry also gives this warning:

Resolving dependencies... (31.2s)<debug>PackageInfo:</debug> Invalid constraint (yapf>='0.28' ; python_version < "3.6") found in nb-black-1.0.7 dependencies, skipping
<debug>PackageInfo:</debug> Invalid constraint (black>='19.3' ; python_version >= "3.6") found in nb-black-1.0.7 dependencies, skipping

@john-sandall
Copy link

john-sandall commented Feb 2, 2022

This is fixed on master, so using one of the following will resolve the Poetry warning for you.

# Poetry CLI
poetry add 'git+https://github.com/dnanhkhoa/nb_black.git@be0c810503867abc4a5e9d05ba75a16fce57dfee'

# Poetry pyproject.toml
nb-black = {git = "https://github.com/dnanhkhoa/nb_black.git", rev = "be0c810503867abc4a5e9d05ba75a16fce57dfee"}

# pip
pip install 'git+https://github.com/dnanhkhoa/nb_black.git@be0c810503867abc4a5e9d05ba75a16fce57dfee'

Context

This is happening because the PyPI released version of nb-black is using single quotes in the dependency specification in install_requires which is technically invalid but allowed by pip, whilst Poetry sticks strictly to the PEP 508 spec here: https://www.python.org/dev/peps/pep-0508/#complete-grammar

This is a very similar issue to this: Python-Markdown/markdown#1197 (also discussed here python-poetry/poetry#4777).

This was fixed in the nb-black master branch a while back. It would be good to see a new nb-black release to PyPI soon with this fix!

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

3 participants