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

Merge pytest-xdist latest changes + correct lint errors in nTop fork #6

Merged
merged 13 commits into from
Sep 20, 2024

Conversation

ciaconet
Copy link
Collaborator

@ciaconet ciaconet commented Sep 19, 2024

Summary

Merge latest changes to upstream and correct lint errors in fork.

Testing

python -m mypy src --ignore-missing-imports --strict

python -m ruff check

pre-commit-ci bot and others added 10 commits August 26, 2024 23:28
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.1 → v0.6.2](astral-sh/ruff-pre-commit@v0.6.1...v0.6.2)
- [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](pre-commit/mirrors-mypy@v1.11.1...v1.11.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Bumps the github-actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.6.3](astral-sh/ruff-pre-commit@v0.6.2...v0.6.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…#1127)

Bumps the github-actions group with 2 updates: [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `hynek/build-and-inspect-python-package` from 2.8 to 2.9
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](hynek/build-and-inspect-python-package@v2.8...v2.9)

Updates `pypa/gh-action-pypi-publish` from 1.10.0 to 1.10.1
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.4](astral-sh/ruff-pre-commit@v0.6.3...v0.6.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.4 → v0.6.5](astral-sh/ruff-pre-commit@v0.6.4...v0.6.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy link

@Heroico Heroico left a comment

Choose a reason for hiding this comment

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

I don't like what the linter demands but don't want to fight the upstream either.

@@ -287,7 +296,9 @@ def worker_workerfinished(self, node: WorkerController) -> None:
try:
self.prepare_for_reschedule()
except Exception as e:
self.shouldstop = f"Exception caught during preparation for rescheduling. Giving up.\n{''.join(traceback.format_exception(e))}"
msg = ("Exception caught during preparation for rescheduling. Giving up."
Copy link

Choose a reason for hiding this comment

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

😢

src/xdist/scheduler/load.py Outdated Show resolved Hide resolved
Copy link

@Heroico Heroico left a comment

Choose a reason for hiding this comment

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

Thanks, this should help communications with the upstream.

@@ -83,7 +82,7 @@ def rsync_roots(self, gateway: execnet.Gateway) -> None:
def setup_nodes(
self,
putevent: Callable[[tuple[str, dict[str, Any]]], None],
max_nodes: Optional[int] = None
max_nodes: int | None = None
Copy link

Choose a reason for hiding this comment

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

I wish we could use Optional 😢

@mlopez-ntop
Copy link

Locally I got the following. xdist is from the upstream right?

src\xdist\looponfail.py:169: error: Incompatible types in assignment (expression has type "ChannelFileWrite", variable has type "TextIO")  [assignment]
src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 3 errors in 2 files (checked 18 source files)```

@ciaconet
Copy link
Collaborator Author

Locally I got the following. xdist is from the upstream right?

src\xdist\looponfail.py:169: error: Incompatible types in assignment (expression has type "ChannelFileWrite", variable has type "TextIO")  [assignment]
src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 3 errors in 2 files (checked 18 source files)```

This is likely a mypy version difference, try with 1.11.2

@mlopez-ntop
Copy link

Locally I got the following. xdist is from the upstream right?

src\xdist\looponfail.py:169: error: Incompatible types in assignment (expression has type "ChannelFileWrite", variable has type "TextIO")  [assignment]
src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 3 errors in 2 files (checked 18 source files)```

This is likely a mypy version difference, try with 1.11.2

A bit closer with that version

src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 2 errors in 1 file (checked 18 source files)```

@ciaconet
Copy link
Collaborator Author

Locally I got the following. xdist is from the upstream right?

src\xdist\looponfail.py:169: error: Incompatible types in assignment (expression has type "ChannelFileWrite", variable has type "TextIO")  [assignment]
src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 3 errors in 2 files (checked 18 source files)```

This is likely a mypy version difference, try with 1.11.2

A bit closer with that version

src\xdist\plugin.py:34: error: Returning Any from function declared to return "int"  [no-any-return]
src\xdist\plugin.py:36: error: Module "os" has no attribute "sched_getaffinity"  [attr-defined]
Found 2 errors in 1 file (checked 18 source files)```

Those files weren't modified, I'd assume another package like os is at a different version, should be fine to ignore. Worst case we open another PR to our fork

@ciaconet ciaconet merged commit c82840f into main Sep 20, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants