René's URL Explorer Experiment


Title: Does this lib compatible with mypy? · python-semver/python-semver · Discussion #342 · GitHub

Open Graph Title: Does this lib compatible with mypy? · python-semver/python-semver · Discussion #342

X Title: Does this lib compatible with mypy? · python-semver/python-semver · Discussion #342

Description: Does this lib compatible with mypy?

Open Graph Description: Hello, I'm trying to use python-semver with mypy, but I'm getting an error from mypy. It seems like typings and annotations were not provided for semver lib build. I don't know if it is a bug, mayb...

X Description: Hello, I'm trying to use python-semver with mypy, but I'm getting an error from mypy. It seems like typings and annotations were not provided for semver lib build. I don't know if it is...

Opengraph URL: https://github.com/python-semver/python-semver/discussions/342

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Does this lib compatible with mypy?","text":"

Hello, I'm trying to use python-semver with mypy, but I'm getting an error from mypy. It seems like typings and annotations were not provided for semver lib build. I don't know if it is a bug, maybe I've installed the lib incorrectly? Thanks for help.

\n

Code example:

\n
from semver import VersionInfo\n\n\ndef main() -> None:\n    v = VersionInfo.parse(\"1.2.3\")\n    print(type(v), v)\n\n\nif __name__ == \"__main__\":\n    main()
\n
$ mypy type-semver.py \ntype-semver.py:3:1: error: Skipping analyzing \"semver\": found module but no type hints or library stubs  [import]\n    from semver import VersionInfo\n    ^\ntype-semver.py:3:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\nFound 1 error in 1 file (checked 1 source file)
\n

requirements

\n
mypy==0.910\nmypy-extensions==0.4.3\nsemver==2.13.0\ntoml==0.10.2\ntyping-extensions==3.10.0.2\n
\n

mypy settings from pyproject.toml

\n
[tool.mypy]\npython_version = \"3.8\"\n\ndisallow_any_unimported = true\ndisallow_any_decorated = true\ndisallow_any_generics = true\ndisallow_subclassing_any = true\ndisallow_untyped_calls = true\ndisallow_untyped_defs = true\ndisallow_incomplete_defs = true\ndisallow_untyped_decorators = true\nno_implicit_optional = true\nstrict_optional = true\n\nwarn_redundant_casts = true\nwarn_unused_ignores = true\nwarn_no_return = true\nwarn_return_any = true\nwarn_unreachable = true\n\nstrict_equality = true\nimplicit_reexport = false\n\nshow_error_context = true\nshow_column_numbers = true\nshow_error_codes = true\npretty = true\n\nwarn_unused_configs = true
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Hi @zerlok

\n

thanks for your question! 👍

\n

Version 2 does not have any type hints. They were introduced in the upcoming (but not yet released) version 3. See issue #213 for more details.

\n

I'm not yet familiar with type hinting, just get accustomed to it ATM. One solution for version 2 could be stubgen (integrated in mypy) to create a first skeleton. However, it still needs manual editing. I take pull requests. 😉

","upvoteCount":1,"url":"https://github.com/python-semver/python-semver/discussions/342#discussioncomment-1269871"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:fbfb810f-4a56-f538-5eac-5cc6b1c8da60
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id9E2A:D2C73:BC5DA0:1098620:696FB97A
html-safe-noncee5cfd5850cea56f7a99f7b578f618552aa1c3a1b56df3f8ac92c8d3583c65009
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTJBOkQyQzczOkJDNURBMDoxMDk4NjIwOjY5NkZCOTdBIiwidmlzaXRvcl9pZCI6IjMzNDEzNjI4MjU3OTg4NTkxMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5b6265b23bced50e742b902909ebd861adb42ed5bb8eeabd63bf5be001de45b7
hovercard-subject-tagdiscussion:3549926
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/python-semver/python-semver/342/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/003e15b0023ca01870d54456db28f0f64475dd22d31d91e18d5b9ac5b993bd7b/python-semver/python-semver/discussions/342
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/003e15b0023ca01870d54456db28f0f64475dd22d31d91e18d5b9ac5b993bd7b/python-semver/python-semver/discussions/342
og:image:altHello, I'm trying to use python-semver with mypy, but I'm getting an error from mypy. It seems like typings and annotations were not provided for semver lib build. I don't know if it is a bug, mayb...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None40ce4030a7db32193be29054756ed7f7eceec3a82973f060300035bdff8cf777
turbo-cache-controlno-preview
go-importgithub.com/python-semver/python-semver git https://github.com/python-semver/python-semver.git
octolytics-dimension-user_id57228994
octolytics-dimension-user_loginpython-semver
octolytics-dimension-repository_id3375726
octolytics-dimension-repository_nwopython-semver/python-semver
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3375726
octolytics-dimension-repository_network_root_nwopython-semver/python-semver
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1cdcabe0d7ddc4be91a713d57280849e4c89f5cd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-semver%2Fpython-semver%2Fdiscussions%2F342
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-semver%2Fpython-semver%2Fdiscussions%2F342
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=python-semver%2Fpython-semver
Reloadhttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
Reloadhttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
Reloadhttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
python-semver https://patch-diff.githubusercontent.com/python-semver
python-semverhttps://patch-diff.githubusercontent.com/python-semver/python-semver
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-semver%2Fpython-semver
Fork 96 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-semver%2Fpython-semver
Star 516 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-semver%2Fpython-semver
Code https://patch-diff.githubusercontent.com/python-semver/python-semver
Issues 12 https://patch-diff.githubusercontent.com/python-semver/python-semver/issues
Pull requests 3 https://patch-diff.githubusercontent.com/python-semver/python-semver/pulls
Discussions https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions
Actions https://patch-diff.githubusercontent.com/python-semver/python-semver/actions
Projects 0 https://patch-diff.githubusercontent.com/python-semver/python-semver/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/python-semver/python-semver/security
Please reload this pagehttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
Insights https://patch-diff.githubusercontent.com/python-semver/python-semver/pulse
Code https://patch-diff.githubusercontent.com/python-semver/python-semver
Issues https://patch-diff.githubusercontent.com/python-semver/python-semver/issues
Pull requests https://patch-diff.githubusercontent.com/python-semver/python-semver/pulls
Discussions https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions
Actions https://patch-diff.githubusercontent.com/python-semver/python-semver/actions
Projects https://patch-diff.githubusercontent.com/python-semver/python-semver/projects
Security https://patch-diff.githubusercontent.com/python-semver/python-semver/security
Insights https://patch-diff.githubusercontent.com/python-semver/python-semver/pulse
Answered https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#discussioncomment-1269871
tomschrhttps://patch-diff.githubusercontent.com/tomschr
zerlok https://patch-diff.githubusercontent.com/zerlok
Q&Ahttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/categories/q-a
Does this lib compatible with mypy? https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#top
zerlok https://patch-diff.githubusercontent.com/zerlok
Answered https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#discussioncomment-1269871
tomschrhttps://patch-diff.githubusercontent.com/tomschr
Return to tophttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#top
Please reload this pagehttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
zerlok https://patch-diff.githubusercontent.com/zerlok
Sep 1, 2021 https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#discussion-3549926
Give feedback.https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
tomschr https://patch-diff.githubusercontent.com/tomschr
Sep 2, 2021 https://github.com/python-semver/python-semver/discussions/342#discussioncomment-1269871
@zerlokhttps://github.com/zerlok
#213https://github.com/python-semver/python-semver/issues/213
View full answer https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#discussioncomment-1269871
Oldest https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342?sort=old
Newest https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342?sort=new
Top https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
Please reload this pagehttps://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
tomschr https://patch-diff.githubusercontent.com/tomschr
Sep 2, 2021 https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342#discussioncomment-1269871
@zerlokhttps://github.com/zerlok
#213https://github.com/python-semver/python-semver/issues/213
Give feedback.https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
zerlokhttps://patch-diff.githubusercontent.com/zerlok
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-semver%2Fpython-semver%2Fdiscussions%2F342
❓ Q&A https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/categories/q-a
https://patch-diff.githubusercontent.com/zerlok
https://patch-diff.githubusercontent.com/tomschr
https://patch-diff.githubusercontent.com/python-semver/python-semver/discussions/342
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.