| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9b0edd0 commit b30e0da
27 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,3 +99,8 @@ jobs: | |||
| 99 | 99 | env: | |
| 100 | 100 | TWINE_USERNAME: __token__ | |
| 101 | 101 | TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
| 102 | + | ||
| 103 | + - name: publish docs | ||
| 104 | + run: make publish-docs | ||
| 105 | + env: | ||
| 106 | + NETLIFY: ${{ secrets.netlify_token }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,6 @@ env36/ | |||
| 5 | 5 | env37/ | |
| 6 | 6 | *.py[cod] | |
| 7 | 7 | *.egg-info/ | |
| 8 | - build/ | ||
| 9 | 8 | dist/ | |
| 10 | 9 | .cache/ | |
| 11 | 10 | .mypy_cache/ | |
@@ -14,6 +13,8 @@ test.py | |||
| 14 | 13 | htmlcov/ | |
| 15 | 14 | benchmarks/*.json | |
| 16 | 15 | docs/_build/ | |
| 16 | + /docs/.*.md | ||
| 17 | 17 | docs/examples/*.html | |
| 18 | 18 | old-version/ | |
| 19 | 19 | *.swp | |
| 20 | + /site/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,31 @@ | |||
| 1 | + ## v0.6.0 (2020-07-29) | ||
| 2 | + * improve `__pretty__` to work better with pydantic classes, #52 | ||
| 3 | + * improve the way statement ranges are calculated, #58 | ||
| 4 | + * drastically improve import time, #50 | ||
| 5 | + * pretty printing for non-standard dicts, #60 | ||
| 6 | + * better statement finding for multi-line statements, #61 | ||
| 7 | + * colors in windows, #57 | ||
| 8 | + * fix `debug(type(dict(...)))`, #62 | ||
| 9 | + | ||
| 10 | + ## v0.5.1 (2019-10-09) | ||
| 11 | + * fix python tag in `setup.cfg`, #46 | ||
| 12 | + | ||
| 13 | + ## v0.5.0 (2019-01-03) | ||
| 14 | + * support `MultiDict`, #34 | ||
| 15 | + * support `__pretty__` method, #36 | ||
| 16 | + | ||
| 17 | + ## v0.4.0 (2018-12-29) | ||
| 18 | + * remove use of `warnings`, include in output, #30 | ||
| 19 | + * fix rendering errors #31 | ||
| 20 | + * better str and bytes wrapping #32 | ||
| 21 | + * add `len` everywhere possible, part of #16 | ||
| 22 | + | ||
| 23 | + ## v0.3.0 (2017-10-11) | ||
| 24 | + * allow `async/await` arguments | ||
| 25 | + * fix subscript | ||
| 26 | + * fix weird named tuples eg. `mock > call_args` | ||
| 27 | + * add `timer` | ||
| 28 | + | ||
| 29 | + ## v0.2.0 (2017-09-14) | ||
| 30 | + * improve output | ||
| 31 | + * numerous bug fixes | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + include LICENSE | ||
| 2 | + include README.md | ||
| 3 | + include HISTORY.md | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,11 +55,17 @@ clean: | |||
| 55 | 55 | ||
| 56 | 56 | .PHONY: docs | |
| 57 | 57 | docs: | |
| 58 | - make -C docs html | ||
| 58 | + flake8 --max-line-length=80 docs/examples/ | ||
| 59 | + python docs/build/main.py | ||
| 60 | + mkdocs build | ||
| 59 | 61 | ||
| 60 | - .PHONY: publish | ||
| 61 | - publish: docs | ||
| 62 | - cd docs/_build/ && cp -r html site && zip -r site.zip site | ||
| 63 | - @curl -i -H "Content-Type: application/zip" -H "Authorization: Bearer ${NETLIFY}" \ | ||
| 64 | - --data-binary "@docs/_build/site.zip" https://api.netlify.com/api/v1/sites/python-devtools.netlify.com/deploys | ||
| 65 | - @echo " " | ||
| 62 | + .PHONY: docs-serve | ||
| 63 | + docs-serve: | ||
| 64 | + python docs/build/main.py | ||
| 65 | + mkdocs serve | ||
| 66 | + | ||
| 67 | + .PHONY: publish-docs | ||
| 68 | + publish-docs: docs | ||
| 69 | + zip -r site.zip site | ||
| 70 | + @curl -H "Content-Type: application/zip" -H "Authorization: Bearer ${NETLIFY}" \ | ||
| 71 | + --data-binary "@site.zip" https://api.netlify.com/api/v1/sites/python-devtools.netlify.com/deploys | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,74 @@ | |||
| 1 | + # python devtools | ||
| 2 | + | ||
| 3 | + [](https://github.com/samuelcolvin/python-devtools/actions?query=event%3Apush+branch%3Amaster+workflow%3ACI) | ||
| 4 | + [](https://codecov.io/gh/samuelcolvin/python-devtools) | ||
| 5 | + [](https://pypi.python.org/pypi/python-devtools) | ||
| 6 | + [](https://github.com/samuelcolvin/python-devtools) | ||
| 7 | + [](https://github.com/samuelcolvin/python-devtools/blob/master/LICENSE) | ||
| 8 | + | ||
| 9 | + **Python's missing debug print command and other development tools.** | ||
| 10 | + | ||
| 11 | + For more information, see [documentation](https://python-devtools.helpmanual.io/). | ||
| 12 | + | ||
| 13 | + ## Install | ||
| 14 | + | ||
| 15 | + Just | ||
| 16 | + | ||
| 17 | + ```bash | ||
| 18 | + pip install devtools[pygments] | ||
| 19 | + ``` | ||
| 20 | + | ||
| 21 | + `pygments` is not required but if it's installed, output will be highlighted and easier to read. | ||
| 22 | + | ||
| 23 | + `devtools` has no other required dependencies except python 3.6, 3.7, or 3.8. | ||
| 24 | + If you've got python 3.6+ and `pip` installed, you're good to go. | ||
| 25 | + | ||
| 26 | + ## Usage | ||
| 27 | + | ||
| 28 | + ```py | ||
| 29 | + from devtools import debug | ||
| 30 | + | ||
| 31 | + whatever = [1, 2, 3] | ||
| 32 | + debug(whatever) | ||
| 33 | + ``` | ||
| 34 | + | ||
| 35 | + Outputs: | ||
| 36 | + | ||
| 37 | + ```py | ||
| 38 | + test.py:4 <module>: | ||
| 39 | + whatever: [1, 2, 3] (list) | ||
| 40 | + ``` | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + That's only the tip of the iceberg, for example: | ||
| 44 | + | ||
| 45 | + ```py | ||
| 46 | + import numpy as np | ||
| 47 | + | ||
| 48 | + data = { | ||
| 49 | + 'foo': np.array(range(20)), | ||
| 50 | + 'bar': {'apple', 'banana', 'carrot', 'grapefruit'}, | ||
| 51 | + 'spam': [{'a': i, 'b': (i for i in range(3))} for i in range(3)], | ||
| 52 | + 'sentence': 'this is just a boring sentence.\n' * 4 | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + debug(data) | ||
| 56 | + ``` | ||
| 57 | + | ||
| 58 | + outputs: | ||
| 59 | + | ||
| 60 | +  | ||
| 61 | + | ||
| 62 | + ## Usage without Import | ||
| 63 | + | ||
| 64 | + modify `/usr/lib/python3.8/sitecustomize.py` making `debug` available in any python 3.8 code | ||
| 65 | + | ||
| 66 | + ```py | ||
| 67 | + # add devtools debug to builtins | ||
| 68 | + try: | ||
| 69 | + from devtools import debug | ||
| 70 | + except ImportError: | ||
| 71 | + pass | ||
| 72 | + else: | ||
| 73 | + __builtins__['debug'] = debug | ||
| 74 | + ``` | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments