Skip to content
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

feat: Text.Parsec.Number #56

Merged
merged 27 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
76d2540
feat: implemented Text.Parsec.Combinators.between, and implemented in…
leoslf Jun 5, 2024
0214ab0
ci: trigger pipeline
leoslf Jun 5, 2024
d0f9470
ci: remove python 2.7
leoslf Jun 5, 2024
761758e
ci: remove python < 3.6
leoslf Jun 5, 2024
ca6ff27
ci: remove from __future__ import annotations
leoslf Jun 5, 2024
631c602
ci: remove typing from src/parsec/__init__.py
leoslf Jun 5, 2024
2aad4ac
chore: continue to mark supporting old python version
leoslf Jun 5, 2024
a33f561
refactor: remove typing from src/parsec/__init__.py
leoslf Jun 5, 2024
508867c
ci: show missing lines on coverage
leoslf Jun 5, 2024
9dda772
refactor: remove edge case
leoslf Jun 5, 2024
32e435d
ci: added mypy for type checking
leoslf Jun 5, 2024
847110a
test: backward compatibility
leoslf Jun 5, 2024
a07049f
ci: only run mypy on python >= 3.8
leoslf Jun 5, 2024
78007fb
feat: added try_choices_longest
leoslf Jun 5, 2024
3aa2c39
refactor: show results in failure message
leoslf Jun 5, 2024
d9bbd43
refactor: use inspect instead of catching TypeError
leoslf Jun 5, 2024
7bba029
refactor: use inspect instead of catching TypeError
leoslf Jun 5, 2024
ecf203e
feat: implemented __repr__
leoslf Jun 5, 2024
66fb27f
refactor: use named function for mark
leoslf Jun 5, 2024
2993a2d
refactor: use named function for mark
leoslf Jun 5, 2024
a6d7118
chore: also show the parser that failed in try_choices_longest
leoslf Jun 5, 2024
50e5600
chore: also show the parser that failed in try_choices_longest and ca…
leoslf Jun 5, 2024
8ecd7f9
feat: infer if we do starmap
leoslf Jun 5, 2024
50b2f99
feat: implemented newline, crlf and end_of_line
leoslf Jun 5, 2024
3c0a0ce
refactor: fixed declaration
leoslf Jun 5, 2024
9e61934
refactor: fixed declaration
leoslf Jun 5, 2024
3ab3d50
refactor: remove auto starmap
leoslf Jun 5, 2024
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
15 changes: 15 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[run]
relative_files = True
branch = True
omit =
test_*.py
src/parsec/tests/*

# coverage.py does not currenly handle @overload decorated methods gracefully.
# overloaded methods should be ignored because they are not allowed to contain code
[report]
exclude_lines =
pragma: not covered
@overload
\.\.\.
if TYPE_CHECKING:
11 changes: 9 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- run: python setup.py test
- run: pip install -e .[dev]

- run: coverage run setup.py test
- run: coverage report -m

- if: ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
run: mypy .

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ docs/_build/

# PyBuilder
target/

# venv
.venv/
15 changes: 15 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[mypy]
pretty = True
mypy_path = $MYPY_CONFIG_FILE_DIR/src
packages = parsec
exclude = docs/|examples/|build/lib|src/parsec/tests

explicit_package_bases = True
check_untyped_defs = True
implicit_reexport = True
show_error_codes = True
show_column_numbers = True
follow_imports = silent

warn_redundant_casts = True
warn_unused_ignores = True
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
from setuptools import setup, find_packages # type: ignore[import-untyped]

setup(
name = 'parsec',
version = '3.15',
version = '3.16',
description = 'parser combinator.',
long_description = 'A universal Python parser combinator library inspired by Parsec library of Haskell.',
author = 'He Tao',
Expand Down Expand Up @@ -33,14 +33,22 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'License :: OSI Approved :: MIT License',
],
platforms = 'any',
keywords = 'monad parser combinator',

install_requires = [
'enum34; python_version < "3.5"',
'setuptools',
],
extras_require={
'dev': [
'mypy',
'coverage',
],
},
package_dir = {'': 'src'},
packages = find_packages('src'),
package_data = {'': ('py.typed', '*.pyi')},
Expand Down
Loading
Loading