diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index 53b55dc78..ca757c801 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -2,12 +2,13 @@ name: Build Compiled Assets on: - workflow_call: - inputs: - release: - type: boolean - default: false - description: "Attach artifacts to a release" + pull_request: + branches: + - main + push: + # Pattern matched against refs/tags + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: build_assets: @@ -68,12 +69,12 @@ jobs: run: ${{matrix.CMD_BUILD}} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 - if: inputs.release == false + if: github.ref_type == 'tag' with: name: ${{ matrix.OUT_FILE_NAME }} path: ./dist/${{ matrix.OUT_FILE_NAME }} - name: Upload Release Asset - if: inputs.release == true + if: github.ref_type == 'tag' id: upload-release-asset uses: svenstaro/upload-release-action@v2 with: @@ -118,12 +119,12 @@ jobs: ./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 + if: github.ref_type == 'tag' with: name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} path: ./dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - name: Upload Release Asset - if: inputs.release == true + if: github.ref_type == 'tag' id: upload-release-asset uses: svenstaro/upload-release-action@v2 with: diff --git a/.github/workflows/build_for_pypi.yml b/.github/workflows/build_for_pypi.yml index ff3841754..b265bbde8 100644 --- a/.github/workflows/build_for_pypi.yml +++ b/.github/workflows/build_for_pypi.yml @@ -1,47 +1,87 @@ +--- name: Build and Optionally Publish to PyPi on: - workflow_call: - inputs: - publish: - type: boolean - default: false - description: "Publish to PyPi" + pull_request: + branches: + - main + push: + # Pattern matched against refs/tags + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: - build_for_pypi: + build_src_for_pypi: runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout steps: - uses: actions/checkout@v4 with: + persist-credentials: false submodules: true - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - name: Install dependencies run: | - pip install -r requirements.txt - python setup.py build - python setup.py develop - - name: Build distributions for different platforms + pip install build + - name: Build src dist run: | - pip install wheel - python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64 - python setup.py bdist_wheel --plat-name=macosx-12.6-universal2 - python setup.py bdist_wheel --plat-name=win_amd64 - - name: Move src file to match PEP625 + 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: | - cd dist - ls | grep *.tar.gz | xargs -I x mv -- x "$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')" - ls -al - cd .. + echo "sdist_filename=$(ls dist/)" >> "${GITHUB_OUTPUT}" + shell: bash + - name: Build wheels + uses: pypa/cibuildwheel@v2.22.0 + with: + package-dir: 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 + + + publish_to_pypi: + if: github.ref_type == 'tag' + needs: + - build_dist_for_pypi + - build_src_for_pypi + permissions: + id-token: write # This is required for OIDC + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/codecov-cli + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: cibw-* - name: Publish package to PyPi - if: inputs.publish == true uses: pypa/gh-action-pypi-publish@release/v1 with: - attestations: false verbose: true diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml deleted file mode 100644 index d59b8b549..000000000 --- a/.github/workflows/build_main.yml +++ /dev/null @@ -1,17 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Build - -on: - pull_request: - branches: - - main - -jobs: - build_and_publish_to_pipy: - uses: ./.github/workflows/build_for_pypi.yml - secrets: inherit - build_assets: - uses: ./.github/workflows/build_assets.yml - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/ci-job.yml b/.github/workflows/ci-job.yml index 983954c82..cea929f54 100644 --- a/.github/workflows/ci-job.yml +++ b/.github/workflows/ci-job.yml @@ -30,6 +30,8 @@ jobs: - name: Test with pytest run: | pytest --cov --junitxml=3.12junit.xml + env: + CODECOV_ENV: test - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07587502d..1b2f7f145 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,8 @@ jobs: - name: Test with pytest run: | pytest --cov --junitxml=${{matrix.python-version}}junit.xml + env: + CODECOV_ENV: test - name: Dogfooding codecov-cli if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} run: | diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index e1abb1b4c..0567fdf3c 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -18,7 +18,7 @@ jobs: - id: get-release-vars name: Configure Release Vars run: | - echo release_version=v$(grep -E "version=\"[0-9]+\.[0-9]+\.[0-9]+\"" setup.py | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT" + echo release_version=v$(grep -E "version = \"[0-9]+\.[0-9]+\.[0-9]+\"" pyproject.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT" echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT" - name: Create GitHub Release diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 2f9e9ae43..6fb56c4da 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -30,8 +30,8 @@ jobs: - name: Update version and push id: make-commit run: | - sed -i 's/version="[0-9]\+\.[0-9]\+\.[0-9]\+"/version="${{ github.event.inputs.versionName }}"/g' setup.py - git add setup.py + sed -i 's/version="[0-9]\+\.[0-9]\+\.[0-9]\+"/version="${{ github.event.inputs.versionName }}"/g' pyproject.toml + git add pyproject.toml git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}" echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" git push origin release/${{ github.event.inputs.versionName }} diff --git a/.pip-tools.toml b/.pip-tools.toml new file mode 100644 index 000000000..6b42ec0b7 --- /dev/null +++ b/.pip-tools.toml @@ -0,0 +1,3 @@ +[tool.pip-tools] +all-build-deps = true +all-extras = true diff --git a/MANIFEST.in b/MANIFEST.in index ce1470ffe..be346cbe9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include languages/treesitterjavascript/src/tree_sitter/parser.h include languages/treesitterpython/src/tree_sitter/parser.h +include requirements.txt diff --git a/README.md b/README.md index c130e664b..3f94fe2e6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CodecovCLI +# CodecovCLI [![codecov](https://codecov.io/gh/codecov/codecov-cli/branch/master/graph/badge.svg?token=jN0CICuA6Z)](https://codecov.io/gh/codecov/codecov-cli) [![Build-Test-Upload](https://github.com/codecov/codecov-cli/actions/workflows/push_flow.yml/badge.svg)](https://github.com/codecov/codecov-cli/actions/workflows/push_flow.yml) @@ -39,12 +39,12 @@ To use codecov-cli in your local machine, or your CI workflows, you need to inst `pip install codecov-cli` -The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewed [here](https://pypi.org/project/codecov-cli/#history). +The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewed [here](https://pypi.org/project/codecov-cli/#history). -Note: If you're installing in a `pyenv` environment, you may need to call `pyenv rehash` before the CLI will work. +Note: If you're installing in a `pyenv` environment, you may need to call `pyenv rehash` before the CLI will work. ## As a Binary -If you would like to use the CLI in an environment that does not have access to Python / PIP, you can install the CLI as a compiled binary. Linux and macOS releases can be found [here](https://cli.codecov.io/), along with SHASUMs and signatures for each released version. Binary releases are also available via [Github releases](https://github.com/codecov/codecov-cli/releases) on this repository. +If you would like to use the CLI in an environment that does not have access to Python / PIP, you can install the CLI as a compiled binary. Linux and macOS releases can be found [here](https://cli.codecov.io/), along with SHASUMs and signatures for each released version. Binary releases are also available via [Github releases](https://github.com/codecov/codecov-cli/releases) on this repository. You can retrieve the Binary for Linux directly from your command line as follows: @@ -73,7 +73,7 @@ For macos you will want to use the macos distributions of the binary (e.g., http # How to Upload to Codecov -If desired, the CLI can be used as a replacement for our [NodeJS Binary Uploader](https://github.com/codecov/uploader). To use the CLI to upload from your CI workflow, you need to add these commands: +If desired, the CLI can be used as a replacement for our [NodeJS Binary Uploader](https://github.com/codecov/uploader). To use the CLI to upload from your CI workflow, you need to add these commands: ``` pip install codecov-cli @@ -81,23 +81,22 @@ codecovcli create-commit codecovcli create-report codecovcli do-upload ``` -OR +OR ``` pip install codecov-cli codecovcli upload-process ``` -codecovcli upload-process is a wrapper for create-commit, create-report and do-upload. +codecovcli upload-process is a wrapper for create-commit, create-report and do-upload. -You can customize the commands with the options aligned with each command. +You can customize the commands with the options aligned with each command. -Note that these commands will automatically search your environment for a `$CODECOV_TOKEN` environment variable and use it if found. If you do not have a repository upload token, or global upload token, stored as an environment variable, you will need to pass it into **each command manually**, like so: `-t {$CODECOV_TOKEN}`. +Note that these commands will automatically search your environment for a `$CODECOV_TOKEN` environment variable and use it if found. If you do not have a repository upload token, or global upload token, stored as an environment variable, you will need to pass it into **each command manually**, like so: `-t {$CODECOV_TOKEN}`. ## How to Get an Upload Token The following tokens are suitable for uploading: -* The [Repository Upload Token](https://docs.codecov.com/docs/codecov-uploader#upload-token): Found on the settings page of your repository, also viewable on the `/new` page when setting up a repository on Codecov for the first time. -* The [Global Upload Token](https://docs.codecov.com/docs/codecov-uploader#organization-upload-token): Found on your organization settings page (e.g., `https://app.codecov.io/account///org-upload-token`). - +* The [Repository Upload Token](https://docs.codecov.com/docs/codecov-uploader#upload-token): Found on the settings page of your repository, also viewable on the `/new` page when setting up a repository on Codecov for the first time. +* The [Global Upload Token](https://docs.codecov.com/docs/codecov-uploader#organization-upload-token): Found on your organization settings page (e.g., `https://app.codecov.io/account///org-upload-token`). # Usage If the installation is successful, running `codecovcli --help` will output the available commands along with the different general options that can be used with them. @@ -116,55 +115,55 @@ Codecov-cli supports user input. These inputs, along with their descriptions and | `--codecov-yml-path` | The path for your codecov.yml | Optional | `--enterprise-url` | Change the upload host (Enterprise use) | Optional | `--version` | Codecov-cli's version | Optional -| `--verbose` or `-v` | Run the cli with verbose logging | Optional +| `--verbose` or `-v` | Run the cli with verbose logging | Optional # Codecov-cli Commands -| Command | Description | -| :---: | :---: | -| `create-commit` | Saves the commit's metadata in codecov, it's only necessary to run this once per commit -| `create-report` | Creates an empty report in codecov with initial data e.g. report name, report's commit -| `do-upload` | Searches for and uploads coverage data to codecov +| Command | Description | +| :---: | :---: | +| `create-commit` | Saves the commit's metadata in codecov, it's only necessary to run this once per commit +| `create-report` | Creates an empty report in codecov with initial data e.g. report name, report's commit +| `do-upload` | Searches for and uploads coverage data to codecov | `create-report-results` | Used for local upload. It tells codecov that you finished local uploading and want it to calculate the results for you to get them locally. -| `get-report-results` | Used for local upload. It asks codecov to provide you the report results you calculated with the previous command. +| `get-report-results` | Used for local upload. It asks codecov to provide you the report results you calculated with the previous command. | `pr-base-picking` | Tells codecov that you want to explicitly define a base for your PR | `upload-process` | A wrapper for 3 commands. Create-commit, create-report and do-upload. You can use this command to upload to codecov instead of using the previosly mentioned commands. | `send-notifications` | A command that tells Codecov that you finished uploading and you want to be sent notifications. To disable automatically sent notifications please consider adding manual_trigger to your codecov.yml, so it will look like codecov: notify: manual_trigger: true. ->**Note**: Every command has its own different options that will be mentioned later in this doc. Codecov will try to load these options from your CI environment variables, if not, it will try to load them from git, if not found, you may need to add them manually. +>**Note**: Every command has its own different options that will be mentioned later in this doc. Codecov will try to load these options from your CI environment variables, if not, it will try to load them from git, if not found, you may need to add them manually. -## create-commit +## create-commit `codecovcli create-commit [Options]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | | -C, --sha, --commit-sha | Commit SHA (with 40 chars) | Required |--parent-sha | SHA (with 40 chars) of what should be the parent of this commit | Optional |-P, --pr, --pull-request-number| Specify the pull request number manually. Used to override pre-existing CI environment variables | Optional |-B, --branch | Branch to which this commit belongs to | Optional |-r, --slug | owner/repo slug used instead of the private repo token in Self-hosted | Required -|-t, --token | Codecov upload token | Required +|-t, --token | Codecov upload token | Required |--git-service | Git Provider. Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Required -|-h, --help | Shows usage, and command options +|-h, --help | Shows usage, and command options ## create-report `codecovcli create-report [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | | -C, --sha, --commit-sha | Commit SHA (with 40 chars) | Required |-r, --slug | owner/repo slug used instead of the private repo token in Self-hosted | Required -|-t, --token | Codecov upload token | Required +|-t, --token | Codecov upload token | Required |--git-service | Git Provider. Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Required |--code| The code of the report. This is used in local uploading to isolate local reports from regular or cloud reports uploaded to codecov so they don't get merged. It's basically a name you give to your report e.g. local-report. | Optional -|-h, --help | Shows usage, and command options +|-h, --help | Shows usage, and command options ## do-upload `codecovcli do-upload [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | |-C, --sha, --commit-sha| Commit SHA (with 40 chars) | Required |--report-code | The code of the report defined when creating the report. If unsure, leave default | Optional |--network-root-folder | Root folder from which to consider paths on the network section default: (Current working directory) | Optional @@ -187,13 +186,13 @@ Codecov-cli supports user input. These inputs, along with their descriptions and |-d, --dry-run | Don't upload files to Codecov | Optional |--legacy, --use-legacy-uploader | Use the legacy upload endpoint | Optional |--git-service | Git Provider. Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Required -|-h, --help | Shows usage, and command options +|-h, --help | Shows usage, and command options ## create-report-results `codecovcli create-report-results [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | |--commit-sha | Commit SHA (with 40 chars) | Required |--code | The code of the report. If unsure, leave default | Required |--slug | owner/repo slug | Required @@ -205,7 +204,7 @@ Codecov-cli supports user input. These inputs, along with their descriptions and `codecovcli get-report-results [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | |--commit-sha | Commit SHA (with 40 chars) | Required |--code | The code of the report. If unsure, leave default | Required |--slug | owner/repo slug | Required @@ -217,7 +216,7 @@ Codecov-cli supports user input. These inputs, along with their descriptions and `codecovcli pr-base-picking [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | |--base-sha | Base commit SHA (with 40 chars) | Required |--pr | Pull Request id to associate commit with | Required |--slug | owner/repo slug | Required @@ -225,11 +224,11 @@ Codecov-cli supports user input. These inputs, along with their descriptions and |--service | Git provider. Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional |-h, --help | Shows usage, and command options -## send-notifications +## send-notifications `codecovcli send-notifications [OPTIONS]` | Option | Description | Usage -| :---: | :---: | :---: | +| :---: | :---: | :---: | | -C, --sha, --commit-sha TEXT |Commit SHA (with 40 chars) | Required | -r, --slug TEXT |owner/repo slug used instead of the private repo token in Self-hosted | Required | -t, --token TEXT |Codecov upload token | Required @@ -256,7 +255,7 @@ are ignored by codecov (including README and configuration files) # How to Use Local Upload -The CLI also supports "dry run" local uploading. This is useful if you prefer to see Codecov status checks and coverage reporting locally, in your terminal, as opposed to opening a PR and waiting for your full CI to run. Local uploads do not interfere with regular uploads made from your CI for any given commit / Pull Request. +The CLI also supports "dry run" local uploading. This is useful if you prefer to see Codecov status checks and coverage reporting locally, in your terminal, as opposed to opening a PR and waiting for your full CI to run. Local uploads do not interfere with regular uploads made from your CI for any given commit / Pull Request. Local Upload is accomplished as follows: @@ -271,11 +270,11 @@ codecovcli get-report-results --code Codecov will calculate the coverage results, and return them in your terminal, telling you whether your PR will fail or pass the coverage check. -Note: In order for Local Upload to work, it must be used against a commit on the origin repository. Local Upload does not work for arbitrary diffs or uncommitted changes on your local machine. +Note: In order for Local Upload to work, it must be used against a commit on the origin repository. Local Upload does not work for arbitrary diffs or uncommitted changes on your local machine. # Work in Progress Features -The following features are somewhat implemented in code, but are not yet meant for use. These features will be documented once they are fully implemented in the CLI. +The following features are somewhat implemented in code, but are not yet meant for use. These features will be documented once they are fully implemented in the CLI. ## Plugin System @@ -283,11 +282,11 @@ To provide extensibility to some of its commands, the CLI makes use of a plugin ## Static Analysis -The CLI can perform basic static analysis on Python code today. This static analysis is meant to power more future looking Codecov features and, as such, is not required or in active use today. As more functionality dependent on static analysis becomes available for use, we will document static analysis in detail here. +The CLI can perform basic static analysis on Python code today. This static analysis is meant to power more future looking Codecov features and, as such, is not required or in active use today. As more functionality dependent on static analysis becomes available for use, we will document static analysis in detail here. # Contributions -This repository, like all of Codecov's repositories, strives to follow our general [Contributing guidelines](https://github.com/codecov/contributing). If you're considering making a contribution to this repository, we encourage review of our Contributing guidelines first. +This repository, like all of Codecov's repositories, strives to follow our general [Contributing guidelines](https://github.com/codecov/contributing). If you're considering making a contribution to this repository, we encourage review of our Contributing guidelines first. ## Requirements @@ -300,8 +299,8 @@ git submodule update --init ``` Then, install dependencies with ``` -pip install -r requirements.txt -python setup.py develop +pip install -r requirements.txt +python -m pip install --editable . ``` The C code shouldn't require any additional setup to get running, but depending on your environment, you may be prompted to install compilers and supporting tools. If errors are generated during installation, it is likely due to missing dependencies / tools required of the C code. In many cases, resulting error messages should be clear enough to determine what is missing and how to install it, but common errors will be collected here as they are encountered. @@ -310,7 +309,7 @@ The C code shouldn't require any additional setup to get running, but depending There are a few guidelines when developing in this system. Some notable folders: -1. `commands` - It's the folder that interacts with the caller. This is where the commands themselves should reside. These commands are not meant to do heavy lifting. They only do wiring, which is mostly parsing the input parameters. +1. `commands` - It's the folder that interacts with the caller. This is where the commands themselves should reside. These commands are not meant to do heavy lifting. They only do wiring, which is mostly parsing the input parameters. 2. `services` - It's where the heavy logic resides. It's mostly organized by which command needs them. Commands should generally be thin wrappers around these services. 3. `helpers` - This is meant for logic that is useful across different commands. For example, logging helpers, or the logic that searches folders. @@ -322,7 +321,7 @@ dependencies in the `--no-binary` flag when building the requirements for the ma # Releases The standard way to making a new release is the following: -1) Open a PR that increases the version number in setup.py. As a rule of thumb, just add one to the micro/patch version (e.g., v0.1.6 -> v0.1.7). +1) Open a PR that increases the version number in pyproject.toml. As a rule of thumb, just add one to the micro/patch version (e.g., v0.1.6 -> v0.1.7). 2) Get the up-to-date master branch locally and run the `tag.release` command from the Makefile. diff --git a/codecov_cli/opentelemetry.py b/codecov_cli/opentelemetry.py index 54a78d79a..8fc2ae41d 100644 --- a/codecov_cli/opentelemetry.py +++ b/codecov_cli/opentelemetry.py @@ -11,6 +11,8 @@ def init_telem(ctx): return if ctx['enterprise_url']: # dont run on dedicated cloud return + if os.getenv('CODECOV_ENV', 'production') == 'test': + return sentry_sdk.init( dsn="https://0bea75c61745c221a6ef1ac1709b1f4d@o26192.ingest.us.sentry.io/4508615876083713", diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..42ac23293 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +authors = [ + {name = "Tom Hu", email = "thomas.hu@sentry.io"}, +] +maintainers = [ + {name = "Codecov Support", email = "support@codecov.io"}, +] +description = "Codecov Command Line Interface" +dependencies = [ + "click==8.*", + "httpx==0.27.*", + "ijson==3.*", + "pyyaml==6.*", + "regex", + "responses==0.21.*", + "sentry-sdk>=2.20.0", + "test-results-parser==0.5.*", + "tree-sitter==0.20.*", + "wrapt>=1.17.2", +] +license = {file = "LICENSE"} +name = "codecov-cli" +readme = "README.md" +requires-python = ">= 3.9" +version = "10.0.1" + +[project.scripts] +codecov = "codecov_cli.main:run" +codecovcli = "codecov_cli.main:run" + +[tool.setuptools] +packages = ["codecov_cli"] + +[tool.cibuildwheel] +skip = "pp*" + +[tool.cibuildwheel.config-settings] +pure-python = "false" + +[tool.cibuildwheel.environment] +PIP_CONSTRAINT = "requirements.txt" diff --git a/requirements.txt b/requirements.txt index 46454bcbc..1dc8f028a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,55 +2,64 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile setup.py +# pip-compile --all-build-deps --all-extras pyproject.toml # -anyio==4.0.0 +anyio==4.8.0 # via httpx -certifi==2024.7.4 +certifi==2024.12.14 # via # httpcore # httpx # requests # sentry-sdk -charset-normalizer==3.3.0 +charset-normalizer==3.4.1 # via requests -click==8.1.7 - # via codecov-cli (setup.py) +click==8.1.8 + # via codecov-cli (pyproject.toml) h11==0.14.0 # via httpcore httpcore==1.0.7 # via httpx httpx==0.27.2 - # via codecov-cli (setup.py) -idna==3.7 + # via codecov-cli (pyproject.toml) +idna==3.10 # via # anyio # httpx # requests -ijson==3.2.3 - # via codecov-cli (setup.py) -pyyaml==6.0.1 - # via codecov-cli (setup.py) -regex==2023.12.25 - # via codecov-cli (setup.py) -requests==2.32.2 +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 + # via codecov-cli (pyproject.toml) +requests==2.32.3 # via responses responses==0.21.0 - # via codecov-cli (setup.py) + # via codecov-cli (pyproject.toml) sentry-sdk==2.20.0 - # via codecov-cli (setup.py) -sniffio==1.3.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.1 - # via codecov-cli (setup.py) -tree-sitter==0.20.2 - # via codecov-cli (setup.py) -urllib3==2.2.2 + # 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 # via # requests # responses # sentry-sdk wrapt==1.17.2 - # via codecov-cli (setup.py) + # via codecov-cli (pyproject.toml) + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/scripts/build_linux_arm.sh b/scripts/build_linux_arm.sh index f90abd024..58b4625fc 100755 --- a/scripts/build_linux_arm.sh +++ b/scripts/build_linux_arm.sh @@ -6,4 +6,4 @@ 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 -cp ./dist/main ./dist/codecovcli_$1 \ No newline at end of file +cp ./dist/main ./dist/codecovcli_$1 diff --git a/setup.py b/setup.py index a9bbf3620..8234a4a5c 100644 --- a/setup.py +++ b/setup.py @@ -1,40 +1,8 @@ -from os import path from platform import system -from setuptools import Extension, find_packages, setup - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() +from setuptools import Extension, setup setup( - name="codecov-cli", - version="10.0.1", - packages=find_packages(exclude=["contrib", "docs", "tests*"]), - description="Codecov Command Line Interface", - long_description=long_description, - long_description_content_type="text/markdown", - author="Codecov", - author_email="support@codecov.io", - install_requires=[ - "click==8.*", - "httpx==0.27.*", - "ijson==3.*", - "pyyaml==6.*", - "responses==0.21.*", - "tree-sitter==0.20.*", - "test-results-parser==0.5.*", - "regex", - "sentry-sdk>=2.20.0", - "wrapt>=1.17.2", - ], - entry_points={ - "console_scripts": [ - "codecovcli = codecov_cli.main:run", - ], - }, - python_requires=">=3.9", ext_modules=[ Extension( "staticcodecov_languages",