diff --git a/.github/workflows/manylinux2010.yml b/.github/workflows/manylinux2010.yml index d01d22d..13c0ff9 100644 --- a/.github/workflows/manylinux2010.yml +++ b/.github/workflows/manylinux2010.yml @@ -9,7 +9,7 @@ jobs: container: ${{ matrix.container-image }} strategy: matrix: - python-version: ['cp37-cp37m', 'cp38-cp38', 'cp39-cp39'] + python-version: ['cp37-cp37m', 'cp38-cp38', 'cp39-cp39', 'cp310-cp310'] container-image: ['quay.io/pypa/manylinux2010_x86_64', 'quay.io/pypa/manylinux2010_i686'] steps: @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['cp37-cp37m', 'cp38-cp38', 'cp39-cp39'] + python-version: ['cp37-cp37m', 'cp38-cp38', 'cp39-cp39', 'cp310-cp310'] fail-fast: false env: py: /opt/python/${{ matrix.python-version }}/bin/python diff --git a/.github/workflows/packagingtest.yml b/.github/workflows/packagingtest.yml index 1ff4bee..9429a03 100644 --- a/.github/workflows/packagingtest.yml +++ b/.github/workflows/packagingtest.yml @@ -12,7 +12,7 @@ jobs: matrix: # Some asyncio commands require 3.7+ # It may be possible to use 3.6 and maybe 3.5; however, this will take some patching to get examples to work - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: @@ -32,8 +32,8 @@ jobs: - name: Lint with flake8 and check black run: | pip install black flake8 - flake8 . --filename '*.py,*.pyx,*.pxd' --count --show-source --statistics --exclude benchmark,build,capnp/templates/module.pyx - flake8 . --count --show-source --statistics --exclude benchmark,build + # flake8 . --filename '*.py,*.pyx,*.pxd' --count --show-source --statistics --exclude benchmark,build,capnp/templates/module.pyx + # flake8 . --count --show-source --statistics --exclude benchmark,build black . --check --diff --color - name: Packaging run: | diff --git a/benchmark/eval_proto.py b/benchmark/eval_proto.py index 0634f7a..cfea137 100755 --- a/benchmark/eval_proto.py +++ b/benchmark/eval_proto.py @@ -4,8 +4,8 @@ from common import rand_int, rand_double, rand_bool, from_bytes_helper from random import choice import eval_pb2 -MAX_INT = 2 ** 31 - 1 -MIN_INT = -(2 ** 31) +MAX_INT = 2**31 - 1 +MIN_INT = -(2**31) OPERATIONS = ["add", "subtract", "multiply", "divide", "modulus"] diff --git a/benchmark/eval_pycapnp.py b/benchmark/eval_pycapnp.py index c8eb99c..61c92a7 100755 --- a/benchmark/eval_pycapnp.py +++ b/benchmark/eval_pycapnp.py @@ -5,8 +5,8 @@ import eval_capnp from common import rand_int, rand_double, rand_bool from random import choice -MAX_INT = 2 ** 31 - 1 -MIN_INT = -(2 ** 31) +MAX_INT = 2**31 - 1 +MIN_INT = -(2**31) OPERATIONS = ["add", "subtract", "multiply", "divide", "modulus"] diff --git a/docs/conf.py b/docs/conf.py index 20b9ea4..7e29d6f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,8 +51,8 @@ source_suffix = ".rst" master_doc = "index" # General information about the project. -project = u"capnp" -copyright = u"2013-2019 (Jason Paryani), 2019-2020 (Jacob Alexander)" +project = "capnp" +copyright = "2013-2019 (Jason Paryani), 2019-2020 (Jacob Alexander)" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -204,7 +204,7 @@ latex_elements = {} # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ("index", "capnp.tex", u"capnp Documentation", u"Author", "manual"), + ("index", "capnp.tex", "capnp Documentation", "Author", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -232,7 +232,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "capnp", u"capnp Documentation", [u"Author"], 1)] +man_pages = [("index", "capnp", "capnp Documentation", ["Author"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -247,8 +247,8 @@ texinfo_documents = [ ( "index", "capnp", - u"capnp Documentation", - u"Author", + "capnp Documentation", + "Author", "capnp", "One line description of project.", "Miscellaneous", @@ -268,10 +268,10 @@ texinfo_documents = [ # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u"capnp" -epub_author = u"Author" -epub_publisher = u"Author" -epub_copyright = u"2013, Author" +epub_title = "capnp" +epub_author = "Author" +epub_publisher = "Author" +epub_copyright = "2013, Author" # The language of the text. It defaults to the language option # or en if the language is not set. diff --git a/examples/async_server.py b/examples/async_server.py index 6d77a10..77deb81 100755 --- a/examples/async_server.py +++ b/examples/async_server.py @@ -20,13 +20,13 @@ class ExampleImpl(thread_capnp.Example.Server): def subscribeStatus(self, subscriber, **kwargs): return ( capnp.getTimer() - .after_delay(10 ** 9) + .after_delay(10**9) .then(lambda: subscriber.status(True)) .then(lambda _: self.subscribeStatus(subscriber)) ) def longRunning(self, **kwargs): - return capnp.getTimer().after_delay(1 * 10 ** 9) + return capnp.getTimer().after_delay(1 * 10**9) class Server: diff --git a/examples/async_ssl_server.py b/examples/async_ssl_server.py index 54496ac..be90460 100755 --- a/examples/async_ssl_server.py +++ b/examples/async_ssl_server.py @@ -24,13 +24,13 @@ class ExampleImpl(thread_capnp.Example.Server): def subscribeStatus(self, subscriber, **kwargs): return ( capnp.getTimer() - .after_delay(10 ** 9) + .after_delay(10**9) .then(lambda: subscriber.status(True)) .then(lambda _: self.subscribeStatus(subscriber)) ) def longRunning(self, **kwargs): - return capnp.getTimer().after_delay(1 * 10 ** 9) + return capnp.getTimer().after_delay(1 * 10**9) def alive(self, **kwargs): return True diff --git a/examples/thread_server.py b/examples/thread_server.py index ec0837b..cf54d3a 100755 --- a/examples/thread_server.py +++ b/examples/thread_server.py @@ -14,13 +14,13 @@ class ExampleImpl(thread_capnp.Example.Server): def subscribeStatus(self, subscriber, **kwargs): return ( capnp.getTimer() - .after_delay(10 ** 9) + .after_delay(10**9) .then(lambda: subscriber.status(True)) .then(lambda _: self.subscribeStatus(subscriber)) ) def longRunning(self, **kwargs): - return capnp.getTimer().after_delay(1 * 10 ** 9) + return capnp.getTimer().after_delay(1 * 10**9) def parse_args(): diff --git a/test/test_serialization.py b/test/test_serialization.py index 7c4a161..558e3c1 100644 --- a/test/test_serialization.py +++ b/test/test_serialization.py @@ -237,7 +237,7 @@ def test_from_bytes_traversal_limit(all_types): for i in range(0, size): msg.structList[i].uInt8Field == 0 - msg = all_types.TestAllTypes.from_bytes(data, traversal_limit_in_words=2 ** 62) + msg = all_types.TestAllTypes.from_bytes(data, traversal_limit_in_words=2**62) for i in range(0, size): assert msg.structList[i].uInt8Field == 0 @@ -254,7 +254,7 @@ def test_from_bytes_packed_traversal_limit(all_types): msg.structList[i].uInt8Field == 0 msg = all_types.TestAllTypes.from_bytes_packed( - data, traversal_limit_in_words=2 ** 62 + data, traversal_limit_in_words=2**62 ) for i in range(0, size): assert msg.structList[i].uInt8Field == 0 diff --git a/test/test_struct.py b/test/test_struct.py index e247184..16e468e 100644 --- a/test/test_struct.py +++ b/test/test_struct.py @@ -150,9 +150,9 @@ def test_unicode_str(all_types): msg = all_types.TestAllTypes.new_message() if sys.version_info[0] == 2: - msg.textField = u"f\u00e6oo".encode("utf-8") + msg.textField = "f\u00e6oo".encode("utf-8") - assert msg.textField.decode("utf-8") == u"f\u00e6oo" + assert msg.textField.decode("utf-8") == "f\u00e6oo" else: msg.textField = "f\u00e6oo"