Repository: ni/nimi-python (language: python)

Issue:
The disappearance of Python Codecov has broken PR Checks
<!--
When filing an issue, please fill in the requested fields as thoroughly as you can and then delete this comment
Note: For issues, assistance, and questions about using NI products, please visit ni.com/support. Issues opened here should be specifically related to these Python APIs.
-->

### Description of issue

The "codecov" project mysteriously disappeared from PyPI overnight, breaking all of our PR checks, because they now fail to install it.

nimibot run example:
>py311-nimodinst-coverage: install_deps> python -I -m pip install codecov coverage
ERROR: Could not find a version that satisfies the requirement codecov (from versions: none)

travis-ci example:
>$ travis_retry pip install --upgrade tox==3.* tox-travis codecov
Collecting tox==3.*
  Downloading tox-3.28.0-py2.py3-none-any.whl (86 kB)
Collecting tox-travis
  Downloading tox_travis-0.13-py2.py3-none-any.whl (10 kB)
ERROR: Could not find a version that satisfies the requirement codecov (from versions: 0.0.0a2)
ERROR: No matching distribution found for codecov


### Steps to reproduce issue
Create a PR


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/github_actions_aws_rhel_python64.yml b/.github/workflows/github_actions_aws_rhel_python64.yml
index 505bc08f1..fc3d9bcc2 100644
--- a/.github/workflows/github_actions_aws_rhel_python64.yml
+++ b/.github/workflows/github_actions_aws_rhel_python64.yml
@@ -34,3 +34,9 @@ jobs:
         uses: ./.github/actions/linux
         with:
           module_name: ${{ matrix.module_name }}
+      - name: upload coverage
+        uses: codecov/codecov-action@v3
+        with:
+          flags: ${{ matrix.module_name }}systemtests
+          name: ${{ matrix.module_name }}
+          files: ./generated/${{ matrix.module_name }}/coverage.xml
diff --git a/.github/workflows/github_actions_aws_windows_python32.yml b/.github/workflows/github_actions_aws_windows_python32.yml
index 93d2c7b44..d3869ce6f 100644
--- a/.github/workflows/github_actions_aws_windows_python32.yml
+++ b/.github/workflows/github_actions_aws_windows_python32.yml
@@ -46,3 +46,9 @@ jobs:
           uses: ./.github/actions/windows
           with:
             module_name: ${{ matrix.module_name }}
+        - name: upload coverage
+          uses: codecov/codecov-action@v3
+          with:
+            flags: ${{ matrix.module_name }}systemtests
+            name: ${{ matrix.module_name }}
+            files: ./generated/${{ matrix.module_name }}/coverage.xml
diff --git a/.github/workflows/github_actions_aws_windows_python64.yml b/.github/workflows/github_actions_aws_windows_python64.yml
index 1ed9b7629..0f46f2a10 100644
--- a/.github/workflows/github_actions_aws_windows_python64.yml
+++ b/.github/workflows/github_actions_aws_windows_python64.yml
@@ -46,3 +46,9 @@ jobs:
           uses: ./.github/actions/windows
           with:
             module_name: ${{ matrix.module_name }}
+        - name: upload coverage
+          uses: codecov/codecov-action@v3
+          with:
+            flags: ${{ matrix.module_name }}systemtests
+            name: ${{ matrix.module_name }}
+            files: ./generated/${{ matrix.module_name }}/coverage.xml
diff --git a/.travis.yml b/.travis.yml
index 686ee6e17..09b54e56c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ install:
   - travis_retry pip install --upgrade pip
   # tox 4.0 broke plugin compatibility
   # TODO(ni-jfitzger): When tox-travis has a release compatible with tox>=4.0, remove the tox version specifier (Tracked on GitHub by #1876)
-  - travis_retry pip install --upgrade tox==3.* tox-travis codecov
+  - travis_retry pip install --upgrade tox==3.* tox-travis
 
 before_script:
   - python tools/ensure_codegen_up_to_date.py
@@ -25,9 +25,18 @@ script:
   - tox -c tox-travis.ini
 
 after_success:
-  - travis_retry codecov --flags codegenunittests --file codegen.xml
-  - travis_retry codecov --flags nifakeunittests --file nifakeunittest.xml
-  - travis_retry codecov --flags nidcpowerunittests --file nidcpowerunittest.xml
-  - travis_retry codecov --flags nidigitalunittests --file nidigitalunittest.xml
-  - travis_retry codecov --flags nimodinstunittests --file nimodinstunittest.xml
-  - travis_retry codecov --flags nitclkunittests --file nitclkunittest.xml
+  # Install and verify codecov tool
+  - travis_retry curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
+  - travis_retry curl -Os https://uploader.codecov.io/latest/linux/codecov  # download codecov tool
+  - travis_retry curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
+  - travis_retry curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
+  - travis_retry gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
+  - travis_retry shasum -a 256 -c codecov.SHA256SUM
+  - travis_retry chmod +x codecov
+  # upload coverage
+  - travis_retry ./codecov --flags codegenunittests --file codegen.xml
+  - travis_retry ./codecov --flags nifakeunittests --file nifakeunittest.xml
+  - travis_retry ./codecov --flags nidcpowerunittests --file nidcpowerunittest.xml
+  - travis_retry ./codecov --flags nidigitalunittests --file nidigitalunittest.xml
+  - travis_retry ./codecov --flags nimodinstunittests --file nimodinstunittest.xml
+  - travis_retry ./codecov --flags nitclkunittests --file nitclkunittest.xml


Test patch:
diff --git a/build/templates/tox-system_tests.ini.mako b/build/templates/tox-system_tests.ini.mako
index f367e4a78..d8b41df6c 100644
--- a/build/templates/tox-system_tests.ini.mako
+++ b/build/templates/tox-system_tests.ini.mako
@@ -38,7 +38,7 @@ description =
     ${wheel_env_no_py}: Build the ${other_wheel} wheel because we use it in ${module_name} tests
 % endif
     ${module_name}-system_tests: Run ${module_name} system tests (requires ${driver_name} runtime to be installed)
-    ${module_name}-coverage: Report all coverage results to codecov.io
+    ${module_name}-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
 % if uses_other_wheel:
@@ -66,8 +66,6 @@ commands =
     ${module_name}-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     ${module_name}-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    ${module_name}-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags ${module_name}systemtests --name ${module_name} --root ../.. --file coverage.xml
 
 deps =
 % if uses_other_wheel:
@@ -85,7 +83,6 @@ deps =
 % endif
 
     ${module_name}-coverage: coverage
-    ${module_name}-coverage: codecov
 
 depends =
     ${module_name}-coverage: py{37,38,39,310,311}-${module_name}-system_tests
diff --git a/generated/nidcpower/tox-system_tests.ini b/generated/nidcpower/tox-system_tests.ini
index aac42a9c0..3eb3c92c3 100644
--- a/generated/nidcpower/tox-system_tests.ini
+++ b/generated/nidcpower/tox-system_tests.ini
@@ -12,7 +12,7 @@ toxworkdir = ../../../.tox
 [testenv]
 description =
     nidcpower-system_tests: Run nidcpower system tests (requires NI-DCPower runtime to be installed)
-    nidcpower-coverage: Report all coverage results to codecov.io
+    nidcpower-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nidcpower-system_tests: .
@@ -30,8 +30,6 @@ commands =
     nidcpower-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nidcpower-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nidcpower-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nidcpowersystemtests --name nidcpower --root ../.. --file coverage.xml
 
 deps =
     nidcpower-system_tests: pytest
@@ -43,7 +41,6 @@ deps =
     nidcpower-system_tests: .[grpc]
 
     nidcpower-coverage: coverage
-    nidcpower-coverage: codecov
 
 depends =
     nidcpower-coverage: py{37,38,39,310,311}-nidcpower-system_tests
diff --git a/generated/nidigital/tox-system_tests.ini b/generated/nidigital/tox-system_tests.ini
index c772e7686..42f3c83e5 100644
--- a/generated/nidigital/tox-system_tests.ini
+++ b/generated/nidigital/tox-system_tests.ini
@@ -13,7 +13,7 @@ toxworkdir = ../../../.tox
 description =
     nidigital-wheel_dep: Build the nitclk wheel because we use it in nidigital tests
     nidigital-system_tests: Run nidigital system tests (requires NI-Digital Pattern Driver runtime to be installed)
-    nidigital-coverage: Report all coverage results to codecov.io
+    nidigital-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nidigital-wheel_dep: ../nitclk
@@ -35,8 +35,6 @@ commands =
     nidigital-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nidigital-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nidigital-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nidigitalsystemtests --name nidigital --root ../.. --file coverage.xml
 
 deps =
     nidigital-wheel_dep: packaging
@@ -50,7 +48,6 @@ deps =
     nidigital-system_tests: .[grpc]
 
     nidigital-coverage: coverage
-    nidigital-coverage: codecov
 
 depends =
     nidigital-coverage: py{37,38,39,310,311}-nidigital-system_tests
diff --git a/generated/nidmm/tox-system_tests.ini b/generated/nidmm/tox-system_tests.ini
index 2de805bb0..5406e09ee 100644
--- a/generated/nidmm/tox-system_tests.ini
+++ b/generated/nidmm/tox-system_tests.ini
@@ -12,7 +12,7 @@ toxworkdir = ../../../.tox
 [testenv]
 description =
     nidmm-system_tests: Run nidmm system tests (requires NI-DMM runtime to be installed)
-    nidmm-coverage: Report all coverage results to codecov.io
+    nidmm-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nidmm-system_tests: .
@@ -30,8 +30,6 @@ commands =
     nidmm-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nidmm-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nidmm-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nidmmsystemtests --name nidmm --root ../.. --file coverage.xml
 
 deps =
     nidmm-system_tests: pytest
@@ -43,7 +41,6 @@ deps =
     nidmm-system_tests: .[grpc]
 
     nidmm-coverage: coverage
-    nidmm-coverage: codecov
 
 depends =
     nidmm-coverage: py{37,38,39,310,311}-nidmm-system_tests
diff --git a/generated/nifake/tox-system_tests.ini b/generated/nifake/tox-system_tests.ini
index 73bdcb0f1..573fe8f40 100644
--- a/generated/nifake/tox-system_tests.ini
+++ b/generated/nifake/tox-system_tests.ini
@@ -13,7 +13,7 @@ toxworkdir = ../../../.tox
 description =
     nifake-wheel_dep: Build the nitclk wheel because we use it in nifake tests
     nifake-system_tests: Run nifake system tests (requires NI-FAKE runtime to be installed)
-    nifake-coverage: Report all coverage results to codecov.io
+    nifake-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nifake-wheel_dep: ../nitclk
@@ -35,8 +35,6 @@ commands =
     nifake-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nifake-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nifake-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nifakesystemtests --name nifake --root ../.. --file coverage.xml
 
 deps =
     nifake-wheel_dep: packaging
@@ -50,7 +48,6 @@ deps =
     nifake-system_tests: .[grpc]
 
     nifake-coverage: coverage
-    nifake-coverage: codecov
 
 depends =
     nifake-coverage: py{37,38,39,310,311}-nifake-system_tests
diff --git a/generated/nifgen/tox-system_tests.ini b/generated/nifgen/tox-system_tests.ini
index 9ffcae0d2..d08f83b76 100644
--- a/generated/nifgen/tox-system_tests.ini
+++ b/generated/nifgen/tox-system_tests.ini
@@ -13,7 +13,7 @@ toxworkdir = ../../../.tox
 description =
     nifgen-wheel_dep: Build the nitclk wheel because we use it in nifgen tests
     nifgen-system_tests: Run nifgen system tests (requires NI-FGEN runtime to be installed)
-    nifgen-coverage: Report all coverage results to codecov.io
+    nifgen-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nifgen-wheel_dep: ../nitclk
@@ -35,8 +35,6 @@ commands =
     nifgen-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nifgen-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nifgen-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nifgensystemtests --name nifgen --root ../.. --file coverage.xml
 
 deps =
     nifgen-wheel_dep: packaging
@@ -50,7 +48,6 @@ deps =
     nifgen-system_tests: .[grpc]
 
     nifgen-coverage: coverage
-    nifgen-coverage: codecov
 
 depends =
     nifgen-coverage: py{37,38,39,310,311}-nifgen-system_tests
diff --git a/generated/nimodinst/tox-system_tests.ini b/generated/nimodinst/tox-system_tests.ini
index 6310773d7..a8e4be2db 100644
--- a/generated/nimodinst/tox-system_tests.ini
+++ b/generated/nimodinst/tox-system_tests.ini
@@ -12,7 +12,7 @@ toxworkdir = ../../../.tox
 [testenv]
 description =
     nimodinst-system_tests: Run nimodinst system tests (requires NI-ModInst runtime to be installed)
-    nimodinst-coverage: Report all coverage results to codecov.io
+    nimodinst-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nimodinst-system_tests: .
@@ -30,8 +30,6 @@ commands =
     nimodinst-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nimodinst-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nimodinst-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nimodinstsystemtests --name nimodinst --root ../.. --file coverage.xml
 
 deps =
     nimodinst-system_tests: pytest
@@ -42,7 +40,6 @@ deps =
     nimodinst-system_tests: pytest-json
 
     nimodinst-coverage: coverage
-    nimodinst-coverage: codecov
 
 depends =
     nimodinst-coverage: py{37,38,39,310,311}-nimodinst-system_tests
diff --git a/generated/niscope/tox-system_tests.ini b/generated/niscope/tox-system_tests.ini
index 38ef22420..c3cc4fb77 100644
--- a/generated/niscope/tox-system_tests.ini
+++ b/generated/niscope/tox-system_tests.ini
@@ -13,7 +13,7 @@ toxworkdir = ../../../.tox
 description =
     niscope-wheel_dep: Build the nitclk wheel because we use it in niscope tests
     niscope-system_tests: Run niscope system tests (requires NI-SCOPE runtime to be installed)
-    niscope-coverage: Report all coverage results to codecov.io
+    niscope-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     niscope-wheel_dep: ../nitclk
@@ -35,8 +35,6 @@ commands =
     niscope-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     niscope-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    niscope-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags niscopesystemtests --name niscope --root ../.. --file coverage.xml
 
 deps =
     niscope-wheel_dep: packaging
@@ -50,7 +48,6 @@ deps =
     niscope-system_tests: .[grpc]
 
     niscope-coverage: coverage
-    niscope-coverage: codecov
 
 depends =
     niscope-coverage: py{37,38,39,310,311}-niscope-system_tests
diff --git a/generated/nise/tox-system_tests.ini b/generated/nise/tox-system_tests.ini
index 3df0a7b62..6ce88232e 100644
--- a/generated/nise/tox-system_tests.ini
+++ b/generated/nise/tox-system_tests.ini
@@ -12,7 +12,7 @@ toxworkdir = ../../../.tox
 [testenv]
 description =
     nise-system_tests: Run nise system tests (requires NI Switch Executive runtime to be installed)
-    nise-coverage: Report all coverage results to codecov.io
+    nise-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nise-system_tests: .
@@ -30,8 +30,6 @@ commands =
     nise-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nise-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nise-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nisesystemtests --name nise --root ../.. --file coverage.xml
 
 deps =
     nise-system_tests: pytest
@@ -42,7 +40,6 @@ deps =
     nise-system_tests: pytest-json
 
     nise-coverage: coverage
-    nise-coverage: codecov
 
 depends =
     nise-coverage: py{37,38,39,310,311}-nise-system_tests
diff --git a/generated/niswitch/tox-system_tests.ini b/generated/niswitch/tox-system_tests.ini
index 8933cc0b2..7675986f2 100644
--- a/generated/niswitch/tox-system_tests.ini
+++ b/generated/niswitch/tox-system_tests.ini
@@ -12,7 +12,7 @@ toxworkdir = ../../../.tox
 [testenv]
 description =
     niswitch-system_tests: Run niswitch system tests (requires NI-SWITCH runtime to be installed)
-    niswitch-coverage: Report all coverage results to codecov.io
+    niswitch-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     niswitch-system_tests: .
@@ -30,8 +30,6 @@ commands =
     niswitch-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     niswitch-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    niswitch-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags niswitchsystemtests --name niswitch --root ../.. --file coverage.xml
 
 deps =
     niswitch-system_tests: pytest
@@ -43,7 +41,6 @@ deps =
     niswitch-system_tests: .[grpc]
 
     niswitch-coverage: coverage
-    niswitch-coverage: codecov
 
 depends =
     niswitch-coverage: py{37,38,39,310,311}-niswitch-system_tests
diff --git a/generated/nitclk/tox-system_tests.ini b/generated/nitclk/tox-system_tests.ini
index defc20e1a..5cd3278af 100644
--- a/generated/nitclk/tox-system_tests.ini
+++ b/generated/nitclk/tox-system_tests.ini
@@ -13,7 +13,7 @@ toxworkdir = ../../../.tox
 description =
     nitclk-wheel_dep: Build the niscope wheel because we use it in nitclk tests
     nitclk-system_tests: Run nitclk system tests (requires NI-TClk runtime to be installed)
-    nitclk-coverage: Report all coverage results to codecov.io
+    nitclk-coverage: Prepare coverage report for upload to codecov.io  # upload handled by GitHub Actions
 
 changedir =
     nitclk-wheel_dep: ../niscope
@@ -35,8 +35,6 @@ commands =
     nitclk-coverage: coverage xml -i --rcfile=../../tools/coverage_system_tests.rc
     # Display the coverage results
     nitclk-coverage: coverage report --rcfile=../../tools/coverage_system_tests.rc
-    # token is from codecov
-    nitclk-coverage: codecov -X gcov --token=4c58f03d-b74c-489a-889a-ab0a77b7809f --no-color --flags nitclksystemtests --name nitclk --root ../.. --file coverage.xml
 
 deps =
     nitclk-wheel_dep: packaging
@@ -49,7 +47,6 @@ deps =
     nitclk-system_tests: pytest-json
 
     nitclk-coverage: coverage
-    nitclk-coverage: codecov
 
 depends =
     nitclk-coverage: py{37,38,39,310,311}-nitclk-system_tests