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

[REQUEST] Update commitizen to support Jinja2's latest version for flaskv2. #391

Closed
rlam3 opened this issue Jun 13, 2021 · 5 comments · Fixed by #392
Closed

[REQUEST] Update commitizen to support Jinja2's latest version for flaskv2. #391

rlam3 opened this issue Jun 13, 2021 · 5 comments · Fixed by #392

Comments

@rlam3
Copy link

rlam3 commented Jun 13, 2021

Description

Steps to reproduce

  1. Install flask.
  2. Install commitizen.

Commitizen with poetry breaks dependencies because commitizen requires Jinja2 lower than v3. Flaskv2 requires us to use of Jinja2 v3.

Current behavior downgrading commitizen does not seem to be working.

❯ poetry add [email protected] --dev

Updating dependencies
Resolving dependencies... (1.8s)

  SolverProblemError

  Because commitizen (2.17.0) depends on jinja2 (>=2.10.3,<3.0.0)
   and flask (2.0.1) depends on Jinja2 (>=3.0), commitizen (2.17.0) is incompatible with flask (2.0.1).
  And because no versions of flask match >2.0.1,<3.0.0, commitizen (2.17.0) is incompatible with Flask (>=2.0.1,<3.0.0).
  So, because XXX depends on both Flask (^2.0.1) and commitizen (2.17.0), version solving failed.

  at ~/.poetry/lib/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
❯ poetry add [email protected] --dev

Updating dependencies
Resolving dependencies... (0.3s)

  SolverProblemError

  Because commitizen (2.16.0) depends on jinja2 (>=2.10.3,<3.0.0)
   and flask (2.0.1) depends on Jinja2 (>=3.0), commitizen (2.16.0) is incompatible with flask (2.0.1).
  And because no versions of flask match >2.0.1,<3.0.0, commitizen (2.16.0) is incompatible with Flask (>=2.0.1,<3.0.0).
  So, because XXX depends on both Flask (^2.0.1) and commitizen (2.16.0), version solving failed.

  at ~/.poetry/lib/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
❯ poetry add [email protected] --dev

Updating dependencies
Resolving dependencies... (0.9s)

  SolverProblemError

  Because commitizen (2.15.0) depends on jinja2 (>=2.10.3,<3.0.0)
   and flask (2.0.1) depends on Jinja2 (>=3.0), commitizen (2.15.0) is incompatible with flask (2.0.1).
  And because no versions of flask match >2.0.1,<3.0.0, commitizen (2.15.0) is incompatible with Flask (>=2.0.1,<3.0.0).
  So, because XXX depends on both Flask (^2.0.1) and commitizen (2.15.0), version solving failed.

  at ~/.poetry/lib/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
❯ poetry add [email protected] --dev

Updating dependencies
Resolving dependencies... (0.4s)

  SolverProblemError

  Because commitizen (2.10.0) depends on jinja2 (>=2.10.3,<3.0.0)
   and flask (2.0.1) depends on Jinja2 (>=3.0), commitizen (2.10.0) is incompatible with flask (2.0.1).
  And because no versions of flask match >2.0.1,<3.0.0, commitizen (2.10.0) is incompatible with Flask (>=2.0.1,<3.0.0).
  So, because XXX depends on both Flask (^2.0.1) and commitizen (2.10.0), version solving failed.

  at ~/.poetry/lib/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
❯ poetry add [email protected] --dev

Updating dependencies
Resolving dependencies... (0.5s)

  SolverProblemError

  Because commitizen (2.0.0) depends on jinja2 (>=2.10.3,<3.0.0)
   and flask (2.0.1) depends on Jinja2 (>=3.0), commitizen (2.0.0) is incompatible with flask (2.0.1).
  And because no versions of flask match >2.0.1,<3.0.0, commitizen (2.0.0) is incompatible with Flask (>=2.0.1,<3.0.0).
  So, because XXX depends on both Flask (^2.0.1) and commitizen (2.0), version solving failed.

  at ~/.poetry/lib/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

Desired behavior

We should be able to use commitizen with any version of flask or jinja2.

Environment

Currently, the only workaround is to remove flask and install commitizen before installing flask.
This would result in use up using flask v1.1.4 instead of v2.0.1.

  • commitizen version:
    ❯ cz version
    2.17.9
  • python version:
    ❯ python -V
    Python 3.9.4
  • operating system:
    ❯ python3 -c "import platform; print(platform.system())"
    Darwin
@Lee-W
Copy link
Member

Lee-W commented Jun 19, 2021

Hi @rlam3 , I'm good with relaxing the version constraint as long as it does not break anything. Feel free to send us a PR 🙂

@moon-bits
Copy link

This is indeed a problem as we now need to decide between jinja2 (v3) vs. commitizen. And of course functionality goes before developer experience. So we have to drop commitizen for now.

woile added a commit that referenced this issue Jun 21, 2021
@woile
Copy link
Member

woile commented Jun 21, 2021

Please check the PR if possible

@woile
Copy link
Member

woile commented Jun 22, 2021

Please try v2.17.10 which will be published in a few seconds, and let us know.

Feel free to re-open the issue.

Thanks!

@rlam3
Copy link
Author

rlam3 commented Jun 25, 2021

Yes this works now.

@woile Thank you!

Seems like I had to do the following to get it installed correctly in poetry.

poetry remove commitizen
poetry add commitizen --dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants