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

dev_tools/modules.py print_version fails with an error #5701

Closed
mhucka opened this issue Jul 8, 2022 · 1 comment
Closed

dev_tools/modules.py print_version fails with an error #5701

mhucka opened this issue Jul 8, 2022 · 1 comment
Labels
kind/bug-report Something doesn't seem to work.

Comments

@mhucka
Copy link
Contributor

mhucka commented Jul 8, 2022

Description of the issue

This report is a follow-up to a comment by @vtomole on PR #5637. The current version of dev_tools/modules.py exits with an error if given the argument print_version (which is one of arguments it is supposed to accept).

How to reproduce the issue

In a shell, with the current directory being the top level of the Cirq source code repo cloned from GitHub, run the following command:

python dev_tools/modules.py print_version
Failed to run ./setup.py:
Traceback (most recent call last):
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 317, in <module>
    main(sys.argv[1:])  # coverage: ignore
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 313, in main
    f(**vars(args))
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 216, in _print_version
    print(get_version())
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 135, in get_version
    mods = list_modules(search_dir=search_dir, include_parent=True)
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 112, in list_modules
    result = [
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 113, in <listcomp>
    Module(root=folder, raw_setup=_parse_module(search_dir / folder))
  File "/Users/mhucka/project-files/quantum/repos/Cirq/dev_tools/modules.py", line 194, in _parse_module
    exec(setup_py, globals(), {})
  File "<string>", line 22, in <module>
ModuleNotFoundError: No module named 'dev_tools'

Cirq version

0.16.0.dev

@mhucka mhucka added the kind/bug-report Something doesn't seem to work. label Jul 8, 2022
@mhucka mhucka changed the title "dev_tools/modules.py print_version" fails with an error dev_tools/modules.py print_version fails with an error Jul 8, 2022
@mhucka
Copy link
Contributor Author

mhucka commented Jul 13, 2022

This was fixed by PR #5705, which has been merged, but I didn't quite name the PR in the right way and so this issue didn't get closed automatically. Closing it manually.

@mhucka mhucka closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-report Something doesn't seem to work.
Projects
None yet
Development

No branches or pull requests

1 participant