Friday, 2019-09-20

*** tpb has joined #litex00:00
*** freemint has joined #litex00:38
*** freemint has quit IRC01:07
*** freemint has joined #litex01:11
*** rohitksingh has quit IRC01:33
*** CarlFK has quit IRC01:59
*** rohitksingh has joined #litex02:10
*** freemint has quit IRC02:52
*** rohitksingh has quit IRC04:06
*** rohitksingh has joined #litex04:28
*** CarlFK has joined #litex05:28
*** rohitksingh has quit IRC09:51
*** freemint has joined #litex10:24
*** freemint has quit IRC13:23
*** freemint has joined #litex13:37
*** CarlFK has quit IRC13:42
*** pizzaman has quit IRC14:09
*** pizzaman has joined #litex14:09
*** pizzaman has quit IRC14:10
*** pizzaman has joined #litex14:11
*** pizzaman has quit IRC14:22
mithroxobs: FYI You might want to look at testwrap.dedent for having triple quoted strings in Python be aligned with surrounding code15:28
mithroxobs: https://pymotw.com/2/textwrap/15:28
tpbTitle: textwrap Formatting text paragraphs - Python Module of the Week (at pymotw.com)15:28
mithrohttps://github.com/amontalenti/elements-of-python-style/issues/2615:28
tpbTitle: Suggest using `textwrap.dedent()` to keep indentation even with triple-quote multi-line strings · Issue #26 · amontalenti/elements-of-python-style · GitHub (at github.com)15:28
mithrohttps://docs.python.org/3.1/library/textwrap.html15:28
tpbTitle: 7.5. textwrap — Text wrapping and filling Python v3.1.5 documentation (at docs.python.org)15:28
xobsmithro: Thanks, that looks super useful for this sort of thing.  I wonder why it's not more widely known15:30
xobsI'll have to look into using that myself.  I saw someone used regular expressions on Stack Overflow to accomplish that, which is as far as I'd gotten.15:30
xobsxobs: Any recommendations on how we can extract various sections out of a docstring?  Or how we could use sphinx?  Right now I generate rst files after `soc.do_exit(vns)` and just run sphinx on that.15:31
mithroxobs: I only found about it a year or two ago and I've been programming in Python since 199815:32
xobsIf there were a way to parse out the various Module docstrings, that would be very useful.15:32
mithroxobs: I would suggest using rst headers / section thingies15:32
xobssphinx is, ironically, not well documented.  For example, in lxsocdoc, I make each register a `subsubsection`, but in the resulting html it makes them `<h1>` "section"s.  I haven't figured out how to not have it include subsubsections all over the place.  Or how to include sections.15:34
*** pizzaman has joined #litex15:35
xobsIs docutils part of python, or is it something that got pulled in by sphinx?15:37
xobsI see.  No, it's not part of the standard distribution, but it has no dependencies and no build requirements other than 3.5+ (same as litex)15:45
*** freemint has quit IRC16:06
*** freemint has joined #litex16:20
*** CarlFK has joined #litex16:20
xobsThis came up over in #fomu, but is there any particular reason why `CSRStatus` fields have no `.we` signal?16:28
*** freemint has quit IRC16:43
*** scanakci has joined #litex16:46
*** freemint has joined #litex16:49
mithroxobs: FYI I would recommend using rst headers / blocks. You can then use docutils to easily extract the sections.16:52
mithroxobs: https://www.sphinx-doc.org/en/master/_modules/docutils/parsers/rst.html16:53
xobsmithro: I really don't want to depend on a module like that.16:54
mithroxobs: Why not? docutils is a standard library module?16:54
xobsIt doesn't look like it's part of the standard library.  At least it's not listed at https://docs.python.org/3/library/index.html16:55
tpbTitle: The Python Standard Library Python 3.7.4 documentation (at docs.python.org)16:55
mithroOh maybe I'm wrong...16:55
*** scanakci has quit IRC16:55
xobsThe best way seems to be to generate files that can then be fed into sphinx.16:55
xobsI just spent the afternoon helping Bunnie fix his system that has a conflicting sphinx setup.  So the fewer modules we need the better.16:56
mithrohttps://docs.python.org/3/library/inspect.html#inspect.getcomments16:56
tpbTitle: inspect — Inspect live objects Python 3.7.4 documentation (at docs.python.org)16:56
mithroxobs: This is why you use self contained Python environments16:56
xobsAlso, docutils seems to require python 3.5+.  litex requires python 3.5+, but I'm afraid of them changing things.16:57
*** scanakci has joined #litex16:58
mithro0.15 is the last to support Python 2.6, 3.3, and 3.4.16:59
mithroDocutils is compatible with Python versions 2.7, and 3.5 to 3.716:59
xobsRight, but my concern is that they don't seem to care much for backwards-compatibility.  And I don't see the benefit of doing it that way versus having a sentinal.  The drawbacks are needing to package another module, and depending on something that has shown that they will drop support for older versions.  What are the benefits?17:01
mithroxobs: The choice is "do something custom which will continue to grow in complexity until it reaches the same as the existing solutions" or "Use the current existing most popular solution which has been around a long time and is the default option Python people would reach for (and has a lot of stackoverflow and other existing solutions)"17:03
mithroxobs: FYI - The longer you wait to upgrade things, the more painful the upgrade is going to be17:06
*** freemint has quit IRC17:08
xobsmithro: It'll need to be nonstandard anyway.  The choice is whether we have a nonstandard prefix on the header, or we have a special sentinal.17:12
mithroxobs: Extend an existing standard is better than inventing a new one...17:13
xobsI really don't like to add python packages.  They always seem to break.  The wavedrom sphinx plugin, for example, fails to install because it requires libxcb.dll17:13
xobsThe idea came from perlpod, which is an existing standard.17:15
mithroxobs: btw - https://github.com/enjoy-digital/litex/pull/253#issuecomment-53313845817:30
tpbTitle: WIP: Enable link-time-optimization on LiteX builds by mithro · Pull Request #253 · enjoy-digital/litex · GitHub (at github.com)17:30
mithroxobs: You can probably just use your regex / string approach and make the sentinel a rst block compatible? https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst#blocks17:31
tpbTitle: rst-cheatsheet/rst-cheatsheet.rst at master · ralsina/rst-cheatsheet · GitHub (at github.com)17:31
mithroxobs: My suggestion -> https://github.com/enjoy-digital/litex/pull/259#issuecomment-53364877317:46
tpbTitle: timer: add documentation by xobs · Pull Request #259 · enjoy-digital/litex · GitHub (at github.com)17:46
*** freemint has joined #litex17:56
*** freemint has quit IRC18:14
*** rohitksingh has joined #litex18:28
*** freemint has joined #litex18:51
*** rohitksingh has quit IRC19:16
*** freemint has quit IRC19:23
mithroxobs: with that syntax, it is pretty trivial to write a sphinx extension which takes all those sections and pulls it together.19:55
*** rohitksingh has joined #litex20:12
*** rohitksingh has quit IRC20:23
*** rohitksingh has joined #litex20:24
*** rohitksingh has quit IRC20:41
*** freemint has joined #litex21:32
*** rohitksingh has joined #litex21:38
*** rohitksingh has quit IRC21:53
*** rohitksingh has joined #litex21:55
*** pizzaman1 has joined #litex23:30
*** pizzaman has quit IRC23:32
*** pizzaman1 has quit IRC23:36

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!