From 1a06859536950c3434e7b5bbaf43d9c1c54f12e9 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 05:58:39 -0400 Subject: [PATCH 1/8] update lark --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ef4c772..12df550 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ install_requires=( [ "dateparser", - "lark<1.0", + "lark", "pygeoif>=1.0.0", "dataclasses;python_version<'3.7'", ] From 60d702810eb1102b1d83b18b02c29b0343a4f5af Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 06:33:17 -0400 Subject: [PATCH 2/8] meta false --- pygeofilter/parsers/cql2_text/parser.py | 2 +- pygeofilter/parsers/ecql/parser.py | 2 +- pygeofilter/parsers/iso8601.py | 2 +- pygeofilter/parsers/wkt.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pygeofilter/parsers/cql2_text/parser.py b/pygeofilter/parsers/cql2_text/parser.py index b61a6e5..2a1678f 100644 --- a/pygeofilter/parsers/cql2_text/parser.py +++ b/pygeofilter/parsers/cql2_text/parser.py @@ -38,7 +38,7 @@ logger.setLevel(logging.DEBUG) -@v_args(inline=True) +@v_args(meta=False, inline=True) class CQLTransformer(WKTTransformer, ISO8601Transformer): def and_(self, *args): return ast.And.from_items(*args) diff --git a/pygeofilter/parsers/ecql/parser.py b/pygeofilter/parsers/ecql/parser.py index 2a1c4f7..08ff0de 100644 --- a/pygeofilter/parsers/ecql/parser.py +++ b/pygeofilter/parsers/ecql/parser.py @@ -48,7 +48,7 @@ } -@v_args(inline=True) +@v_args(meta=False, inline=True) class ECQLTransformer(WKTTransformer, ISO8601Transformer): def and_(self, lhs, rhs): return ast.And(lhs, rhs) diff --git a/pygeofilter/parsers/iso8601.py b/pygeofilter/parsers/iso8601.py index 30ab90a..0de92d3 100644 --- a/pygeofilter/parsers/iso8601.py +++ b/pygeofilter/parsers/iso8601.py @@ -30,7 +30,7 @@ from ..util import parse_datetime, parse_duration -@v_args(inline=True) +@v_args(meta=False, inline=True) class ISO8601Transformer(Transformer): def DATETIME(self, dt): return parse_datetime(dt) diff --git a/pygeofilter/parsers/wkt.py b/pygeofilter/parsers/wkt.py index 8416a78..bf9c530 100644 --- a/pygeofilter/parsers/wkt.py +++ b/pygeofilter/parsers/wkt.py @@ -28,7 +28,7 @@ from lark import Transformer, v_args -@v_args(inline=True) +@v_args(meta=False, inline=True) class WKTTransformer(Transformer): def wkt__geometry_with_srid(self, srid, geometry): print(srid, geometry) From d030a52e3e80d2bcc12cf00bdbebff77d99f7ac3 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 06:49:49 -0400 Subject: [PATCH 3/8] try at 1.0.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 12df550..49d8cfd 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ install_requires=( [ "dateparser", - "lark", + "lark<=1.0.0", "pygeoif>=1.0.0", "dataclasses;python_version<'3.7'", ] From 7256c48935576d82c737c0ee76cd2b3afff77901 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 06:54:45 -0400 Subject: [PATCH 4/8] remove 3/4 position for now --- pygeofilter/parsers/wkt.lark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygeofilter/parsers/wkt.lark b/pygeofilter/parsers/wkt.lark index a0d08cf..0d24f3e 100644 --- a/pygeofilter/parsers/wkt.lark +++ b/pygeofilter/parsers/wkt.lark @@ -51,7 +51,7 @@ coordinate_lists: "(" coordinate_list ")" ( "," "(" coordinate_list ")" )* ?coordinate_list: coordinate_list "," coordinate | coordinate -> coordinate_list_start -coordinate: SIGNED_NUMBER SIGNED_NUMBER [ SIGNED_NUMBER [ SIGNED_NUMBER ] ] +coordinate: SIGNED_NUMBER SIGNED_NUMBER // NUMBER: /-?\d+\.?\d+/ %import common.NUMBER From 0d0cea974968686dcf0c0532a9819decac993b12 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 07:32:49 -0400 Subject: [PATCH 5/8] maybe_placeholders=False --- pygeofilter/parsers/ecql/parser.py | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pygeofilter/parsers/ecql/parser.py b/pygeofilter/parsers/ecql/parser.py index 08ff0de..48a2b63 100644 --- a/pygeofilter/parsers/ecql/parser.py +++ b/pygeofilter/parsers/ecql/parser.py @@ -201,6 +201,7 @@ def envelope(self, x1, x2, y1, y2): rel_to=__file__, parser="lalr", debug=True, + maybe_placeholders=False, transformer=ECQLTransformer(), import_paths=[os.path.dirname(os.path.dirname(__file__))], ) diff --git a/setup.py b/setup.py index 49d8cfd..12df550 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ install_requires=( [ "dateparser", - "lark<=1.0.0", + "lark", "pygeoif>=1.0.0", "dataclasses;python_version<'3.7'", ] From a0dd0347a42decd7442bbd0948762d5a257302e7 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 07:38:19 -0400 Subject: [PATCH 6/8] move to 3.8+ --- .github/workflows/main.yml | 2 +- CONTRIBUTING.md | 2 +- pygeofilter/parsers/cql2_text/parser.py | 1 + pygeofilter/parsers/wkt.lark | 2 +- setup.py | 5 +++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a48923f..4481304 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.7', '3.8', '3.9'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1d96d3..401021f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ Before submitting a bug, please do the following: Make sure your report gets the attention it deserves: bug reports with missing information may be ignored or punted back to you, delaying a fix. The below constitutes a bare minimum; more info is almost always better: -* __What version of Python are you using?__ For example, are you using Python 2.7, Python 3.7, PyPy 2.0? +* __What version of Python are you using?__ For example, are you using Python 3.8+, PyPy 2.0? * __What operating system are you using?__ Windows (7, 8, 10, 32-bit, 64-bit), Mac OS X, (10.7.4, 10.9.0), GNU/Linux (which distribution, which version?) Again, more detail is better. * __Which version or versions of the software are you using?__ Ideally, you've followed the advice above and are on the latest version, but please confirm this. * __How can the we recreate your problem?__ Imagine that we have never used pygeofilter before and have downloaded it for the first time. Exactly what steps do we need to take to reproduce your problem? diff --git a/pygeofilter/parsers/cql2_text/parser.py b/pygeofilter/parsers/cql2_text/parser.py index 2a1678f..ff1cd34 100644 --- a/pygeofilter/parsers/cql2_text/parser.py +++ b/pygeofilter/parsers/cql2_text/parser.py @@ -202,6 +202,7 @@ def interval(self, start, end): rel_to=__file__, parser="lalr", debug=True, + maybe_placeholders=False, transformer=CQLTransformer(), import_paths=[os.path.dirname(os.path.dirname(__file__))], ) diff --git a/pygeofilter/parsers/wkt.lark b/pygeofilter/parsers/wkt.lark index 0d24f3e..a0d08cf 100644 --- a/pygeofilter/parsers/wkt.lark +++ b/pygeofilter/parsers/wkt.lark @@ -51,7 +51,7 @@ coordinate_lists: "(" coordinate_list ")" ( "," "(" coordinate_list ")" )* ?coordinate_list: coordinate_list "," coordinate | coordinate -> coordinate_list_start -coordinate: SIGNED_NUMBER SIGNED_NUMBER +coordinate: SIGNED_NUMBER SIGNED_NUMBER [ SIGNED_NUMBER [ SIGNED_NUMBER ] ] // NUMBER: /-?\d+\.?\d+/ %import common.NUMBER diff --git a/setup.py b/setup.py index 12df550..a11620d 100644 --- a/setup.py +++ b/setup.py @@ -76,10 +76,11 @@ "Intended Audience :: Developers", "Topic :: Scientific/Engineering :: GIS", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], tests_require=["pytest"], ) From fd374b24e08cb2e4723f2106490d79ac45cc06b5 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 07:43:20 -0400 Subject: [PATCH 7/8] limit the python due to ubuntu version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4481304..4928cef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 2bbb8d48e877b82069c52085f62e53d1cc53fc41 Mon Sep 17 00:00:00 2001 From: "Michael D. Smith" Date: Thu, 17 Oct 2024 07:50:34 -0400 Subject: [PATCH 8/8] 3.10 max? --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4928cef..41534b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2