Package: wtpython
What The Python?!Helping you find answers to the errors Python spits out.InstallationYou can find the source code on GitHub at:https://github.com/what-the-python/wtpythonTo install directly please run:pip install wtpythonUsageWhen you are running a python script, you might eventually come across an error like so.$ python example/runs_with_error.py
0
1
2
Traceback (most recent call last):
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/example/runs_with_error.py", line 8, in <module>
    requests.get('badurl')
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/home/cohan/github/perceptive-porcupines/Perceptive-Porcupines-Code-Jam-8/.venv/lib/python3.9/site-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'badurl': No schema supplied. Perhaps you meant http://badurl?In this case, simply replacepythonwithwtpythonand you will see the error message line as well as what installed packages were part of the stack trace.$ wtpython example/runs_with_error.pyThis will bring up something like below, the color scheme might be different based off how your terminal is setup.Development ToolsRichis a library to create styled text to the terminal. We'll use it for styling and formatting text.Textualis a part of rich to further aid in TUI design. We'll use it to create widgets and adjust the change the layout of the TUI.Flitis a simple way to develop Python packages. It's pretty lightweight but can do a lot. We'll use it to manage dependencies.pre-commitwill run a few tests before you can commit your code. Don't worry, it will make the changes for you. Worst case, you'll have to type thegit add/commitlines twice.Contribution instructionsTo setup the system for development please fork the repository and do the below before submitting a pull request.Create and activate a virtual environmentpython -m venv .venv --prompt template
source .venv/bin/activateUpgrade pip and install flit manuallypython -m pip install -U pip flitInstall the package using symlinksRun this command to install the package in your virtual environment. If you add dependencies topyproject.toml, you'll have to run this command again to install the new dependencies. Make sure to pin the version inpyproject.toml.flit install -sInstall pre-commitThe.pre-commit-config.yamlfile is configured to perform the following tasks on each commit:Validate yaml filesValidate toml filesEnsure a single new line on each fileEnsure trailing white spaces are removedFormat your code with blackEnsure your python imports are sorted consistentlypre-commit installFAQHow do I clear all of the cached results?You can clear the cache by using the--clear-cacheparam for the query or run delete the~/.wtpython_cache.