René's URL Explorer Experiment


Title: Allow using fire without editing code directly. by jtratner · Pull Request #110 · google/python-fire · GitHub

Open Graph Title: Allow using fire without editing code directly. by jtratner · Pull Request #110 · google/python-fire

X Title: Allow using fire without editing code directly. by jtratner · Pull Request #110 · google/python-fire

Description: Enable python -m fire to work - closes #29. @dbieber I wanted to restart the discussion in #29 with a very simple implementation that doesn't lock us into any advanced functionality at all. Everything else works exactly the same, except that you prefix with python -m fire and the first argument must resolve to a module. python -m fire vs. fire I used python -m fire rather than an external fire tool, because it's really important that the python interpreter be exactly the same, and this avoids confusing bugs where fire resolves to something in the global environment, but you're trying to test something in a virtualenv or conda environment. Testing I need to think a little bit about how to test running fire with -m (I'm sure someone on the internet knows) but I'd like to get feedback on whether this a good implementation before investing too much time there. "Bugs" --interactive currently jumps you into a shell with the specified module loaded, rather than what you might expect (from import *) Examples $ python -m fire tempfile mkdtemp /var/folders/fm/sjgpzb856kld04jvq82bxrcw0000gp/T/tmpCbfg_1 or $ python -m fire urllib unquote genetics=awesome&editor=crispr genetics=awesome&editor=crispr This follows normal python import semantics, so if you have a script file, it'll work if named just as a module: # myscript.py def fn1(x, y): return x $ python -m fire myscript 5 6 5 Why manipulate sys.argv? when running with -m, nothing else is going to be pulling from sys.argv it makes for a nicer help text (rather than __main__.py you can show the module) ›› python -m fire base64 Type: module String form: File: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/base64.py Line: 1 Docstring: RFC 3548: Base16, Base32, Base64 Data Encodings Usage: base64 base64 EMPTYSTRING base64 MAXBINSIZE base64 MAXLINESIZE base64 b16decode base64 b16encode base64 b32decode base64 b32encode base64 b64decode base64 b64encode base64 binascii base64 decode base64 decodestring base64 encode base64 encodestring base64 k base64 re base64 standard-b64decode base64 standard-b64encode base64 string base64 struct base64 test base64 test1 base64 urlsafe-b64decode base64 urlsafe-b64encode base64 v

Open Graph Description: Enable python -m fire <module> <args> to work - closes #29. @dbieber I wanted to restart the discussion in #29 with a very simple implementation that doesn't lock us into any advanc...

X Description: Enable python -m fire &lt;module&gt; &lt;args&gt; to work - closes #29. @dbieber I wanted to restart the discussion in #29 with a very simple implementation that doesn&#39;t loc...

Opengraph URL: https://github.com/google/python-fire/pull/110

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7d896690-0a10-580e-62ef-56e496a77fdb
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id81C0:29A20E:164AB22:1DF2513:6AFFE4FF
html-safe-noncedd5df5088cf6c1931898d8f0dcdcc0320f7376c51819cb9aa6c9420c5ff76d68
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUMwOjI5QTIwRToxNjRBQjIyOjFERjI1MTM6NkFGRkU0RkYiLCJ2aXNpdG9yX2lkIjoiOTEyNjcxMjIzMTk5MDM4Nzk2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac195318677d937d900df1e4eab3378bf01c5a5ef06bbcef4f5a3d44132a94e5c3
hovercard-subject-tagpull_request:160841338
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/google/python-fire/pull/110/files
twitter:imagehttps://avatars.githubusercontent.com/u/1598379?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1598379?s=400&v=4
og:image:altEnable python -m fire <module> <args> to work - closes #29. @dbieber I wanted to restart the discussion in #29 with a very simple implementation that doesn't lock us into any advanc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/google/python-fire git https://github.com/google/python-fire.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id82729529
octolytics-dimension-repository_nwogoogle/python-fire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id82729529
octolytics-dimension-repository_network_root_nwogoogle/python-fire
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/google/python-fire/pull/110/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fpython-fire%2Fpull%2F110%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fpython-fire%2Fpull%2F110%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=google%2Fpython-fire
Reloadhttps://github.com/google/python-fire/pull/110/files
Reloadhttps://github.com/google/python-fire/pull/110/files
Reloadhttps://github.com/google/python-fire/pull/110/files
googlehttps://github.com/google
python-firehttps://github.com/google/python-fire
Codehttps://github.com/google/python-fire
Issues146 (146)https://github.com/google/python-fire/issues
Pull requests85 (85)https://github.com/google/python-fire/pulls
Actionshttps://github.com/google/python-fire/actions
Projectshttps://github.com/google/python-fire/projects
Security and qualityhttps://github.com/google/python-fire/security
Insightshttps://github.com/google/python-fire/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgoogle%2Fpython-fire%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgoogle%2Fpython-fire%2Fissues%2Fnew%2Fchoose
jtratnerhttps://github.com/jtratner
google:masterhttps://github.com/google/python-fire/tree/master
jtratner:main-firehttps://github.com/jtratner/python-fire/tree/main-fire
Conversation 24 https://github.com/google/python-fire/pull/110
Commits 8 https://github.com/google/python-fire/pull/110/commits
Checks 0 https://github.com/google/python-fire/pull/110/checks
Files changed https://github.com/google/python-fire/pull/110/files
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
Allow using fire without editing code directly. https://github.com/google/python-fire/pull/110/files#top
Show all changes 8 commits https://github.com/google/python-fire/pull/110/files
7bcb58c Enable python -m fire to work jtratner Jan 3, 2018 https://github.com/google/python-fire/pull/110/commits/7bcb58cf900edd7f01c54274db4030ac1f535283
519044c Add tests for main function jtratner Jan 6, 2018 https://github.com/google/python-fire/pull/110/commits/519044ca6d9c1add8490b45848f7ca3ce216f8ae
c70b423 Fix capitalization + lint jtratner Jan 9, 2018 https://github.com/google/python-fire/pull/110/commits/c70b4233294942c7eb4be03e1098b21aee6cde23
810a004 Fix member attribute name and add additional check jtratner Jan 9, 2018 https://github.com/google/python-fire/pull/110/commits/810a004e1ae230273f8034953d7c0ff3a67170da
3dc93a0 Fix up test completely jtratner Jan 9, 2018 https://github.com/google/python-fire/pull/110/commits/3dc93a0477485500fd35c53ed45b2ae814c54ccf
405596e Remove leftover comment jtratner Jan 9, 2018 https://github.com/google/python-fire/pull/110/commits/405596e731e00cee014478b144db79b11dc53a80
ce7ea6c More lint fixes jtratner Jan 10, 2018 https://github.com/google/python-fire/pull/110/commits/ce7ea6cd35213763f9ba0fd860a3d098cfbbdfe3
dbe70e2 Lint fix jtratner Jan 10, 2018 https://github.com/google/python-fire/pull/110/commits/dbe70e23a3de6a85f23a509cfa32cca182ac0bb2
Clear filters https://github.com/google/python-fire/pull/110/files
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
__main__.py https://github.com/google/python-fire/pull/110/files#diff-c4edf3b8975f867c2c9eb4e7c0867eabfe4681412a0fbeb09c44a276df23f62f
test_main.py https://github.com/google/python-fire/pull/110/files#diff-17a09c9f17f2ea58aad8a7b776e79a8f2fd7a42d0854bef4ad8a33dc12cc9f11
fire/__main__.pyhttps://github.com/google/python-fire/pull/110/files#diff-c4edf3b8975f867c2c9eb4e7c0867eabfe4681412a0fbeb09c44a276df23f62f
View file https://github.com/jtratner/python-fire/blob/dbe70e23a3de6a85f23a509cfa32cca182ac0bb2/fire/__main__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/google/python-fire/pull/110/{{ revealButtonHref }}
dbieberhttps://github.com/dbieber
Jan 8, 2018https://github.com/google/python-fire/pull/110/files#r160243356
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
jtratnerhttps://github.com/jtratner
Jan 9, 2018https://github.com/google/python-fire/pull/110/files#r160451837
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
dbieberhttps://github.com/dbieber
Jan 9, 2018https://github.com/google/python-fire/pull/110/files#r160535746
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
fire/test_main.pyhttps://github.com/google/python-fire/pull/110/files#diff-17a09c9f17f2ea58aad8a7b776e79a8f2fd7a42d0854bef4ad8a33dc12cc9f11
View file https://github.com/jtratner/python-fire/blob/dbe70e23a3de6a85f23a509cfa32cca182ac0bb2/fire/test_main.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/google/python-fire/pull/110/{{ revealButtonHref }}
jtratnerhttps://github.com/jtratner
Jan 6, 2018https://github.com/google/python-fire/pull/110/files#r160007742
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
dbieberhttps://github.com/dbieber
Jan 8, 2018https://github.com/google/python-fire/pull/110/files#r160244203
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
jtratnerhttps://github.com/jtratner
Jan 9, 2018https://github.com/google/python-fire/pull/110/files#r160302067
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/google/python-fire/pull/110/files
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.