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

Small housekeeping in check/pytest #5899

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

pavoljuhas
Copy link
Collaborator

@pavoljuhas pavoljuhas commented Oct 1, 2022

  • Clean up special-casing for Python 3.6 as we require Python 3.7.

  • Simplify handling of the parallel job count -n COUNT option in check/pytest.
    Obey the -n0 option on the command line in addition to -n 0 to
    request non-parallel testing.

Per install.md we require Python 3.7.
Run pytest with `-n=auto` by default.
Append optional `-n N` on command line to override.
check/pytest now obeys `-n0` as well as `-n 0`.
@pavoljuhas pavoljuhas requested review from a team, vtomole and cduck as code owners October 1, 2022 00:48
@CirqBot CirqBot added the size: S 10< lines changed <50 label Oct 1, 2022
@pavoljuhas
Copy link
Collaborator Author

@vtomole - can you PTAL?

vtomole
vtomole previously approved these changes Oct 6, 2022
Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do i call this correctly?

(cirq_venv) vtomole@vtomole:~/Cirq$ ./check/pytest -n0
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: -n0 -n=auto
  inifile: /home/vtomole/Cirq/pyproject.toml
  rootdir: /home/vtomole/Cirq

@vtomole vtomole dismissed their stale review October 6, 2022 22:44

Need one clarification before approval.

@pavoljuhas
Copy link
Collaborator Author

(cirq_venv) vtomole@vtomole:~/Cirq$ ./check/pytest -n0
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: -n0 -n=auto

The -n N, --numprocesses=N option comes from the pytest-xdist plugin.

Please try again after pip install -r dev_tools/requirements/deps/pytest.txt

Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works 👍

@pavoljuhas pavoljuhas added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Oct 6, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Oct 6, 2022
@CirqBot CirqBot merged commit 0196738 into quantumlib:master Oct 6, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Oct 6, 2022
@pavoljuhas pavoljuhas deleted the simplify-check-pytest branch October 7, 2022 00:14
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
- Clean up special-casing for Python 3.6 as we require Python 3.7.

- Simplify handling of the parallel job count `-n COUNT` option in check/pytest.
  Obey the `-n0` option on the command line in addition to `-n 0` to
  request non-parallel testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants