Skip to content

Commit 08d6362

Browse files
partheaohmayr
authored andcommitted
chore: run nox -s format
1 parent 41929dd commit 08d6362

7 files changed

Lines changed: 24 additions & 17 deletions

File tree

packages/google-crc32c/noxfile.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import nox
2323

24-
2524
HERE = os.path.dirname(__file__)
2625

2726
# Constants
@@ -50,6 +49,7 @@
5049
"docfx",
5150
]
5251

52+
5353
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
5454
def build_libcrc32c(session):
5555
session.env["PY_BIN"] = f"python{session.python}"
@@ -157,20 +157,20 @@ def core_deps_from_source(session):
157157
# Add core deps from source tests
158158
session.skip("Core deps from source tests are not yet supported")
159159

160+
160161
@nox.session(python=ALL_PYTHON)
161162
def unit(session):
162-
"""Run all unit tests.
163-
"""
163+
"""Run all unit tests."""
164164
session.skip("Unit tests are not supported")
165165

166+
166167
@nox.session(python=DEFAULT_PYTHON_VERSION)
167168
def docs(session):
168-
"""Run all docs tests.
169-
"""
169+
"""Run all docs tests."""
170170
session.skip("Docs tests are not supported")
171171

172+
172173
@nox.session(python=DEFAULT_PYTHON_VERSION)
173174
def docfx(session):
174-
"""Run all docfx tests.
175-
"""
176-
session.skip("Docfx tests are not supported")
175+
"""Run all docfx tests."""
176+
session.skip("Docfx tests are not supported")

packages/google-crc32c/setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import os
1717
import platform
1818
import shutil
19+
1920
import setuptools
2021
import setuptools.command.build_ext
2122

@@ -65,7 +66,7 @@ def build_c_extension():
6566
if install_prefix is not None:
6667
install_prefix = os.path.normcase(install_prefix)
6768
print(f"#### using local install of 'crc32c': {install_prefix!r}")
68-
#assert os.path.isdir(install_prefix)
69+
# assert os.path.isdir(install_prefix)
6970
install_prefix = os.path.realpath(install_prefix)
7071
include_dirs = [os.path.join(install_prefix, "include")]
7172
library_dirs = [os.path.join(install_prefix, "lib")]
@@ -91,22 +92,21 @@ def build_c_extension():
9192
kwargs = {}
9293

9394
module_path = os.path.join("src", "google_crc32c", "_crc32c.c")
94-
sources=[os.path.normcase(module_path)]
95+
sources = [os.path.normcase(module_path)]
9596
print(f"##### sources: {sources}")
9697
print(f"##### module kwargs: {kwargs}")
9798
module = setuptools.Extension(
98-
"google_crc32c._crc32c",
99-
sources=sources,
100-
libraries=["crc32c"],
101-
**kwargs
99+
"google_crc32c._crc32c", sources=sources, libraries=["crc32c"], **kwargs
102100
)
103101

104102
setuptools.setup(
105103
packages=["google_crc32c"],
106104
package_dir={"": "src"},
107105
ext_modules=[module],
108106
cmdclass={"build_ext": BuildExtWithDLL},
109-
install_requires=["importlib_resources>=1.3 ; python_version < '3.9' and os_name == 'nt'"],
107+
install_requires=[
108+
"importlib_resources>=1.3 ; python_version < '3.9' and os_name == 'nt'"
109+
],
110110
)
111111

112112

packages/google-crc32c/src/google_crc32c/__config__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ def modify_path():
3535
except ImportError:
3636
pass
3737

38+
3839
modify_path()

packages/google-crc32c/src/google_crc32c/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
import warnings
1616

1717
_SLOW_CRC32C_WARNING = (
18-
"As the c extension couldn't be imported, `google-crc32c` is using a "
18+
"As the c extension couldn't be imported, `google-crc32c` is using a "
1919
"pure python implementation that is significantly slower. If possible, "
2020
"please configure a c build environment and compile the extension"
2121
)
2222

2323
# Default to C exstension Implementation, falling back to pure python.
2424
try:
2525
from google_crc32c import cext as impl
26+
2627
implementation = "c"
2728
except ImportError as exc:
2829
from google_crc32c import python as impl # type: ignore
30+
2931
warnings.warn(_SLOW_CRC32C_WARNING, RuntimeWarning)
3032
implementation = "python"
3133

packages/google-crc32c/src/google_crc32c/_checksum.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class CommonChecksum(object):
2424
initial_value (Optional[bytes]): the initial chunk of data from
2525
which the CRC32C checksum is computed. Defaults to b''.
2626
"""
27+
2728
__slots__ = ()
2829

2930
def __init__(self, initial_value=b""):

packages/google-crc32c/src/google_crc32c/cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
# NOTE: ``__config__`` **must** be the first import because it (may)
1818
# modify the search path used to locate shared libraries.
1919
import google_crc32c.__config__ # type: ignore
20+
from google_crc32c._checksum import CommonChecksum
2021
from google_crc32c._crc32c import extend # type: ignore
2122
from google_crc32c._crc32c import value # type: ignore
22-
from google_crc32c._checksum import CommonChecksum
2323

2424

2525
class Checksum(CommonChecksum):

packages/google-crc32c/tests/test___init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,16 @@ def pytest_generate_tests(metafunc):
198198
if "_crc32c" in metafunc.fixturenames:
199199
metafunc.parametrize("_crc32c", ["python", "cext"], indirect=True)
200200

201+
201202
@pytest.fixture
202203
def _crc32c(request):
203204
if request.param == "python":
204205
from google_crc32c import python
206+
205207
return python
206208
elif request.param == "cext":
207209
from google_crc32c import cext
210+
208211
return cext
209212
else:
210213
raise ValueError("invalid internal test config")

0 commit comments

Comments
 (0)