René's URL Explorer Experiment


Title: ImportError: cannot import name 'BaseCommitizen' and others in files starting with `cz_` · Issue #287 · commitizen-tools/commitizen · GitHub

Open Graph Title: ImportError: cannot import name 'BaseCommitizen' and others in files starting with `cz_` · Issue #287 · commitizen-tools/commitizen

X Title: ImportError: cannot import name 'BaseCommitizen' and others in files starting with `cz_` · Issue #287 · commitizen-tools/commitizen

Description: Description As it can be seen in the following line, all files present in the Python environment whose filename begins with cz_ will be discovered and iteratively loaded by commitizen. Unfortunately this also includes files that aren't i...

Open Graph Description: Description As it can be seen in the following line, all files present in the Python environment whose filename begins with cz_ will be discovered and iteratively loaded by commitizen. Unfortunatel...

X Description: Description As it can be seen in the following line, all files present in the Python environment whose filename begins with cz_ will be discovered and iteratively loaded by commitizen. Unfortunatel...

Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/287

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ImportError: cannot import name 'BaseCommitizen' and others in files starting with `cz_`","articleBody":"## Description\r\n\r\nAs it can be seen in the following line, all files present in the Python environment whose filename begins with `cz_` will be discovered and iteratively loaded by `commitizen`. Unfortunately this also includes files that aren't in the scope of commitizen but happen to be in `PYTHONPATH`:\r\n\r\nhttps://github.com/commitizen-tools/commitizen/blob/14b6c382ff96e37ba118ba1b75073b0d2313ee91/commitizen/cz/__init__.py#L18\r\n\r\nThe reaction is very cryptic and can lead to long and frustrating debugging sessions. Fortunately it is known that the \"cannot import\" message is linked to circular dependencies, e.g. see https://stackoverflow.com/a/746655\r\n\r\nJust importing `commitizen` doesn't break, but further recursive imports down the package trigger the issue.\r\n\r\n## Steps to reproduce\r\n1. Create a file starting with `cz_...` and call e.g. ` from commitizen.commands.bump import Bump`\r\n2. Run that file with the python interpreter, making sure that the file's directory is in `sys.path`\r\n3. The import will trigger an `ImportError` that is **internal to commitizen** like the one in the title. \r\n\r\n## Current behavior\r\nCode that runs from interactive CLI doesn't run from script\r\n\r\n## Desired behavior\r\nCode that runs on CLI should also run on script.\r\n\r\n## Environment\r\n\r\npython --version Python 3.6.12 :: Anaconda, Inc.\r\npython3 -c \"import platform; print(platform.system())\"\r\n\r\n\r\n- commitizen version: 2.4.2\r\n- python version: 3.6\r\n- operating system: Ubuntu\r\n","author":{"url":"https://github.com/andres-fr","@type":"Person","name":"andres-fr"},"datePublished":"2020-10-27T02:19:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/287/commitizen/issues/287"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e9271597-53f8-110f-d879-16e7f3e31d67
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8BF8:35A2B4:1029BA6:16E4AC9:6978D2CC
html-safe-nonce5ee950e1562dddebeaf1f31523bd7fba41f1685d9a0c6677d7ef98971a6318b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkY4OjM1QTJCNDoxMDI5QkE2OjE2RTRBQzk6Njk3OEQyQ0MiLCJ2aXNpdG9yX2lkIjoiNzUwNDk5NDY2OTA0MjM4OTcwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac33e8e15e66f9f6ba792b6bca40f856152edd83a2aa002b3629f2315d61cfca82
hovercard-subject-tagissue:730043222
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/287/issue_layout
twitter:imagehttps://opengraph.githubassets.com/59fc6935496e6665f8f5cdb81952e2b0a5e2a3774c8a25cad0776c15b37fb39e/commitizen-tools/commitizen/issues/287
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/59fc6935496e6665f8f5cdb81952e2b0a5e2a3774c8a25cad0776c15b37fb39e/commitizen-tools/commitizen/issues/287
og:image:altDescription As it can be seen in the following line, all files present in the Python environment whose filename begins with cz_ will be discovered and iteratively loaded by commitizen. Unfortunatel...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandres-fr
hostnamegithub.com
expected-hostnamegithub.com
None8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6
turbo-cache-controlno-preview
go-importgithub.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git
octolytics-dimension-user_id62252524
octolytics-dimension-user_logincommitizen-tools
octolytics-dimension-repository_id106127589
octolytics-dimension-repository_nwocommitizen-tools/commitizen
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id106127589
octolytics-dimension-repository_network_root_nwocommitizen-tools/commitizen
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
releaseeaed570eead52a9920afef75dc3eb6d826fdc5ef
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/commitizen-tools/commitizen/issues/287#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fissues%2F287
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fissues%2F287
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=commitizen-tools%2Fcommitizen
Reloadhttps://github.com/commitizen-tools/commitizen/issues/287
Reloadhttps://github.com/commitizen-tools/commitizen/issues/287
Reloadhttps://github.com/commitizen-tools/commitizen/issues/287
commitizen-tools https://github.com/commitizen-tools
commitizenhttps://github.com/commitizen-tools/commitizen
Please reload this pagehttps://github.com/commitizen-tools/commitizen/issues/287
Notifications https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Fork 316 https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Star 3.3k https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Code https://github.com/commitizen-tools/commitizen
Issues 125 https://github.com/commitizen-tools/commitizen/issues
Pull requests 28 https://github.com/commitizen-tools/commitizen/pulls
Discussions https://github.com/commitizen-tools/commitizen/discussions
Actions https://github.com/commitizen-tools/commitizen/actions
Projects 0 https://github.com/commitizen-tools/commitizen/projects
Security 0 https://github.com/commitizen-tools/commitizen/security
Insights https://github.com/commitizen-tools/commitizen/pulse
Code https://github.com/commitizen-tools/commitizen
Issues https://github.com/commitizen-tools/commitizen/issues
Pull requests https://github.com/commitizen-tools/commitizen/pulls
Discussions https://github.com/commitizen-tools/commitizen/discussions
Actions https://github.com/commitizen-tools/commitizen/actions
Projects https://github.com/commitizen-tools/commitizen/projects
Security https://github.com/commitizen-tools/commitizen/security
Insights https://github.com/commitizen-tools/commitizen/pulse
New issuehttps://github.com/login?return_to=https://github.com/commitizen-tools/commitizen/issues/287
New issuehttps://github.com/login?return_to=https://github.com/commitizen-tools/commitizen/issues/287
ImportError: cannot import name 'BaseCommitizen' and others in files starting with cz_https://github.com/commitizen-tools/commitizen/issues/287#top
help wantedhttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
type: bughttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
type: featureA new enhacement proposalhttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
https://github.com/andres-fr
https://github.com/andres-fr
andres-frhttps://github.com/andres-fr
on Oct 27, 2020https://github.com/commitizen-tools/commitizen/issues/287#issue-730043222
commitizen/commitizen/cz/__init__.pyhttps://github.com/commitizen-tools/commitizen/blob/14b6c382ff96e37ba118ba1b75073b0d2313ee91/commitizen/cz/__init__.py#L18
14b6c38https://github.com/commitizen-tools/commitizen/commit/14b6c382ff96e37ba118ba1b75073b0d2313ee91
https://stackoverflow.com/a/746655https://stackoverflow.com/a/746655
help wantedhttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
type: bughttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
type: featureA new enhacement proposalhttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
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.