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

Use Ruff for linting #289

Merged
merged 10 commits into from
Dec 2, 2024
Merged

Use Ruff for linting #289

merged 10 commits into from
Dec 2, 2024

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Nov 27, 2024

The ruff pre-commit configs are mainly get from aiida-core.
For the linter complain in tests, I simply add # noqa to silent those.

  • rename test folder to tests

@unkcpz unkcpz marked this pull request as draft November 27, 2024 14:50
@unkcpz unkcpz marked this pull request as ready for review November 27, 2024 15:12
@unkcpz unkcpz marked this pull request as draft November 27, 2024 15:16
@unkcpz unkcpz marked this pull request as ready for review November 27, 2024 17:48
@unkcpz unkcpz requested a review from sphuber November 27, 2024 17:48
pyproject.toml Outdated Show resolved Hide resolved
Comment on lines +596 to +597
# XXX: can return a reference and gracefully use task to cancel itself when the upper call stack fails
asyncio.ensure_future(proc.step_until_terminated()) # noqa: RUF006
Copy link
Member Author

Choose a reason for hiding this comment

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

The linter complain is the reference to the coroutine is not returned. I think the standard way is to use the task to do graceful shutdown.
I'll further investigate on it, what I think is the returned reference to the task returned to the function where it is called (ProcessLauncher) and before this task get run it can be cancelled without other exception from the event loop.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if you think it is better to not put dev notes in the src code. @agoscinski

test/test_expose.py Show resolved Hide resolved
@unkcpz
Copy link
Member Author

unkcpz commented Dec 1, 2024

I move the fix for passing 3.12 tests to #292 so this PR only contains the changes recommended from ruff. It is ready to be review.

Copy link
Collaborator

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @unkcpz

@sphuber sphuber merged commit 55e05e9 into aiidateam:master Dec 2, 2024
7 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.

2 participants