Black fails to install on new tap or target from cookiecutter

Summary

Steps to reproduce

  • Create a new tap or target from the cookiecutter
  • Attempt to install black
  • Error occurs: black requires Python >=3.6.2, so it will not be satisfied for Python >=3.6.1,<3.6.2

What is the current bug behavior?

Resolving dependencies... (0.0s)

  SolverProblemError

  The current project's Python requirement (>=3.6.1,<3.9) is not compatible with some of the required packages Python requirement:
    - black requires Python >=3.6.2, so it will not be satisfied for Python >=3.6.1,<3.6.2
  
  Because no versions of black match >21.9b0,<22.0
   and black (21.9b0) requires Python >=3.6.2, black is forbidden.
  So, because target-yaml depends on black (^21.9b0), version solving failed.

  at ~/.local/pipx/venvs/poetry/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

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For black, a possible solution would be to set the `python` property to ">=3.6.2,<3.9"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

What is the expected correct behavior?

Installs successfully

Relevant logs and/or screenshots

Log above

Possible fixes

Bump min Python version from 3.6.1 to 3.6.2