You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2021/10/27 09:37:14 UTC

[buildstream] branch juerg/mypy updated (4fe08f9 -> 19177aa)

This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a change to branch juerg/mypy
in repository https://gitbox.apache.org/repos/asf/buildstream.git.


 discard 4fe08f9  Update mypy to 0.910
     new 19177aa  Update mypy to 0.910

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (4fe08f9)
            \
             N -- N -- N   refs/heads/juerg/mypy (19177aa)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

[buildstream] 01/01: Update mypy to 0.910

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/mypy
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 19177aa6eb864684d7162c386fda81ef3db571d7
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Wed Oct 27 09:18:25 2021 +0200

    Update mypy to 0.910
    
    mypy 0.730 is not compatible with Python 3.9, resulting in the following
    bogus error message:
    
        src/buildstream/_cas/cascache.py:417: error: syntax error in type comment
---
 src/buildstream/plugin.py                    | 4 ++--
 src/buildstream/plugins/sources/tar.py       | 3 ++-
 src/buildstream/plugins/sources/workspace.py | 6 +++---
 tox.ini                                      | 6 +++++-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index 6a8b221..f8ffd1e 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -213,7 +213,7 @@ class Plugin:
         which are included in the buildstream namespace.
     """
 
-    BST_MIN_VERSION = None
+    BST_MIN_VERSION: Optional[str] = None
     """The minimum required version of BuildStream required by this plugin.
 
     The version must be expressed as the string *"<major>.<minor>"*, where the
@@ -278,7 +278,7 @@ class Plugin:
     __TABLE = WeakValueDictionary()  # type: WeakValueDictionary[int, Plugin]
 
     try:
-        __multiprocessing_context = multiprocessing.get_context("forkserver")
+        __multiprocessing_context: multiprocessing.context.BaseContext = multiprocessing.get_context("forkserver")
     except ValueError:
         # We are on a system without `forkserver` support. Let's default to
         # spawn. This seems to be hanging however in some rare cases.
diff --git a/src/buildstream/plugins/sources/tar.py b/src/buildstream/plugins/sources/tar.py
index 9e53ea6..e1ec2a2 100644
--- a/src/buildstream/plugins/sources/tar.py
+++ b/src/buildstream/plugins/sources/tar.py
@@ -72,7 +72,8 @@ class ReadableTarInfo(tarfile.TarInfo):
            so that the owner-read bit is always set.
     """
 
-    @property
+    # https://github.com/python/mypy/issues/4125
+    @property  # type: ignore
     def mode(self):
         # Respect umask instead of the file mode stored in the archive.
         # The only bit used from the embedded mode is the executable bit for files.
diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py
index df24abb..70a8274 100644
--- a/src/buildstream/plugins/sources/workspace.py
+++ b/src/buildstream/plugins/sources/workspace.py
@@ -93,10 +93,10 @@ class WorkspaceSource(Source):
     # init_workspace()
     #
     # Raises AssertionError: existing workspaces should not be reinitialized
-    def init_workspace(self, directory: Directory) -> None:
+    def init_workspace(self, directory: str) -> None:
         raise AssertionError("Attempting to re-open an existing workspace")
 
-    def fetch(self) -> None:  # pylint: disable=arguments-differ
+    def fetch(self, *, previous_sources_dir=None) -> None:  # pylint: disable=arguments-differ
         pass  # pragma: nocover
 
     def stage(self, directory):
@@ -133,5 +133,5 @@ class WorkspaceSource(Source):
 
 
 # Plugin entry point
-def setup() -> WorkspaceSource:
+def setup():
     return WorkspaceSource
diff --git a/tox.ini b/tox.ini
index c06d17b..79b46e8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -159,7 +159,11 @@ skip_install = True
 commands =
     mypy {posargs}
 deps =
-    mypy==0.730
+    mypy==0.910
+    types-protobuf
+    types-python-dateutil
+    types-setuptools
+    types-ujson
     -rrequirements/requirements.txt
     -rrequirements/dev-requirements.txt