diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index a13f3d7..02c1d47 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -2,6 +2,7 @@ name: CI Documentation on: [push, pull_request] +permissions: {} jobs: build: runs-on: ubuntu-24.04 @@ -13,10 +14,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 7da0a40..d8b5487 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,15 +18,18 @@ on: tags: - "v*.*.*" +permissions: {} jobs: build-pypi-distribs: name: Build and publish library to PyPI runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: 3.12 @@ -40,13 +43,16 @@ jobs: run: python -m twine check dist/* - name: Upload built archives - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f with: name: pypi_archives path: dist/* create-gh-release: + permissions: + contents: write # to create GitHub release (softprops/action-gh-release) + name: Create GH release needs: - build-pypi-distribs @@ -54,13 +60,13 @@ jobs: steps: - name: Download built archives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 with: name: pypi_archives path: dist - name: Create GH release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda with: draft: true files: dist/* @@ -77,11 +83,11 @@ jobs: steps: - name: Download built archives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 with: name: pypi_archives path: dist - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b \ No newline at end of file diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..aa8259d --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,24 @@ +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-latest + permissions: + security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cd157e9..e8f8336 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Changelog ========= +v0.7.2 +------ + +- Relax version constraints and update dependencies + + v0.7.1 ------ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index acd56a4..5fa17e8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,3 +24,13 @@ jobs: all: | sudo apt-get install universal-ctags gettext venv/bin/pytest -n 2 -vvs + +# - template: etc/ci/azure-posix.yml +# parameters: +# job_name: macos15_cpython +# image_name: macos-14 +# python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14'] +# test_suites: +# all: | +# brew install universal-ctags gettext +# venv/bin/pytest -n 2 -vvs diff --git a/configure b/configure index 6d317d4..a66394e 100755 --- a/configure +++ b/configure @@ -128,6 +128,10 @@ install_packages() { # be reinstalled a second time and reused from the virtualenv and this # speeds up the installation. # We always have the PEP517 build dependencies installed already. + "$CFG_BIN_DIR/pip" install \ + --upgrade \ + --no-build-isolation \ + maturin "$CFG_BIN_DIR/pip" install \ --upgrade \ diff --git a/etc/scripts/utils_requirements.py b/etc/scripts/utils_requirements.py index b9b2c0e..f377578 100644 --- a/etc/scripts/utils_requirements.py +++ b/etc/scripts/utils_requirements.py @@ -15,7 +15,7 @@ """ Utilities to manage requirements files and call pip. NOTE: this should use ONLY the standard library and not import anything else -because this is used for boostrapping with no requirements installed. +because this is used for bootstrapping with no requirements installed. """ @@ -31,7 +31,7 @@ def load_requirements(requirements_file="requirements.txt", with_unpinned=False) def get_required_name_versions(requirement_lines, with_unpinned=False): """ - Yield required (name, version) tuples given a`requirement_lines` iterable of + Yield required (name, version) tuples given a `requirement_lines` iterable of requirement text lines. Only accept requirements pinned to an exact version. """ @@ -47,7 +47,7 @@ def get_required_name_versions(requirement_lines, with_unpinned=False): def get_required_name_version(requirement, with_unpinned=False): """ - Return a (name, version) tuple given a`requirement` specifier string. + Return a (name, version) tuple given a `requirement` specifier string. Requirement version must be pinned. If ``with_unpinned`` is True, unpinned requirements are accepted and only the name portion is returned. diff --git a/requirements.txt b/requirements.txt index e69de29..1ad458b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,12 @@ +tree-sitter==0.26.0 +tree-sitter-bash==0.25.1 +tree-sitter-c==0.24.2 +tree-sitter-cpp==0.23.4 +tree-sitter-c-sharp==0.23.5 +tree-sitter-go==0.25.0 +tree-sitter-java==0.23.5 +tree-sitter-javascript==0.25.0 +tree-sitter-objc==3.0.2 +tree-sitter-python==0.25.0 +tree-sitter-rust==0.24.2 +tree-sitter-swift==0.7.3 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 2ac37b4..f3d03fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] name = source-inspector license = Apache-2.0 -version = 0.7.1 +version = 0.7.2 # description must be on ONE line https://github.com/pypa/setuptools/issues/1390 description = source-inspector @@ -43,18 +43,18 @@ install_requires = plugincode commoncode typecode - tree-sitter==0.23.2 - tree-sitter-bash==0.21.0 - tree-sitter-c==0.21.1 - tree-sitter-cpp==0.22.0 - tree-sitter-c-sharp==0.23.1 - tree-sitter-go==0.21.0 - tree-sitter-java==0.21.0 - tree-sitter-javascript==0.21.2 - tree-sitter-objc==3.0.2 - tree-sitter-python==0.21.0 - tree-sitter-rust==0.21.2 - tree-sitter-swift==0.0.1 + tree-sitter>=0.23.2 + tree-sitter-bash>=0.21.0 + tree-sitter-c>=0.21.1 + tree-sitter-cpp>=0.22.0 + tree-sitter-c-sharp>=0.23.1 + tree-sitter-go>=0.21.0 + tree-sitter-java>=0.21.0 + tree-sitter-javascript>=0.21.2 + tree-sitter-objc>=3.0.2 + tree-sitter-python>=0.21.0 + tree-sitter-rust>=0.21.2 + tree-sitter-swift>=0.0.1 pygments [options.packages.find] @@ -82,4 +82,3 @@ dev = sphinx-autobuild sphinx-rtd-dark-mode>=1.3.0 sphinx-copybutton - diff --git a/tests/data/strings_xgettext/lineedit.c-expected.json b/tests/data/strings_xgettext/lineedit.c-expected.json index 2b1f121..34489e7 100644 --- a/tests/data/strings_xgettext/lineedit.c-expected.json +++ b/tests/data/strings_xgettext/lineedit.c-expected.json @@ -69,7 +69,7 @@ "line_numbers": [ 905 ], - "string": "A" + "string": "e" }, { "line_numbers": [ diff --git a/tests/data/symbols_tree_sitter/c/if_ath.c-expected.json b/tests/data/symbols_tree_sitter/c/if_ath.c-expected.json index 4848e7e..935946e 100644 --- a/tests/data/symbols_tree_sitter/c/if_ath.c-expected.json +++ b/tests/data/symbols_tree_sitter/c/if_ath.c-expected.json @@ -1634,6 +1634,7 @@ "bf", "ATH_RXBUF_UNLOCK", "sc", + "irqreturn_t", "LINUX_VERSION_CODE", "KERNEL_VERSION", "ath_intr", @@ -10374,13 +10375,6 @@ "ATH_INTMIT", "ATH_MAXVAPS", "ATH_SYSCTL_DECL", - "ath_sysctl_halparam", - "ctl", - "write", - "filp", - "buffer", - "lenp", - "ppos", "sc", "ctl", "ah", @@ -10818,10 +10812,12 @@ "sc", "ath_static_sysctls", "AR_DEBUG", + "ctl_name", "CTL_AUTO", "ath_debug", "ath_debug", "proc_dointvec", + "ctl_name", "CTL_AUTO", "ath_countrycode", "ath_countrycode", diff --git a/tests/data/symbols_tree_sitter/cython/intbitset.pyx-expected.json b/tests/data/symbols_tree_sitter/cython/intbitset.pyx-expected.json index 88854b3..53dc67b 100644 --- a/tests/data/symbols_tree_sitter/cython/intbitset.pyx-expected.json +++ b/tests/data/symbols_tree_sitter/cython/intbitset.pyx-expected.json @@ -408,13 +408,13 @@ "remelem", "last", "elem", - "else", "tuple_of_tuples", "tmp_tuple", "rhs", "elem", "tmp_tuple", "remelem", + "from", "last", "remelem", "elem", @@ -424,7 +424,6 @@ "remelem", "last", "elem", - "else", "elem", "rhs", "remelem", @@ -438,7 +437,6 @@ "remelem", "last", "elem", - "else", "self", "sanity_checks", "tuple_of_tuples", @@ -448,30 +446,18 @@ "tmp_tuple", "elem", "ValueError", - "Negative", - "numbers", - "allowed", "elem", "maxelem", "OverflowError", - "Elements", - "must", - "be", - "s", "maxelem", "intBitSetAddElem", "self", "bitset", "elem", - "else", - "for", "elem", "rhs", - "if", "elem", - "raise", "ValueError", - "elif", "elem", "maxelem", "OverflowError", @@ -508,14 +494,11 @@ "bitset", "__dealloc__", "self", - "None", "intBitSetDestroy", "self", "bitset", - "def", "__contains__", "self", - "None", "int", "elem", "self", @@ -532,14 +515,12 @@ "elem", "__cmp__", "self", - "None", "intbitset", "rhs", "None", "TypeError", "__richcmp__", "self", - "None", "rhs", "int", "op", @@ -576,14 +557,13 @@ "tmp", "__len__", "self", - "None", + "not", "intBitSetGetTot", "self", "bitset", - "def", "__hash__", "self", - "None", + "not", "hash", "PyBytes_FromStringAndSize", "char", @@ -595,24 +575,21 @@ "self", "bitset", "wordbitsize", - "def", "__nonzero__", "self", - "None", + "not", "intBitSetEmpty", "self", "bitset", - "def", "__deepcopy__", "self", - "None", + "not", "memo", "intbitset", "self", - "def", "__delitem__", "self", - "None", + "not", "int", "elem", "self", @@ -629,7 +606,7 @@ "elem", "__iadd__", "self", - "None", + "not", "rhs", "cdef", "int", @@ -688,9 +665,9 @@ "self", "__isub__", "self", - "None", + "not", "rhs", - "None", + "not", "cdef", "int", "elem", @@ -742,10 +719,9 @@ "self", "__sub__", "self", - "None", + "not", "intbitset", "rhs", - "None", "cdef", "intbitset", "ret", @@ -760,14 +736,12 @@ "bitset", "rhs", "bitset", - "return", "ret", "__and__", "self", - "None", + "not", "intbitset", "rhs", - "None", "cdef", "intbitset", "ret", @@ -782,27 +756,23 @@ "bitset", "rhs", "bitset", - "return", "ret", "__iand__", "self", - "None", + "not", "intbitset", "rhs", - "None", "intBitSetIIntersection", "self", "bitset", "rhs", "bitset", - "return", "self", "__or__", "self", - "None", + "not", "intbitset", "rhs", - "None", "cdef", "intbitset", "ret", @@ -817,27 +787,23 @@ "bitset", "rhs", "bitset", - "return", "ret", "__ior__", "self", - "None", + "not", "intbitset", "rhs", - "None", "intBitSetIUnion", "self", "bitset", "rhs", "bitset", - "return", "self", "__xor__", "self", - "None", + "not", "intbitset", "rhs", - "None", "cdef", "intbitset", "ret", @@ -852,24 +818,21 @@ "bitset", "rhs", "bitset", - "return", "ret", "__ixor__", "self", - "None", + "not", "intbitset", "rhs", - "None", "intBitSetIXor", "self", "bitset", "rhs", "bitset", - "return", "self", "__repr__", "self", - "None", + "not", "finite_list", "self", "extract_finite_list", @@ -882,7 +845,7 @@ "finite_list", "__str__", "self", - "None", + "not", "cdef", "int", "tot", @@ -899,13 +862,11 @@ "tot", "tot", "ret", - "for", "n", "begin_list", "ret", "n", "ret", - "for", "n", "end_list", "ret", @@ -913,13 +874,12 @@ "ret", "ret", "ret", - "return", "ret", "self", "__repr__", "__getitem__", "self", - "None", + "not", "object", "key", "cdef", @@ -1015,14 +975,14 @@ "elem", "__reduce__", "self", - "None", + "not", + "_", "self", "fastdump", "__safe_for_unpickling__", - "def", "__iter__", "self", - "None", + "not", "self", "bitset", "trailing_bits", @@ -1081,7 +1041,6 @@ "intbitset", "self", "rhs", - "return", "self", "__le__", "rhs", @@ -1090,7 +1049,6 @@ "intbitset", "self", "rhs", - "return", "self", "__ge__", "rhs", @@ -1134,7 +1092,6 @@ "buf", "NULL", "size", - "try", "type", "strdump", "array", @@ -1173,7 +1130,6 @@ "copy", "intbitset", "self", - "return", "intbitset", "self", "cpdef", @@ -1193,7 +1149,6 @@ "self", "bitset", "ret", - "return", "ret", "cpdef", "remove", @@ -1236,7 +1191,6 @@ "OverflowError", "last", "ret", - "for", "i", "self", "ret", @@ -1249,12 +1203,10 @@ "ret", "update", "self", - "None", "args", "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1270,15 +1222,13 @@ "bitset", "union_update", "update", - "def", "intersection_update", "self", - "None", + "not", "args", "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1294,12 +1244,11 @@ "bitset", "difference_update", "self", - "None", + "not", "args", "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1315,7 +1264,7 @@ "bitset", "union", "self", - "None", + "not", "args", "cdef", "intbitset", @@ -1325,7 +1274,6 @@ "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1342,7 +1290,7 @@ "ret", "intersection", "self", - "None", + "not", "args", "cdef", "intbitset", @@ -1352,7 +1300,6 @@ "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1369,7 +1316,7 @@ "ret", "difference", "self", - "None", + "not", "args", "cdef", "intbitset", @@ -1379,7 +1326,6 @@ "cdef", "intbitset", "iarg", - "for", "arg", "args", "iarg", @@ -1396,11 +1342,9 @@ "ret", "isdisjoint", "self", - "None", + "not", "intbitset", "rhs", - "None", - "return", "intBitSetIsDisjoint", "self", "bitset", @@ -1414,7 +1358,6 @@ "cdef", "int", "value", - "try", "self", "sanity_checks", "value", @@ -1469,7 +1412,6 @@ "is_infinite", "intbitset", "self", - "return", "self", "bitset", "trailing_bits", @@ -1500,7 +1442,6 @@ "bitset", "wordbitsize", "last", - "while", "last", "true_up_to", "last", @@ -1537,7 +1478,6 @@ "object", "__weakref__", "cdef", - "class", "intbitset_iterator", "cdef", "int", @@ -1553,7 +1493,6 @@ "self", "intbitset", "bitset", - "None", "self", "last", "self", @@ -1602,7 +1541,6 @@ "last", "self", "last", - "raise", "StopIteration", "self", "last", diff --git a/tests/data/symbols_tree_sitter/go/client.go-expected.json b/tests/data/symbols_tree_sitter/go/client.go-expected.json index 8b07614..5fb9341 100644 --- a/tests/data/symbols_tree_sitter/go/client.go-expected.json +++ b/tests/data/symbols_tree_sitter/go/client.go-expected.json @@ -23,9 +23,6 @@ "tracerProvider", "tracerDelegate", "sessionDialer", - "string", - "map", - "string", "customDialOptions", "creds", "_", @@ -328,13 +325,7 @@ "w", "WithSessionDialer", "dialer", - "string", - "map", - "string", "dialer", - "string", - "map", - "string", "w", "resolveDialer", "address",