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

Conflict with black@20.8b1 #200

Closed
isac322 opened this issue Sep 4, 2020 · 7 comments · Fixed by sheikhomar/cookiecutter-data-science#40
Closed

Conflict with black@20.8b1 #200

isac322 opened this issue Sep 4, 2020 · 7 comments · Fixed by sheikhomar/cookiecutter-data-science#40
Labels
bug Something isn't working released Feature/fix is released

Comments

@isac322
Copy link
Contributor

isac322 commented Sep 4, 2020

Expected Behavior

Can be install black@20.8b1 with nitpick@0.22.2

Current Behavior

[SolverProblemError]
Because no versions of nitpick match >0.22.2,<0.23.0
 and nitpick (0.22.2) depends on toml (<0.10.1), nitpick (>=0.22.2,<0.23.0) requires toml (<0.10.1).
And because black (20.8b1) depends on toml (>=0.10.1)
 and no versions of black match >20.8b1,<21.0, nitpick (>=0.22.2,<0.23.0) is incompatible with black (>=20.8b1,<21.0).
So, because buzzvil-python-styleguide depends on both black (^20.8b1) and nitpick (^0.22.2), version solving failed.

Possible Solution

Upgrade minimum version of toml

Steps to Reproduce

  1. poetry add --dev nitpick
  2. poetry add --dev black

Your Environment

  • nitpick version used: 0.22.2

  • Python version: 3.8.5

  • Operating System and version: macOS 10.15.6

  • Link to your project: local project

  • Run the following commands and paste the output:

/usr/local/bin/python3
Python 3.8.5
aiohttp==3.6.2
async-timeout==3.0.1
attrs==19.3.0
Automat==20.2.0
cffi==1.14.0
chardet==3.0.4
constantly==15.1.0
cryptography==2.9.2
deluge==2.0.3
hyperlink==19.0.0
idna==2.9
incremental==17.5.0
Mako==1.1.3
MarkupSafe==1.1.1
multidict==4.7.6
Pillow==7.2.0
protobuf==3.13.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycairo==1.19.1
pycparser==2.20
PyGObject==3.36.1
PyHamcrest==2.0.2
pyOpenSSL==19.1.0
pyxdg==0.26
rencode==1.0.6
service-identity==18.1.0
setproctitle==1.1.10
six==1.15.0
Twisted==20.3.0
yarl==1.4.2
zope.interface==5.1.0

#!/usr/local/opt/python/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys
from flake8.main.cli import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
@isac322 isac322 added the bug Something isn't working label Sep 4, 2020
@andreoliwa
Copy link
Owner

Hello @isac322, thanks for the bug report.

This bug uiri/toml#295 was fixed here: uiri/toml@9be6458, but a new toml version was not released yet.
Latest one is still 0.10.1.

To fix this, I will install uiri/toml@9be6458 directly, using Poetry.

This can lead to issues though, if you already have toml version 0.10.1 installed.
You will need to remove and reinstall it, otherwise Poetry doesn't detect the version change (at least this is what happened to me while testing locally).

@andreoliwa
Copy link
Owner

Unfortunately I cannot fix this issue.
I need to wait until a new toml version 0.10.2 is released with uiri/toml@9be6458. 😞

After a few hours banging my head against the wall, I will have to revert this change.
Using a Git commit doesn't work for package dependencies.
I can't upload a new package to PyPI, it fails with the error:

HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Invalid value for requires_dist. Error: Can't have direct dependency: 'toml @ git+https://github.com/uiri/toml.git@9be6458'

See:


As a workaround while we wait for a new toml release, you can run nitpick as a pre-commit hook instead.
This way, Nitpick will be installed in an isolated repo, and it won't affect black in your virtualenv.

You can also run black as a pre-commit hook.

These are the recommended ways to run these tools IMHO. 😉

@andreoliwa andreoliwa reopened this Sep 18, 2020
andreoliwa pushed a commit that referenced this issue Sep 18, 2020
# [0.23.0](v0.22.2...v0.23.0) (2020-09-18)

### Bug Fixes

* get uiri/toml@9be6458 to fix conflict with black@20.8b1 ([fd2a44a](fd2a44a)), closes [#200](#200)

### Features

* check if a text file contains lines ([#182](#182)) ([3173bf7](3173bf7))
* detect JSON files by extension, no need to declare them first ([6f54480](6f54480))
* use a plugin system (experimental) ([#180](#180)) ([6d2df4f](6d2df4f))
@andreoliwa
Copy link
Owner

🎉 This issue has been resolved in version 0.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@andreoliwa andreoliwa added the released Feature/fix is released label Sep 18, 2020
@gghildyal
Copy link

@andreoliwa - This issue isn't fixed. Seems like nitpick still depends on toml==0.10.0. I installed the latest version of toml==0.10.1 and then trying to install nitpick gave me the same error as above.

Using version ^0.23.0 for nitpick

Updating dependencies
Resolving dependencies... (0.4s)

  SolverProblemError

  Because no versions of nitpick match >0.23.0,<0.24.0
   and nitpick (0.23.0) depends on toml (<0.10.1), nitpick (>=0.23.0,<0.24.0) requires toml (<0.10.1).
  So, because raa-django depends on both toml (^0.10.1) and nitpick (^0.23.0), version solving failed.

  at ~/.pyenv/versions/3.8.3/envs/3.8.3-raa/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

@isac322
Copy link
Contributor Author

isac322 commented Nov 2, 2020

@andreoliwa FYI. toml 0.10.2 is released!

@andreoliwa
Copy link
Owner

@andreoliwa - This issue isn't fixed. Seems like nitpick still depends on toml==0.10.0. I installed the latest version of toml==0.10.1 and then trying to install nitpick gave me the same error as above.

@gghildyal. Yes, I thought I had it fixed, but it didn't work (I wrote something above: #200 (comment))

@andreoliwa FYI. toml 0.10.2 is released!

@isac322 Thanks for the heads-up. Cool, I will try to upgrade toml again now.

andreoliwa pushed a commit that referenced this issue Nov 2, 2020
## [0.23.1](v0.23.0...v0.23.1) (2020-11-02)

### Bug Fixes

* upgrade toml to 0.10.2 (fixes [#200](#200)) ([3331e76](3331e76))
@andreoliwa
Copy link
Owner

🎉 This issue has been resolved in version 0.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Feature/fix is released
Projects
None yet
3 participants