-
-
Notifications
You must be signed in to change notification settings - Fork 163
Implement the wrap function with the asyncio.to_thread underneath.
#213
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
Open
stankudrow
wants to merge
26
commits into
Tinche:main
Choose a base branch
from
stankudrow:replace-custom-wrap-with-asyncio-to_thread
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4312783
rebase after the PR #219
7435086
update the #213 record in the CHANGELOG
deada0d
remove the 'run_prefix' from the Justfile
a990114
add pytest addopts in the pyproject.toml
59fc35a
remove opts from the Justfile test rule
a1658b3
update the #213 record
f1e84c7
update the #213 record - ok now
540d880
add .python-version with Python 3.9(.21)
ca6d995
update Justfile rules
3286249
specify test dir for pytest
4b96a9b
update the #213 record
a97b462
implement wrap with asyncio.to_thread
d9294a1
mypy tests
0c1110e
mypy only the source code
d42a453
specify src_dir for mypy
e17cf03
combine format and lint rules under the lint recipe
d0f5e87
remove .python-version
a2f9518
add just default rule and recipe doc comments
4c7de0e
prefixate commands with (uv) {{ run }} if no VIRTUAL_ENV envvar is set
1879a46
add RUF specific-rules
b2fffdc
sort imports in __all__ with RUF022
2139817
glue the 'uv run' prefix to the start of commands
5e223d8
rename lint to check for tox and CI
7d72e9e
fix dependency-groups -> back to 'lint'
31aead8
update and sort aiofiles utils in the README.md
6517a10
modify the #213 changelog record
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,37 @@ | ||
| src_dir := "src" | ||
| tests_dir := "tests" | ||
| code_dirs := "src" + " " + tests_dir | ||
| run_prefix := if env_var_or_default("VIRTUAL_ENV", "") == "" { "uv run " } else { "" } | ||
| code_dirs := src_dir + " " + tests_dir | ||
|
|
||
| # https://just.systems/man/en/functions.html#environment-variables | ||
| run := if env("VIRTUAL_ENV", "") == "" { "uv run " } else { "" } | ||
|
|
||
| # list available rules | ||
| default: | ||
| just --list | ||
|
|
||
| # build the project | ||
| build: | ||
| uv build | ||
|
|
||
| # install dependencies | ||
| sync: | ||
| uv sync --group lint --group test --group tox | ||
|
|
||
| # check the code | ||
| check: | ||
| {{ run_prefix }}ruff format --check {{ code_dirs }} | ||
| {{ run_prefix }}ruff check {{ code_dirs }} | ||
| {{ run }}ruff format --check {{ code_dirs }} | ||
| {{ run }}ruff check {{ code_dirs }} | ||
| {{ run }}mypy {{ src_dir }} # lint only the source code | ||
stankudrow marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # run coverage | ||
| coverage: | ||
| {{ run_prefix }}coverage run -m pytest {{ tests_dir }} | ||
|
|
||
| format: | ||
| {{ run_prefix }}ruff format {{ code_dirs }} | ||
| {{ run }}coverage run -m pytest {{ tests_dir }} | ||
|
|
||
| lint: format | ||
| {{ run_prefix }}ruff check --fix {{ code_dirs }} | ||
| # lint the code (including formatting) | ||
| lint *files=".": | ||
| {{ run }}ruff format {{ files }} | ||
| {{ run }}ruff check --fix {{ files }} | ||
|
|
||
| test: | ||
| {{ run_prefix }}pytest -x --ff {{ tests_dir }} | ||
| # run the tests | ||
| test *args: | ||
| {{ run }}pytest {{ args }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.