diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index 53b55dc78..79450e8a4 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -21,23 +21,21 @@ jobs: TARGET: macos # currently, wrapt pulls the arm64 version instead of the universal one, so the below is a hack CMD_REQS: > - mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir --no-binary tree_sitter,ijson,charset_normalizer,PyYAML .. && + mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir --no-binary ijson,charset_normalizer,PyYAML .. && rm $(ls | grep wrapt) && pip download wrapt --platform=universal2 --only-binary=:all: && pip install $(ls | grep wrapt) --force-reinstall && cd .. && pip install --no-deps --no-index --find-links=pip-packages pip-packages/* CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages --target-arch universal2 -F codecov_cli/main.py && + pyinstaller --copy-metadata codecov-cli --target-arch universal2 -F codecov_cli/main.py && mv dist/main dist/codecovcli_macos && lipo -archs dist/codecovcli_macos | grep 'x86_64 arm64' OUT_FILE_NAME: codecovcli_macos ASSET_MIME: application/octet-stream - - os: ubuntu-20.04 + - os: ubuntu-22.04 TARGET: ubuntu CMD_REQS: > pip install -r requirements.txt && pip install . CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py && + pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py && cp ./dist/main ./dist/codecovcli_linux OUT_FILE_NAME: codecovcli_linux ASSET_MIME: application/octet-stream @@ -46,7 +44,7 @@ jobs: CMD_REQS: > pip install -r requirements.txt && pip install . CMD_BUILD: > - pyinstaller --add-binary "build\lib.win-amd64-cpython-311\staticcodecov_languages.cp311-win_amd64.pyd;." --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli\main.py && + pyinstaller --copy-metadata codecov-cli -F codecov_cli\main.py && Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" OUT_FILE_NAME: codecovcli_windows.exe ASSET_MIME: application/vnd.microsoft.portable-executable diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7b767e1a7..000000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "languages/treesitterpython"] - path = languages/treesitterpython - url = git@github.com:tree-sitter/tree-sitter-python.git -[submodule "languages/treesitterjavascript"] - path = languages/treesitterjavascript - url = git@github.com:tree-sitter/tree-sitter-javascript.git diff --git a/MANIFEST.in b/MANIFEST.in index e0bbc1dc8..4f3a2eaad 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ -include languages/treesitterjavascript/src/tree_sitter/parser.h -include languages/treesitterpython/src/tree_sitter/parser.h include requirements.txt recursive-include codecov_cli * diff --git a/languages/languages.c b/languages/languages.c deleted file mode 100644 index 7a2aac1a5..000000000 --- a/languages/languages.c +++ /dev/null @@ -1,21 +0,0 @@ -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include - -static PyMethodDef module_methods[] = { - NULL -}; - -static struct PyModuleDef module_definition = { - .m_base = PyModuleDef_HEAD_INIT, - .m_name = "binding", - .m_doc = NULL, - .m_size = -1, - .m_methods = NULL, -}; - -PyMODINIT_FUNC PyInit_staticcodecov_languages(void) { - PyObject *module = PyModule_Create(&module_definition); - if (module == NULL) return NULL; - return module; -} \ No newline at end of file diff --git a/languages/treesitterjavascript b/languages/treesitterjavascript deleted file mode 160000 index 936d976a7..000000000 --- a/languages/treesitterjavascript +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 936d976a782e75395d9b1c8c7c7bf4ba6fe0d86b diff --git a/languages/treesitterpython b/languages/treesitterpython deleted file mode 160000 index de221eccf..000000000 --- a/languages/treesitterpython +++ /dev/null @@ -1 +0,0 @@ -Subproject commit de221eccf9a221f5b85474a553474a69b4b5784d diff --git a/pyproject.toml b/pyproject.toml index d1b9a2288..53076bc46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ dependencies = [ "responses==0.21.*", "sentry-sdk>=2.20.0", "test-results-parser==0.5.4", - "tree-sitter==0.20.*", "wrapt>=1.17.2", ] license = {file = "LICENSE"} diff --git a/requirements.txt b/requirements.txt index 3cd4e69d7..bf0f371de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --all-build-deps --all-extras pyproject.toml @@ -29,8 +29,6 @@ idna==3.10 # requests ijson==3.3.0 # via codecov-cli (pyproject.toml) -packaging==24.2 - # via setuptools-scm pyyaml==6.0.2 # via codecov-cli (pyproject.toml) regex==2024.11.6 @@ -41,16 +39,12 @@ responses==0.21.0 # via codecov-cli (pyproject.toml) sentry-sdk==2.20.0 # via codecov-cli (pyproject.toml) -setuptools-scm==8.1.0 - # via codecov-cli (pyproject.toml::build-system.requires) sniffio==1.3.1 # via # anyio # httpx test-results-parser==0.5.4 # via codecov-cli (pyproject.toml) -tree-sitter==0.20.4 - # via codecov-cli (pyproject.toml) typing-extensions==4.12.2 # via anyio urllib3==2.3.0 diff --git a/scripts/build_alpine_arm.sh b/scripts/build_alpine_arm.sh index 688c3ab09..100cae4b8 100755 --- a/scripts/build_alpine_arm.sh +++ b/scripts/build_alpine_arm.sh @@ -3,7 +3,6 @@ apk add musl-dev build-base pip install -r requirements.txt pip install . python setup.py build -STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") pip install pyinstaller -pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py +pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py cp ./dist/main ./dist/codecovcli_$1 diff --git a/scripts/build_linux_arm.sh b/scripts/build_linux_arm.sh index 58b4625fc..a1f65f34f 100755 --- a/scripts/build_linux_arm.sh +++ b/scripts/build_linux_arm.sh @@ -3,7 +3,6 @@ apt install build-essential pip install -r requirements.txt pip install . python setup.py build -STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") pip install pyinstaller -pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --copy-metadata codecov-cli --hidden-import staticcodecov_languages -F codecov_cli/main.py +pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py cp ./dist/main ./dist/codecovcli_$1 diff --git a/setup.py b/setup.py index 8234a4a5c..606849326 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,3 @@ -from platform import system +from setuptools import setup -from setuptools import Extension, setup - -setup( - ext_modules=[ - Extension( - "staticcodecov_languages", - [ - "languages/languages.c", - "languages/treesitterpython/src/parser.c", - "languages/treesitterjavascript/src/parser.c", - "languages/treesitterpython/src/scanner.cc", - "languages/treesitterjavascript/src/scanner.c", - ], - include_dirs=[ - "languages/treesitterpython/src", - "languages/treesitterjavascript/src", - "languages/treesitterjavascript/src/tree_sitter", - "languages/treesitterpython/src/tree_sitter", - ], - extra_compile_args=( - ["-Wno-unused-variable"] if system() != "Windows" else None - ), - ) - ], -) +setup()