Skip to content
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

Updating Testslide to typeguard 3.02 #352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

williamlw999-fb
Copy link

What:

Upgrading to Typeguard 3.02

Why:

Keep Testslide up to date

How:

  • Pin Typeguard version to 3 (3.02 is latest version at this time)
  • Update check_type Typeguard mock to instead mock ._checkers.check_type_internal
  • Update qualified_name Typeguard mock target to internal ._utils.qualified_name
  • Update exception handling to catch typeguard.TypeCheckError

Misc.

  • Update string concatenation to use f-strings instead
  • Typo in unittests: StritMock -> StrictMock
  • Remove commented out code
  • Add some comments on how why we mock out Typeguard with wrapped calls

Risks:

Some error message formats have changed

Checklist:

  • Added tests, if you've added code that should be tested
  • Updated the documentation, if you've changed APIs
  • Ensured the test suite passes
  • Made sure your code lints
  • Completed the Contributor License Agreement ("CLA")

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 10, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4660484186

  • 10 of 11 (90.91%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 93.589%

Changes Missing Coverage Covered Lines Changed/Added Lines %
testslide/lib.py 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
testslide/lib.py 3 88.32%
Totals Coverage Status
Change from base Build 4658049209: -0.1%
Covered Lines: 2657
Relevant Lines: 2839

💛 - Coveralls

@facebook-github-bot
Copy link

@williamlw999-fb has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@musicinmybrain
Copy link

Now that typeguard is at 4.0.0, it would be good to have support for that as well. It looks like it will be as simple as loosening the version bound:

From f7d1c5c22f5d795463a8b5d614d50f643cc81d71 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Fri, 12 May 2023 08:45:24 -0400
Subject: [PATCH] Allow typeguard 4.x

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index a87cb58..cc27889 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
 psutil>=5.6.7
 Pygments>=2.2.0
-typeguard~=3.0
+typeguard>=3.0,<5
 dataclasses>=0.6; python_version < "3.7"
-- 
2.39.2

shish added a commit that referenced this pull request Mar 25, 2024
Wanting to try out "upgrade typeguard to 3.X" (#352) and "upgrade typeguard to 4.X" in parallel, pulling some superficial parts out so that I can minimise distractions
facebook-github-bot pushed a commit that referenced this pull request Mar 26, 2024
Summary:
Pull superficial changes out of #352

Wanting to try out "upgrade typeguard to 3.X" (#352) and "upgrade typeguard to 4.X" in parallel, pulling some superficial parts out so that I can minimise distractions

Pull Request resolved: #358

Differential Revision: D55365453

Pulled By: shish

fbshipit-source-id: 7f09e9586cef2d810d069e7b723358f7f2f4a40f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants