Skip to content

Commit ebf374e

Browse files
authored
Merge pull request #69 from python-parsy/docstrings-and-types
Docstrings and types
2 parents 41b9698 + 9380385 commit ebf374e

File tree

14 files changed

+308
-118
lines changed

14 files changed

+308
-118
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "pypy-3.6"]
18+
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "pypy-3.7"]
1919

2020
env:
2121
PYTHON: ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
rev: v2.26.0
2424
hooks:
2525
- id: pyupgrade
26-
entry: pyupgrade --py3-plus --py36-plus --keep-runtime-typing
26+
entry: pyupgrade --py3-plus --py36-plus --py37-plus --keep-runtime-typing
2727
language_version: python3.9
2828
- repo: https://github.com/myint/autoflake
2929
rev: 'v1.4'

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ monadic parser combinator library for LL(infinity) grammars in the spirit of
1111
<https://github.com/jneen/parsimmon>`_. But don't worry, it has really good
1212
documentation and it doesn't say things like that!
1313

14-
Parsy requires Python 3.6 or greater.
14+
Parsy requires Python 3.7 or greater.
1515

1616
For a good example of the kind of clear, declarative code you can create using
1717
parsy, see the `SQL SELECT statement example

conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import sys
2-
3-
collect_ignore = []
4-
5-
if sys.version_info < (3, 7):
6-
# Python 3.6 and below don't have `dataclasses`
7-
collect_ignore = ["examples/sql_select.py"]

docs/history.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ History and release notes
44

55
.. currentmodule:: parsy
66

7+
2.1 - unreleased
8+
----------------
9+
10+
* Dropped support for Python 3.7
11+
* Added docstrings and basic type hints to all primitives and main methods
12+
13+
714
2.0 - 2022-09-08
815
----------------
916

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ parsy can be installed with pip::
77
pip install parsy
88

99

10-
Python 3.6 or greater is required.
10+
Python 3.7 or greater is required.

docs/ref/methods_and_combinators.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ can be used and manipulated as below.
145145
>>> string('A').optional('Oops').parse('')
146146
'Oops'
147147
148-
.. method:: map(fn)
148+
.. method:: map(map_function)
149149

150150
Returns a parser that transforms the produced value of the initial parser
151-
with ``fn``.
151+
with ``map_function``.
152152

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

161-
.. method:: combine(fn)
161+
.. method:: combine(combine_fn)
162162

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

166166
Where the current parser produces an iterable of values, this can be a
167167
more convenient way to combine them than :meth:`~Parser.map`.

docs/ref/primitives.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ These are the lowest level building blocks for creating parsers.
196196

197197
.. function:: peek(parser)
198198

199-
Returns a lookahead parser that parse the input stream without consuming
199+
Returns a lookahead parser that parses the input stream without consuming
200200
chars.
201201

202202
.. code-block: python

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.black]
22
line-length = 119
33
# required-version = '22.1.0' # see https://github.com/psf/black/issues/2493
4-
target-version = ['py36']
4+
target-version = ['py310']
55

66
[tool.isort]
77
line_length = 119

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
maintainer_email="[email protected]",
2525
url="https://github.com/python-parsy/parsy",
2626
license="MIT",
27-
python_requires=">=3.6",
27+
python_requires=">=3.7",
2828
classifiers=[
2929
"Development Status :: 5 - Production/Stable",
3030
"Intended Audience :: Developers",
@@ -33,7 +33,6 @@
3333
"Topic :: Text Processing",
3434
"License :: OSI Approved :: MIT License",
3535
"Programming Language :: Python :: 3",
36-
"Programming Language :: Python :: 3.6",
3736
"Programming Language :: Python :: 3.7",
3837
"Programming Language :: Python :: 3.8",
3938
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)