Skip to content

Commit

Permalink
Merge pull request #56 from leoslf/master
Browse files Browse the repository at this point in the history
feat: `Text.Parsec.Number`
  • Loading branch information
sighingnow authored Jun 6, 2024
2 parents 92a6e96 + 3ab3d50 commit ca93663
Show file tree
Hide file tree
Showing 8 changed files with 491 additions and 94 deletions.
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

0 comments on commit ca93663

Please sign in to comment.