Skip to content

Commit

Permalink
remove python 3.11 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gruebel committed May 21, 2022
1 parent e9d8676 commit 7c3d50e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
experimental: [false]
include:
- os: ubuntu-latest
python-version: "3.11-dev"
experimental: true
# include:
# - os: ubuntu-latest
# python-version: "3.12-dev"
# experimental: true
fail-fast: false
continue-on-error: ${{ matrix.experimental }}
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
additional_dependencies:
- flake8-bugbear==22.4.25
- flake8-builtins==1.5.3
- flake8-comprehensions==3.9.0
- flake8-comprehensions==3.10.0
- flake8-pytest-style==1.6.0
- flake8-typing-imports==1.12.0
- pep8-naming==0.12.1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Support property accessor for `json` function
- Support Python 3.11 officially

## [0.3.5] - 2022-05-15

Expand Down
35 changes: 27 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions pycep/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from importlib import resources
import sys
from pathlib import Path

from lark import Lark, Token, Tree
Expand All @@ -9,7 +9,12 @@

from .transformer import BicepToJson

LARK_GRAMMAR = resources.read_text(__package__, "bicep.lark")
if sys.version_info >= (3, 9): # pragma: no cover
from importlib.resources import files
else:
from importlib_resources import files

LARK_GRAMMAR = (files(__package__) / "bicep.lark").read_text()


class BicepParser:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ python = "^3.7"
lark = ">=1.1.2"
regex = ">=2022.1.18"
typing-extensions = ">=3.10.0"
importlib-resources = {version = ">=2.0.0", python = "<3.9"}

[tool.poetry.dev-dependencies]
assertpy = "^1.1"
Expand All @@ -40,7 +41,7 @@ black = "^22.3.0"
flake8 = "^4.0.1"
flake8-bugbear = "^22.4.25"
flake8-builtins = "^1.5.3"
flake8-comprehensions = "^3.9.0"
flake8-comprehensions = "^3.10.0"
flake8-pytest-style = "^1.6.0"
flake8-typing-imports = "^1.12.0"
isort = "^5.10.1"
Expand Down

0 comments on commit 7c3d50e

Please sign in to comment.