Skip to content

Commit 901f0ab

Browse files
renefritzeZachery Crandall
andauthored
Update antlr (#165)
* bump antlr for python 3.13 compat * ci| add python 3.13 * fix python 3.12 compat for missing pkg_resources * update generated code from antlr 4.13.2 * remove Python version that is EOL * update GHA versions * update pypi deploy test workflow runner * do not mix user and global pip install * Apply suggestion from @zachcran Co-authored-by: Zachery Crandall <zachcran@gmail.com> * Apply suggestion from @zachcran Co-authored-by: Zachery Crandall <zachcran@gmail.com> * Apply suggestion from @zachcran Co-authored-by: Zachery Crandall <zachcran@gmail.com> * Use virtual environment to help isolate installations * Ensure absolute path to venv python binary --------- Co-authored-by: Zachery Crandall <zachcran@gmail.com>
1 parent 32f8157 commit 901f0ab

10 files changed

Lines changed: 178 additions & 170 deletions

File tree

.github/workflows/cmake_install.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525

2626
strategy:
2727
matrix:
28-
python_version: ['3.8.13', '3.9.13', '3.10.5']
28+
python_version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2929

3030
steps:
31-
- uses: actions/checkout@v1
31+
- uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
34-
- uses: actions/setup-python@v4
34+
- uses: actions/setup-python@v5
3535
with:
3636
python-version: ${{ matrix.python_version }}
37-
- uses: lukka/get-cmake@v3.20.1
37+
- uses: lukka/get-cmake@v4.0.3
3838
- name: Build
3939
run: |
4040
python3 --version

.github/workflows/pip_install.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
python_version: ['3.8.13', '3.9.13', '3.10.5', '3.11.2']
3232

3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 0
37-
- uses: actions/setup-python@v4
37+
- uses: actions/setup-python@v5
3838
with:
3939
python-version: ${{ matrix.python_version }}
4040
- name: Build

.github/workflows/test_pip_install.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 CMakePP
1+
# Copyright 2022 CMakePP
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -19,24 +19,30 @@ on:
1919
pull_request:
2020
branches:
2121
- master
22-
22+
2323
jobs:
2424
test_release:
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v2
29-
- name: Get the tags
30-
run: git fetch --all --tags
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
fetch-tags: true
32+
- name: Create Python virtual environment
33+
id: venv
34+
run: |
35+
python -m venv venv
36+
echo "python=$PWD/venv/bin/python3" >> $GITHUB_OUTPUT
3137
- name: Install Python's "build" package
32-
run: python -m pip install build twine --user
38+
run: ${{ steps.venv.outputs.python }} -m pip install build twine packaging>=24.2
3339
- name: Build binary wheel and source tarball
34-
run: python -m build --sdist --wheel --outdir dist/
40+
run: ${{ steps.venv.outputs.python }} -m build --sdist --wheel --outdir dist/
3541
- name: Test Long Description
36-
run: twine check dist/*
42+
run: ${{ steps.venv.outputs.python }} -m twine check dist/*
3743
- name: Test built package
3844
run: |
39-
pip install pytest
40-
pip install --user dist/*.tar.gz
45+
${{ steps.venv.outputs.python }} -m pip install pytest
46+
${{ steps.venv.outputs.python }} -m pip install dist/*.tar.gz
4147
cd tests
42-
python -B test_all.py
48+
${{ steps.venv.outputs.python }} -B test_all.py

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ classifiers = ["Development Status :: 5 - Production/Stable",
3434
]
3535
urls = {"GitHub" = "https://github.com/CMakePP/CMinx"}
3636
scripts = {"cminx" = "cminx:main"}
37-
dependencies = ["antlr4-python3-runtime==4.7.2",
37+
dependencies = ["antlr4-python3-runtime==4.13.2",
3838
"confuse>=1.7",
3939
"pathspec>=0.9.0"
4040
]

src/cminx/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434
import pathspec
3535
from confuse import Configuration
36-
from pkg_resources import get_distribution, DistributionNotFound
36+
from importlib.metadata import version, PackageNotFoundError
3737

3838
from .config import config_template, dict_to_settings, Settings
3939
from .documenter import Documenter
4040
from .rstwriter import RSTWriter
4141

4242
try:
43-
__version__ = get_distribution(__name__).version
44-
except DistributionNotFound:
43+
__version__ = version(__name__)
44+
except PackageNotFoundError:
4545
# package is not installed
4646
__version__ = "UNKNOWN"
4747

src/cminx/parser/CMake.interp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ compound_argument
4545

4646

4747
atn:
48-
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 17, 60, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 3, 2, 5, 2, 18, 10, 2, 3, 2, 3, 2, 3, 2, 7, 2, 23, 10, 2, 12, 2, 14, 2, 26, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 7, 6, 41, 10, 6, 12, 6, 14, 6, 44, 11, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 7, 8, 53, 10, 8, 12, 8, 14, 8, 56, 11, 8, 3, 8, 3, 8, 3, 8, 2, 2, 9, 2, 4, 6, 8, 10, 12, 14, 2, 3, 4, 2, 9, 10, 12, 13, 2, 60, 2, 17, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 32, 3, 2, 2, 2, 8, 34, 3, 2, 2, 2, 10, 36, 3, 2, 2, 2, 12, 47, 3, 2, 2, 2, 14, 49, 3, 2, 2, 2, 16, 18, 5, 6, 4, 2, 17, 16, 3, 2, 2, 2, 17, 18, 3, 2, 2, 2, 18, 24, 3, 2, 2, 2, 19, 23, 5, 4, 3, 2, 20, 23, 5, 10, 6, 2, 21, 23, 5, 8, 5, 2, 22, 19, 3, 2, 2, 2, 22, 20, 3, 2, 2, 2, 22, 21, 3, 2, 2, 2, 23, 26, 3, 2, 2, 2, 24, 22, 3, 2, 2, 2, 24, 25, 3, 2, 2, 2, 25, 27, 3, 2, 2, 2, 26, 24, 3, 2, 2, 2, 27, 28, 7, 2, 2, 3, 28, 3, 3, 2, 2, 2, 29, 30, 5, 8, 5, 2, 30, 31, 5, 10, 6, 2, 31, 5, 3, 2, 2, 2, 32, 33, 7, 5, 2, 2, 33, 7, 3, 2, 2, 2, 34, 35, 7, 6, 2, 2, 35, 9, 3, 2, 2, 2, 36, 37, 7, 9, 2, 2, 37, 42, 7, 3, 2, 2, 38, 41, 5, 12, 7, 2, 39, 41, 5, 14, 8, 2, 40, 38, 3, 2, 2, 2, 40, 39, 3, 2, 2, 2, 41, 44, 3, 2, 2, 2, 42, 40, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 45, 3, 2, 2, 2, 44, 42, 3, 2, 2, 2, 45, 46, 7, 4, 2, 2, 46, 11, 3, 2, 2, 2, 47, 48, 9, 2, 2, 2, 48, 13, 3, 2, 2, 2, 49, 54, 7, 3, 2, 2, 50, 53, 5, 12, 7, 2, 51, 53, 5, 14, 8, 2, 52, 50, 3, 2, 2, 2, 52, 51, 3, 2, 2, 2, 53, 56, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 57, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 57, 58, 7, 4, 2, 2, 58, 15, 3, 2, 2, 2, 9, 17, 22, 24, 40, 42, 52, 54]
48+
[4, 1, 15, 58, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 1, 0, 3, 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, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 43, 1, 0, 0, 0, 42, 40, 1, 0, 0, 0, 43, 44, 5, 2, 0, 0, 44, 9, 1, 0, 0, 0, 45, 46, 7, 0, 0, 0, 46, 11, 1, 0, 0, 0, 47, 52, 5, 1, 0, 0, 48, 51, 3, 10, 5, 0, 49, 51, 3, 12, 6, 0, 50, 48, 1, 0, 0, 0, 50, 49, 1, 0, 0, 0, 51, 54, 1, 0, 0, 0, 52, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 55, 1, 0, 0, 0, 54, 52, 1, 0, 0, 0, 55, 56, 5, 2, 0, 0, 56, 13, 1, 0, 0, 0, 7, 15, 20, 22, 38, 40, 50, 52]

0 commit comments

Comments
 (0)