Skip to content

Docstrings and types #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "pypy-3.6"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "pypy-3.7"]

env:
PYTHON: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: v2.26.0
hooks:
- id: pyupgrade
entry: pyupgrade --py3-plus --py36-plus --keep-runtime-typing
entry: pyupgrade --py3-plus --py36-plus --py37-plus --keep-runtime-typing
language_version: python3.9
- repo: https://github.com/myint/autoflake
rev: 'v1.4'
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ monadic parser combinator library for LL(infinity) grammars in the spirit of
<https://github.com/jneen/parsimmon>`_. But don't worry, it has really good
documentation and it doesn't say things like that!

Parsy requires Python 3.6 or greater.
Parsy requires Python 3.7 or greater.

For a good example of the kind of clear, declarative code you can create using
parsy, see the `SQL SELECT statement example
Expand Down
7 changes: 0 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
import sys

collect_ignore = []

if sys.version_info < (3, 7):
# Python 3.6 and below don't have `dataclasses`
collect_ignore = ["examples/sql_select.py"]
7 changes: 7 additions & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ History and release notes

.. currentmodule:: parsy

2.1 - unreleased
----------------

* Dropped support for Python 3.7
* Added docstrings and basic type hints to all primitives and main methods


2.0 - 2022-09-08
----------------

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ parsy can be installed with pip::
pip install parsy


Python 3.6 or greater is required.
Python 3.7 or greater is required.
8 changes: 4 additions & 4 deletions docs/ref/methods_and_combinators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ can be used and manipulated as below.
>>> string('A').optional('Oops').parse('')
'Oops'

.. method:: map(fn)
.. method:: map(map_function)

Returns a parser that transforms the produced value of the initial parser
with ``fn``.
with ``map_function``.

.. code:: python

Expand All @@ -158,10 +158,10 @@ can be used and manipulated as below.
This is the simplest way to convert parsed strings into the data types
that you need. See also :meth:`combine` and :meth:`combine_dict` below.

.. method:: combine(fn)
.. method:: combine(combine_fn)

Returns a parser that transforms the produced values of the initial parser
with ``fn``, passing the arguments using ``*args`` syntax.
with ``combine_fn``, passing the arguments using ``*args`` syntax.

Where the current parser produces an iterable of values, this can be a
more convenient way to combine them than :meth:`~Parser.map`.
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/primitives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ These are the lowest level building blocks for creating parsers.

.. function:: peek(parser)

Returns a lookahead parser that parse the input stream without consuming
Returns a lookahead parser that parses the input stream without consuming
chars.

.. code-block: python
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.black]
line-length = 119
# required-version = '22.1.0' # see https://github.com/psf/black/issues/2493
target-version = ['py36']
target-version = ['py310']

[tool.isort]
line_length = 119
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
maintainer_email="[email protected]",
url="https://github.com/python-parsy/parsy",
license="MIT",
python_requires=">=3.6",
python_requires=">=3.7",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -33,7 +33,6 @@
"Topic :: Text Processing",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
Loading