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

blacken-docs missing python failure #1565

Closed
ARashitov opened this issue May 23, 2022 · 3 comments · Fixed by #1602
Closed

blacken-docs missing python failure #1565

ARashitov opened this issue May 23, 2022 · 3 comments · Fixed by #1602
Labels
Component: DevSetup Issue/PR that addresses technical setup of the project repository Issue: Bug Report 🐞 Bug that needs to be fixed

Comments

@ARashitov
Copy link

Description

blacken-docs refers to cached pre-commit environment that does't exists

Context

I wanted to create pull request with feature for further discussion, but failing at pre-commit check

Steps to Reproduce

  1. created environment: conda create -n kedro python=3.10 -y
  2. installed requirements: make install-test-requirements
  3. installed pre-commit hooks: make install-pre-commit
  4. executed pre-commit hook: make lint

Expected Result

Successful pass or blacken-docs internal exception

Actual Result

blacken-docs.............................................................Failed
- hook id: blacken-docs
- exit code: 1

Executable `/home/atmosphere/.cache/pre-commit/repoiq31kknf/py_env-python3/bin/python` not found
(kedro) ➜  kedro git:(parametrized-session-id) ✗ blacken-docs --skip-errors
Traceback (most recent call last):
  File "/home/atmosphere/miniconda3/envs/kedro/bin/blacken-docs", line 8, in <module>
    sys.exit(main())
  File "/home/atmosphere/miniconda3/envs/kedro/lib/python3.10/site-packages/blacken_docs.py", line 203, in main
    black_mode = black.FileMode(
  File "<string>", line 3, in __init__
TypeError: set object expected; got list

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • Kedro version used (pip show kedro or kedro -V): under main branch by 23.05.2022
  • Python version used (python -V): Python 3.10.4
  • Operating system and version: Ubuntu 20.04.3 LTS
@noklam
Copy link
Contributor

noklam commented May 23, 2022

Seems to relate to black itself. See GH issue here: adamchainz/blacken-docs#141

@noklam noklam added the Issue: Bug Report 🐞 Bug that needs to be fixed label May 23, 2022
@antonymilne
Copy link
Contributor

This looks like it's fixed in more recent versions of blacken-docs.

rev: v1.9.2

we should change this to the latest, v1.12.1. Always we should bump the version of black we're using there to black~=22.0.

With that said, I wouldn't worry too much about getting all the pre-commit checks to pass if you just want to raise a PR for discussion. You can still push with --no-verify to disable the checks. There's no need to get all the pre-commit stuff working first 🙂

@antonymilne antonymilne added the Component: DevSetup Issue/PR that addresses technical setup of the project repository label May 23, 2022
ARashitov added a commit to ARashitov/kedro that referenced this issue May 24, 2022
@ARashitov ARashitov mentioned this issue May 24, 2022
8 tasks
@ARashitov
Copy link
Author

@AntonyMilneQB Thank you, proposed version v1.12.1 works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: DevSetup Issue/PR that addresses technical setup of the project repository Issue: Bug Report 🐞 Bug that needs to be fixed
Projects
None yet
3 participants