Releases: jayqi/reprexlite
Releases · jayqi/reprexlite
v1.0.0
This release involves major changes to reprexlite. There is a significant refactoring of the library internals and also many changes to the API. This enabled new feature and more customizability.
This release also removes support for Python 3.6, 3.7, and 3.8.
CLI and IPython User Interfaces
Added
- Added a new
--editor/-eoption to specify what editor to use. If not used, this has same behavior as before. This option is also the new way to launch the IPython interactive shell editor (by passingipython). - Added new options to control parsing and output style.
--promptand--continuationoptions let you set the primary and secondary prompt prefixes in rendered output. These default to empty srings""for "reprex-style" output.- A new
--parsing-methodoption controls input-parsing behavior.- The default value
autocan automatically handle "reprex-style" input as well as "doctest-style`/Python REPL input. - A value
declaredwill use the values of--prompt,--continuation, and--commentfor parsing input in addition to styling output. To handle input and output with different styes, you can override input-side values with the--input-prompt,--input-continuation, and--input-commentoptions.
- The default value
- Added support for configuration files, including support for
[tool.reprexlite]inpyproject.tomlfiles and for user-level configuration. See "Configuration" for more details.
Changed
- Changed the way to access the IPython interactive shell editor. This is now launched by using the new
--editor/-eoption by passingipython. The IPython shell editor also now respects other command line configuration options. It is now considered a stable feature and is no longer experimental. - Renamed the
--old-resultsoption to--keep-old-results.
Fixed
- Fixed bug that silenced output when using the IPython cell magic or the IPython shell editor and encountering an error where reprexlite couldn't render your code (such as a syntax error). This should now display an informative error message.
Library
Added
- Added new
reprexlite.parsingmodule which contains functions for parsing input. These functions yield tuples representing lines of the input with an enum indicating whether the line is code or a result. - Added new
reprexlite.reprexesmodule which contains code for evaluating a reprex.- The new
Reprexdataclass serves as the main container for reprex data. It holds parallel lists ofStatement,ParsedResult, andRawResultdata.- The
Reprex.from_input_linesfactory method creates aReprexfrom the output of thereprexlite.parsingparsing functions. - The
Reprex.from_inputfactory method wraps parsing and takes a string input.
- The
- The
Statementdataclass holds code data and parsed concrete syntax tree. This serves a similar purpose to the oldStatementclass. - The
ParsedResultdataclass holds old evaluation results parsed from the input, if any. - The
RawResultdataclass holds the returned values from evaluating code. This serves a similar purpose to the oldResultclass.
- The new
- Added new
reprexlite.configmodule andReprexConfigdataclass for holding configuration values. - Added new
reprexlite.exceptionsmodule with exception classes that subclass a base exception classReprexliteException.
Changed
- Changed formatting abstractions in
reprexlite.formattingmodule.- Rather than
*Reprexclasses that encapsulate reprex data, we now have formatter callables and take a rendered reprex output string as input and appropriately prepares the reprex output for a venue, such as adding venue-specific markup. - The
venues_dispatcherdictionary inreprexlite.formattingis now aformatter_registrydictionary-like. - Formatters are added to the registry using a
formatter_registry.registerdecorator instead of being hard-coded.
- Rather than
Removed
- Removed
reprexlite.codemodule. The functionality in this module was reimplemented in the newreprexlite.reprexesandreprexlite.parsingmodules. - Removed
reprexlite.reprexmodule. Thereprexfunction has been moved toreprexlite.reprexes.
General
Added
- Added a "Rendering and Output Venues" page to the documentation that documents the different formatting options with examples.
- Added a "Configuration" page to the documentation that provides a reference for configuration options and documents how to use configuration files.
- Added an "Alternatives" page to the documentation that documents alternative tools.
Changed
- Changed reprexlite to use a pyproject.toml-based build process and metadata declaration.
- Renamed
HISTORY.mdtoCHANGELOG.md.
v1.0.0a1
This is an early version of the 1.0.0 changes that has been available on the main branch of the repository since February 2023. It is being released as a pre-release version in case anyone wants to continue using it. Further significant changes are planned for the final 1.0.0 release.
This release involves major changes to reprexlite. There is a significant refactoring of the library internals and also many changes to the API. This enabled new feature and more customizability.
CLI and IPython User Interfaces
Added
- Added a new
--editor/-eoption to specify what editor to use. If not used, this has same behavior as before. This option is also the new way to launch the IPython interactive shell editor (by passingipython). - Added new options to control parsing and output style.
--promptand--continuationoptions let you set the primary and secondary prompt prefixes in rendered output. These default to empty srings""for "reprex-style" output.- A new
--parsing-methodoption controls input-parsing behavior.- The default value
autocan automatically handle "reprex-style" input as well as "doctest-style`/Python REPL input. - A value
declaredwill use the values of--prompt,--continuation, and--commentfor parsing input in addition to styling output. To handle input and output with different styes, you can override input-side values with the--input-prompt,--input-continuation, and--input-commentoptions.
- The default value
Changed
- Changed the way to access the IPython interactive shell editor. This is now launched by using the new
--editor/-eoption by passingipython. The IPython shell editor also now respects other command line configuration options. It is now considered a stable feature and is no longer experimental. - Renamed the
--old-resultsoption to--keep-old-results.
Fixed
- Fixed bug that silenced output when using the IPython cell magic or the IPython shell editor and encountering an error where reprexlite couldn't render your code (such as a syntax error). This should now display an informative error message.
Library
Added
- Added new
reprexlite.parsingmodule which contains functions for parsing input. These functions yield tuples representing lines of the input with an enum indicating whether the line is code or a result. - Added new
reprexlite.reprexesmodule which contains code for evaluating a reprex.- The new
Reprexdataclass serves as the main container for reprex data. It holds parallel lists ofStatement,ParsedResult, andRawResultdata.- The
Reprex.from_input_linesfactory method creates aReprexfrom the output of thereprexlite.parsingparsing functions. - The
Reprex.from_inputfactory method wraps parsing and takes a string input.
- The
- The
Statementdataclass holds code data and parsed concrete syntax tree. This serves a similar purpose to the oldStatementclass. - The
ParsedResultdataclass holds old evaluation results parsed from the input, if any. - The
RawResultdataclass holds the returned values from evaluating code. This serves a similar purpose to the oldResultclass.
- The new
- Added new
reprexlite.configmodule andReprexConfigdataclass for holding configuration values. - Added new
reprexlite.exceptionsmodule with exception classes that subclass a base exception classReprexliteException.
Changed
- Changed formatting abstractions in
reprexlite.formattingmodule.- Rather than
*Reprexclasses that encapsulate reprex data, we now have*Formatterclasses and take a rendered reprex output string as input to aformatclass method that appropriately prepares the reprex output for a venue, such as adding venue-specific markup. - The
venues_dispatcherdictionary inreprexlite.formattingis now aformatter_registrydictionary. - Formatters are added to the registry using a
register_formatterdecorator instead of being hard-coded.
- Rather than
Removed
- Removed
reprexlite.codemodule. The functionality in this module was reimplemented in the newreprexlite.reprexesandreprexlite.parsingmodules. - Removed
reprexlite.reprexmodule. Thereprexfunction has been moved toreprexlite.reprexes.
General
Added
- Added an "Alternatives" page to the documentation that documents alternative tools.
- Added a "Venues Formatting" page to the documentation that documents the different formatting options with examples.
Changed
- Changed reprexlite to use a pyproject.toml-based build process and metadata declaration.
- Renamed
HISTORY.mdtoCHANGELOG.md.
v0.5.0
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.0
- Overwriting old results from reprex inputs: (#8)
- Changed reprexes to—by default—remove lines matching the
commentprefix (#>by default). This means that if your input code is a previously rendered reprex, the old results will be removed first and you effectively regenerate it. - Added a new option
old_resultsthat—if set to True—will preserve such lines.
- Changed reprexes to—by default—remove lines matching the
- Fixed a bug that caused intentional blank lines to be removed. (#7)
- Added stdout capturing. Any content printed to stdout will be shown as a result in the reprex. (#10)
- Added exception handling and stacktrace capture. If the input code has an exception, the stacktrace will be shown as a result in the reprex. (#12)