Failing one test case

While pushing the commit to my forked bokeh repo I am facing this error:

tests\codebase\test_code_quality.py:48: AssertionError

Please can anyone help me on how to solve this error.

More details of the error below:

E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 70
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 71
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 72
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 73
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 74
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 75
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 76
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 77
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 78
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 79
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 80
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 81
E         File contains carriage returns at end of line: tests/unit/bokeh/util/test_version.py, line 82
E       assert 321334 == 0
E        +  where 321334 = len(['File contains carriage returns at end of line: .flake8, line 1', 'File contains carriage returns at end of line: .fl...rriage returns at end of line: .flake8, line 5', 'File contains carriage returns at end of line: .flake8, line 6', ...])

@Yash This is a linter error. We mandate consistent line terminators in all files in the repo. Given the large number of reported issues (every line in every file?) it seems like git did some kind of automatic windows-specific line-terminator change on checkout. At least, I think I recall there being a setting for something like that. You will need to make sure git does not “fixup” line terminators.

Thanks for the prompt response, I will look into the git line terminator settings and make sure it’s properly set.

1 Like

Sir, I used this git config --global core.autocrlf [true|false|input] command to solve the carriage return error, yet the error persists, can you please suggest a robust solution.

@Yash I’m sorry I don’t really use Windows often at all. I am afraid I don’t have any additional knowledge or advice to share.

cc @mateusz @Timo have ether of you encountered this?

Thanks for the response sir.

@Bryan Hello Sir, I tried to setup the development environment for Bokeh in ubuntu (Linux).
after running the pip install -e . command, while testing the local setup I’m facing the KeyError: '0.0.1'

More info below:

raceback (most recent call last):
  File "/home/it-313/anaconda3/envs/bkdev/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/it-313/anaconda3/envs/bkdev/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/__main__.py", line 70, in <module>
    main()
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/__main__.py", line 56, in main
    from bokeh.command.bootstrap import main as _main
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/command/bootstrap.py", line 56, in <module>
    from . import subcommands
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/command/subcommands/__init__.py", line 79, in <module>
    all = _collect()
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/command/subcommands/__init__.py", line 63, in _collect
    mod = import_module("." + modname, __package__)
  File "/home/it-313/anaconda3/envs/bkdev/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/command/subcommands/file_output.py", line 37, in <module>
    from ..util import build_single_handler_applications, die
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/command/util.py", line 32, in <module>
    from bokeh.application.handlers import (
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/application/handlers/__init__.py", line 25, in <module>
    from .code import CodeHandler
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/application/handlers/code.py", line 47, in <module>
    from ...io.doc import curdoc, patch_curdoc
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/io/__init__.py", line 24, in <module>
    from .doc import curdoc
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/io/doc.py", line 30, in <module>
    from .state import curstate
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/io/state.py", line 54, in <module>
    from ..resources import Resources, ResourcesMode
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/resources.py", line 750, in <module>
    CDN = Resources(mode="cdn")
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/resources.py", line 322, in __init__
    cdn = self._cdn_urls()
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/resources.py", line 383, in _cdn_urls
    return _get_cdn_urls(self.version, self.minified)
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/resources.py", line 709, in _get_cdn_urls
    sri_hashes = get_sri_hashes_for_version(version)
  File "/home/it-313/Documents/ROSPL project/bokeh/src/bokeh/resources.py", line 178, in get_sri_hashes_for_version
    return hashes[version]
KeyError: '0.0.1'

@Yash I’m sorry I just don’t really use or have immediate access to Windows, so I am not sure what other concrete advice I can offer, beyond makings sure you have a completely clean checkout, and latest versions of pip, setuptools, etc. installed. You might also try a non-editable install (remove the -e from the pip command). Otherwise all I can suggest is to file a GitHub Issue with full details so that someone can try to reproduce and take a closer look in the future.

If Docker is an option for you then you could also try developing under a linux docker shell.

@Timo did you ever have success building on Windows?

@Bryan Alright sir, thanks for your time!

@Yash , I am hitting the same key error

return hashes[version]
KeyError: '0.0.1'

Did you find a solution for it?

@tur-ium All I can do is refer you to my post above, with some different suggestions. There is a “sane version check” performed in CI on every build of Bokeh for at least four different install methods, so I have to believe there is something specific about your environment that is causing the issue. But you have not given us any information at all to go on, so it’s not possible to speculate.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.