diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml deleted file mode 100644 index 1b05dd61..00000000 --- a/.github/workflows/build_assets.yml +++ /dev/null @@ -1,161 +0,0 @@ ---- -name: Build Compiled Assets - -on: - workflow_call: - inputs: - release: - type: boolean - default: false - description: "Attach artifacts to a release" - -permissions: - contents: read - -jobs: - build_assets: - name: Build packages - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - include: - - os: macos-latest - 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 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: > - 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-22.04 - TARGET: ubuntu - CMD_REQS: > - pip install -r requirements.txt && pip install . - CMD_BUILD: > - 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 - - - os: windows-latest - TARGET: windows - CMD_REQS: > - pip install -r requirements.txt && pip install . - CMD_BUILD: > - 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 - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - - name: Install dependencies - run: | - cd codecov-cli - ${{matrix.CMD_REQS}} - python setup.py build - - - name: Install pyinstaller - run: pip install pyinstaller - - - name: Build with pyinstaller for ${{matrix.TARGET}} - run: cd codecov-cli && ${{matrix.CMD_BUILD}} - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 - if: inputs.release == false - with: - name: ${{ matrix.OUT_FILE_NAME }} - path: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }} - - - name: Get auth token - if: inputs.release == true - id: token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - with: - app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} - private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - - - name: Upload Release Asset - if: inputs.release == true - id: upload-release-asset - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ steps.token.outputs.token }} - file: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }} - asset_name: ${{ matrix.OUT_FILE_NAME }} - tag: ${{ github.ref }} - overwrite: true - - build_assets_alpine_arm: - name: Build assets - Alpine and ARM - runs-on: ubuntu-latest - strategy: - matrix: - include: - - distro: "python:3.11-alpine3.18" - arch: arm64 - distro_name: alpine - - distro: "python:3.11-alpine3.18" - arch: x86_64 - distro_name: alpine - - distro: "python:3.11-bullseye" - arch: arm64 - distro_name: linux - - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: ${{ matrix.arch }} - - - name: Run in Docker - run: | - docker run \ - --rm \ - -v $(pwd):/${{ github.workspace }} \ - -w ${{ github.workspace }} \ - --platform linux/${{ matrix.arch }} \ - ${{ matrix.distro }} \ - ./codecov-cli/scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }} - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 - if: inputs.release == false - with: - name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - path: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - - - name: Get auth token - if: inputs.release == true - id: token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - with: - app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} - private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - - - name: Upload Release Asset - if: inputs.release == true - id: upload-release-asset - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ steps.token.outputs.token }} - file: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - asset_name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - tag: ${{ github.ref }} - overwrite: true diff --git a/.github/workflows/build_for_pypi.yml b/.github/workflows/build_for_pypi.yml deleted file mode 100644 index 92fd60f2..00000000 --- a/.github/workflows/build_for_pypi.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: Build for PyPi - -on: - workflow_call: - inputs: - publish: - type: boolean - default: false - description: "Build for PyPi" - -permissions: - contents: read - -jobs: - build_src_for_pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install dependencies - run: | - pip install build - - - name: Build src dist - run: | - cd codecov-cli - python -m build --sdist - env: - PIP_CONSTRAINT: requirements.txt - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: ./**/*.tar.gz - - build_dist_for_pypi: - needs: - - build_src_for_pypi - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - macos-13 - - macos-latest - - ubuntu-24.04-arm - - ubuntu-latest - - windows-latest - steps: - - name: Download the sdist - uses: actions/download-artifact@v4 - with: - name: cibw-sdist - - - name: Get sdist filename - id: get-sdist - run: | - echo "sdist_filename=$(ls codecov-cli/dist/)" >> "${GITHUB_OUTPUT}" - shell: bash - - - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 - with: - package-dir: codecov-cli/dist/${{ steps.get-sdist.outputs.sdist_filename }} - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }} - path: ./wheelhouse/*.whl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d404904e..dd9ee111 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - name: Detect changes on commit run: | if [ -n "$(git diff codecov-cli/codecovcli_commands prevent-cli/preventcli_commands)" ]; then - echo "Please run `python command_dump.py` before submitting, or install the hooks" + echo "Please run `make command_dump` before submitting, or install the hooks" echo "$(git diff codecov-cli/codecovcli_commands prevent-cli/preventcli_commands)" exit 1 fi @@ -94,7 +94,7 @@ jobs: - name: Install dependencies run: | - python -m pip install uv + pip install uv uv sync --project codecov-cli uv sync --project prevent-cli diff --git a/.github/workflows/release_flow.yml b/.github/workflows/release_flow.yml index 342d01df..67fd29ff 100644 --- a/.github/workflows/release_flow.yml +++ b/.github/workflows/release_flow.yml @@ -9,57 +9,165 @@ permissions: contents: read jobs: - build_for_pypi: - permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout - uses: ./.github/workflows/build_for_pypi.yml - with: - publish: true - secrets: inherit - - buildassets: - name: Build packages - uses: ./.github/workflows/build_assets.yml - with: - release: true - secrets: inherit - - publish_to_pypi: - needs: - - build_for_pypi + build_and_publish_to_pypi: permissions: id-token: write # This is required for OIDC + contents: read runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/codecov-cli steps: - - name: Download artifacts - uses: actions/download-artifact@v4 + - uses: actions/checkout@v4 with: - path: dist/ - pattern: cibw-* + persist-credentials: false + + - name: Install dependencies + run: pip install uv - - name: Display and move artifacts + - name: Build sdist and bdist run: | - ls -alrt */*/* - mv */*/*/* dist/ - mv */*/* dist/ - echo "Moved files" - ls -alrt */* - echo "Deleting empty directories" - find . -empty -type d -delete - ls -alrt */* + cd codecov-cli + uv build - name: Publish package to PyPi uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true + build_assets: + name: Build packages - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + - os: macos-latest + TARGET: macos + CMD_BUILD: > + uv run pyinstaller --target-arch universal2 -F codecov_cli/main.py && + mv dist/main dist/codecovcli_macos + OUT_FILE_NAME: codecovcli_macos + ASSET_MIME: application/octet-stream + + - os: ubuntu-22.04 + TARGET: ubuntu + CMD_BUILD: > + uv run pyinstaller -F codecov_cli/main.py && + mv ./dist/main ./dist/codecovcli_linux + OUT_FILE_NAME: codecovcli_linux + ASSET_MIME: application/octet-stream + + - os: windows-latest + TARGET: windows + CMD_BUILD: > + uv run pyinstaller -F codecov_cli\main.py && + Move-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" + OUT_FILE_NAME: codecovcli_windows.exe + ASSET_MIME: application/vnd.microsoft.portable-executable + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + pip install uv + cd codecov-cli + # Need to build pyyaml and ijson from sdists to get universal2 macos build to work + uv sync --no-binary-package pyyaml --no-binary-package ijson + uv add --dev pyinstaller + + - name: Build with pyinstaller for ${{matrix.TARGET}} + run: cd codecov-cli && ${{matrix.CMD_BUILD}} + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.OUT_FILE_NAME }} + path: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }} + + - name: Get auth token + id: token + uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + with: + app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} + private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} + + - name: Upload Release Asset + id: upload-release-asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ steps.token.outputs.token }} + file: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }} + asset_name: ${{ matrix.OUT_FILE_NAME }} + tag: ${{ github.ref }} + overwrite: true + + build_assets_alpine_arm: + name: Build assets - Alpine and ARM + runs-on: ubuntu-latest + strategy: + matrix: + include: + - distro: "python:3.12-alpine" + arch: arm64 + distro_name: alpine + - distro: "python:3.12-alpine" + arch: x86_64 + distro_name: alpine + - distro: "python:3.12-bullseye" + arch: arm64 + distro_name: linux + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: ${{ matrix.arch }} + + - name: Run in Docker + run: | + docker run \ + --rm \ + -v $(pwd):/${{ github.workspace }} \ + -w ${{ github.workspace }} \ + --platform linux/${{ matrix.arch }} \ + ${{ matrix.distro }} \ + ./codecov-cli/scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }} + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} + path: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} + + - name: Get auth token + id: token + uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + with: + app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} + private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} + + - name: Upload Release Asset + id: upload-release-asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ steps.token.outputs.token }} + file: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} + asset_name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} + tag: ${{ github.ref }} + overwrite: true + publish_release: name: Publish release - needs: [buildassets, publish_to_pypi] + needs: [build_assets, build_assets_alpine_arm, build_and_publish_to_pypi] runs-on: ubuntu-latest permissions: contents: 'read' diff --git a/.pip-tools.toml b/.pip-tools.toml deleted file mode 100644 index 6b42ec0b..00000000 --- a/.pip-tools.toml +++ /dev/null @@ -1,3 +0,0 @@ -[tool.pip-tools] -all-build-deps = true -all-extras = true diff --git a/codecov-cli/LICENSE b/codecov-cli/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/codecov-cli/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/codecov-cli/pyproject.toml b/codecov-cli/pyproject.toml index 3ae7d3e6..96edb15d 100644 --- a/codecov-cli/pyproject.toml +++ b/codecov-cli/pyproject.toml @@ -1,15 +1,16 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - [project] +name = "codecov-cli" +version = "10.4.0" +description = "Codecov Command Line Interface" +readme = "README.md" +license-files = ["LICENSE"] authors = [ {name = "Tom Hu", email = "thomas.hu@sentry.io"}, ] maintainers = [ {name = "Codecov Support", email = "support@codecov.io"}, ] -description = "Codecov Command Line Interface" +requires-python = ">= 3.9" dependencies = [ "click==8.*", "ijson==3.*", @@ -18,23 +19,6 @@ dependencies = [ "sentry-sdk==2.*", "test-results-parser==0.5.4", ] -license = {file = "LICENSE"} -name = "codecov-cli" -readme = "README.md" -requires-python = ">= 3.9" -version = "10.4.0" - -[project.scripts] -codecov = "codecov_cli.main:run" -codecovcli = "codecov_cli.main:run" - -[tool.pytest.ini_options] -env = [ - "CODECOV_ENV=test", -] - -[tool.setuptools] -packages = ["codecov_cli"] [dependency-groups] dev = [ @@ -45,3 +29,20 @@ dev = [ "pytest-env==1.*", "pytest-mock==3.*", ] + +[project.scripts] +codecov = "codecov_cli.main:run" +codecovcli = "codecov_cli.main:run" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["codecov_cli"] + +[tool.pytest.ini_options] +env = [ + "CODECOV_ENV=test", +] + diff --git a/codecov-cli/scripts/build_alpine_arm.sh b/codecov-cli/scripts/build_alpine_arm.sh index a18691eb..3594fc91 100755 --- a/codecov-cli/scripts/build_alpine_arm.sh +++ b/codecov-cli/scripts/build_alpine_arm.sh @@ -1,9 +1,8 @@ #!/bin/sh +apk add build-base cd codecov-cli -apk add musl-dev build-base -pip install -r requirements.txt -pip install . -python setup.py build -pip install pyinstaller -pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py +pip install uv +uv sync +uv add --dev pyinstaller +uv run pyinstaller -F codecov_cli/main.py cp ./dist/main ./dist/codecovcli_$1 diff --git a/codecov-cli/scripts/build_linux_arm.sh b/codecov-cli/scripts/build_linux_arm.sh index b389584c..c0248c90 100755 --- a/codecov-cli/scripts/build_linux_arm.sh +++ b/codecov-cli/scripts/build_linux_arm.sh @@ -1,9 +1,8 @@ #!/bin/sh -cd codecov-cli apt install build-essential -pip install -r requirements.txt -pip install . -python setup.py build -pip install pyinstaller -pyinstaller --copy-metadata codecov-cli -F codecov_cli/main.py +cd codecov-cli +pip install uv +uv sync +uv add --dev pyinstaller +uv run pyinstaller -F codecov_cli/main.py cp ./dist/main ./dist/codecovcli_$1 diff --git a/prevent-cli/LICENSE b/prevent-cli/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/prevent-cli/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/prevent-cli/pyproject.toml b/prevent-cli/pyproject.toml index 35e70f79..1c6aa486 100644 --- a/prevent-cli/pyproject.toml +++ b/prevent-cli/pyproject.toml @@ -3,6 +3,7 @@ name = "prevent-cli" version = "0.1.0" description = "Add your description here" readme = "README.md" +license-files = ["LICENSE"] authors = [ { name = "joseph-sentry", email = "joseph.sawaya@sentry.io" } ]