File tree Expand file tree Collapse file tree 13 files changed +40
-49
lines changed
Expand file tree Collapse file tree 13 files changed +40
-49
lines changed Original file line number Diff line number Diff line change 4040 matrix :
4141 env :
4242 - build
43- - format
4443 - generate-integration-files
4544 - lint
4645 - type
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "recommendations" : [
3+ " charliermarsh.ruff" ,
4+ " esbenp.prettier-vscode" ,
5+ " ms-python.python"
6+ ]
7+ }
Original file line number Diff line number Diff line change 55 ".eggs" : true ,
66 "**/*.egg-info" : true ,
77 ".coverage" : true ,
8+ ".mypy_cache" : true ,
89 ".pytest_cache" : true ,
10+ ".ruff_cache" : true ,
911 ".tox" : true
1012 },
1113 "editor.detectIndentation" : false ,
2325 "editor.wordWrapColumn" : 88
2426 },
2527 "[python]" : {
28+ "editor.defaultFormatter" : " charliermarsh.ruff" ,
2629 "editor.codeActionsOnSave" : {
27- "source.organizeImports" : true
30+ "source.organizeImports" : " explicit "
2831 }
2932 },
3033 "[yaml]" : {
3134 "editor.defaultFormatter" : " esbenp.prettier-vscode" ,
3235 "editor.tabSize" : 2
3336 },
3437 "python.envFile" : " ${workspaceFolder}/.vscode/env" ,
35- "python.formatting.provider" : " black" ,
3638 "python.linting.pylintEnabled" : true ,
37- "python.testing.pytestEnabled" : true ,
38- "python.sortImports.args" : [" -sp .isort.cfg" ]
39+ "python.testing.pytestEnabled" : true
3940}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ adheres to [Semantic Versioning](https://semver.org/).
2020- Update GitHub actions dependencies
2121- Add tests for PyPy 3.10 and 3.11
2222- Improve tox & CI pipelines
23+ - Use ruff as formatter
2324
2425## [ 0.5.0] - 2023-02-27
2526
Original file line number Diff line number Diff line change 44# build
55build==1.3.0
66
7- # format
8- black==23.1.0
9- isort==5.12.0
10-
117# lint
128pylint==2.16.2
9+ ruff==0.13.1
1310
1411# typing
1512mypy==1.0.1
Original file line number Diff line number Diff line change 1+ #
2+ # ruff
3+ #
4+
5+ [tool .ruff ]
6+ src = [" src" ]
7+ target-version = " py39"
Original file line number Diff line number Diff line change @@ -79,8 +79,7 @@ def xz_open(
7979 encoding : Optional [str ] = None ,
8080 errors : Optional [str ] = None ,
8181 newline : Optional [str ] = None ,
82- ) -> XZFile :
83- ... # pragma: no cover
82+ ) -> XZFile : ... # pragma: no cover
8483
8584
8685@overload
@@ -97,8 +96,7 @@ def xz_open(
9796 encoding : Optional [str ] = None ,
9897 errors : Optional [str ] = None ,
9998 newline : Optional [str ] = None ,
100- ) -> _XZFileText :
101- ... # pragma: no cover
99+ ) -> _XZFileText : ... # pragma: no cover
102100
103101
104102@overload
@@ -115,8 +113,7 @@ def xz_open(
115113 encoding : Optional [str ] = None ,
116114 errors : Optional [str ] = None ,
117115 newline : Optional [str ] = None ,
118- ) -> Union [XZFile , _XZFileText ]:
119- ... # pragma: no cover
116+ ) -> Union [XZFile , _XZFileText ]: ... # pragma: no cover
120117
121118
122119def xz_open (
Original file line number Diff line number Diff line change 2424
2525
2626class _BlockReadStrategyType (Protocol ):
27- def on_create (self , block : "XZBlock" ) -> None :
28- ... # pragma: no cover
27+ def on_create (self , block : "XZBlock" ) -> None : ... # pragma: no cover
2928
30- def on_delete (self , block : "XZBlock" ) -> None :
31- ... # pragma: no cover
29+ def on_delete (self , block : "XZBlock" ) -> None : ... # pragma: no cover
3230
33- def on_read (self , block : "XZBlock" ) -> None :
34- ... # pragma: no cover
31+ def on_read (self , block : "XZBlock" ) -> None : ... # pragma: no cover
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ def test_read_linear(
6767 while xz_file .read (DEFAULT_BUFFER_SIZE ):
6868 assert (
6969 # should not use much more memory, take 2 as error margin
70- ram_usage ()
71- < one_block_memory * 2
70+ ram_usage () < one_block_memory * 2
7271 ), f"Consumes too much RAM (at { 100 * xz_file .tell () / len (xz_file ):.0f} %)"
7372
7473
@@ -89,9 +88,10 @@ def test_partial_read_each_block(
8988 else :
9089 assert (
9190 # default strategy is max 8 blocks, take 10 as error margin
92- ram_usage ()
93- < one_block_memory * 10
94- ), f"Consumes too much RAM (at { 100 * xz_file .tell () / len (xz_file ):.0f} %)"
91+ ram_usage () < one_block_memory * 10
92+ ), (
93+ f"Consumes too much RAM (at { 100 * xz_file .tell () / len (xz_file ):.0f} %)"
94+ )
9595
9696
9797def test_write (
@@ -115,6 +115,5 @@ def test_write(
115115 else :
116116 assert (
117117 # should not use much more memory, take 2 as error margin
118- ram_usage ()
119- < one_block_memory * 2
118+ ram_usage () < one_block_memory * 2
120119 ), f"Consumes too much RAM (at { i / nb_blocks :.0f} %)"
You can’t perform that action at this time.
0 commit comments