888888b.
888 Y88b
888 888
888 d88P 888 888 .d8888b .d8888b .d88b.
8888888P" 888 888 d88P" d88P" d88""88b
888 888 888 888 888 888 888
888 Y88b 888 Y88b. Y88b. Y88..88P
888 "Y88888 "Y8888P "Y8888P "Y88P"
888
Y8b d88P
"Y88P"
Pycco is a Python port of Docco: the original quick-and-dirty, hundred-line- long, literate-programming-style documentation generator. For more information, see:
https://pycco-docs.github.io/pycco/
Others:
CoffeeScript (Original) - http://jashkenas.github.com/docco/
Ruby - http://rtomayko.github.com/rocco/
Sh - http://rtomayko.github.com/shocco/
As Python2 is long overdue to be phased-out I switched the os.path module to use the recommended pathlib module instead - and through that fixing the watcher which did no longer work for me.
The first commit just reformats everything with black (if thats an issue let me know then I could potentially "undo" that).
```
[email protected] MINGW64 ~/GitHub/no_algo_twitter (main)
$ pycco src/*.py
Traceback (most recent call last):
File "C:\Users\matth\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\matth\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\matth.virtualenvs\no_algo_twitter-Vk_lV-hQ\Scripts\pycco.exe__main__.py", line 4, in
[email protected] MINGW64 ~/GitHub/no_algo_twitter (main) $ python --version Python 3.8.7
``` I think it is blowing up on some really old school import syntax. I don't remember seeing that sort of import that omits the package name since python 2.
There is some motion to take over pystache ref: https://github.com/pypa/pypi-support/issues/1422 and we could see new releases of pystache, but in the meanwhile, pycco seems to be broken in a lot of venvs.
Hi There,
Thanks for this awesome tool. Running into an issue where these docstrings break rendering:
python
def add(x, y):
"""This should be a simple docstring
However, it turns everything following it into a comment."""
return x + y
Only this works:
python
def add(x, y):
"""This should be a simple docstring
However, it turns everything following it into a comment.
"""
return x + y
Given this particular formatting is not picked up on by pylint
, I assume it is valid and this is a bug.
Not sure what the root cause is here
Traceback (most recent call last):
File "/usr/local/bin/pycco", line 33, in <module>
sys.exit(load_entry_point('Pycco==0.6.0', 'console_scripts', 'pycco')())
File "/usr/local/bin/pycco", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.9/site-packages/Pycco-0.6.0-py3.9.egg/pycco/__init__.py", line 1, in <module>
# -*- coding: utf-8 -*-
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.9/site-packages/Pycco-0.6.0-py3.9.egg/pycco/main.py", line 373, in <module>
File "/usr/local/lib/python3.9/site-packages/Pycco-0.6.0-py3.9.egg/pycco/main.py", line 369, in compile_language
File "/usr/local/lib/python3.9/site-packages/pygments/lexers/__init__.py", line 93, in get_lexer_by_name
raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias 'stata' found
Bumps pygments from 2.5.2 to 2.7.4.
Sourced from pygments's releases.
2.7.4
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
2.7.3
... (truncated)
Sourced from pygments's changelog.
Version 2.7.4
(released January 12, 2021)
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
Version 2.7.3
(released December 6, 2020)
... (truncated)
4d555d0
Bump version to 2.7.4.fc3b05d
Update CHANGES.ad21935
Revert "Added dracula theme style (#1636)"e411506
Prepare for 2.7.4 release.275e34d
doc: remove Perl 6 ref2e7e8c4
Fix several exponential/cubic complexity regexes found by Ben Caller/Doyenseceb39c43
xquery: fix pop from empty stack2738778
fix coding style in test_analyzer_lexer02e0f09
Added 'ERROR STOP' to fortran.py keywords. (#1665)c83fe48
support added for css variables (#1633)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
When running pycco file
, it works well when the file is named foo.py
, but does not work for foo
despite having a shebang.
Create this file as example
. Note that if it is named example.py
, everything works as expected.
```python
import os
class CommandLineFlag(object): '''Holds information about a command-line argument''' ```
``` $ pycco example Traceback (most recent call last): File "/Users/zachriggle/Library/Python/3.8/lib/python/site-packages/pycco/main.py", line 397, in get_language raise ValueError() ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/zachriggle/Library/Python/3.8/bin/pycco", line 10, in
This release includes some code modernization and greater test coverage, plus:
--skip-bad-files
, also now aliased to --ignore-errors
, does what it says on the tin: Pycco will continue operation if it encounters a file it does not understand.Changes:
- Courtesy of @goosemo, Pycco will recurse into directories given as arguments and attempt to process all the contents.
- Added -s
argument to continue processing a list of files (or directory) if an unprocessable file is encountered.
Generate a simple index of all generated documentation using the -i
flag. Many thanks to @abbgrade for his contribution to Pycco.