diff --git a/.github/workflows/canary-weekly.yml b/.github/workflows/canary-weekly.yml index f19ce49..7438f23 100644 --- a/.github/workflows/canary-weekly.yml +++ b/.github/workflows/canary-weekly.yml @@ -68,12 +68,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Download test results - uses: actions/download-artifact@v3 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 - name: Upload combined test results # provides one downloadable archive of all .coverage/test-report.xml files # of all matrix runs for further analysis. - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: test-results-${{ github.sha }}-all path: test-results-${{ github.sha }}-* diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index ad56cf6..66df3b0 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check CLA - uses: conda/actions/check-cla@1e442e090ad28c9b0f85697105703a303320ffd1 + uses: conda/actions/check-cla@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0 with: # [required] # A token with ability to comment, label, and modify the commit status diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 7a114d6..634bf13 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -23,12 +23,12 @@ jobs: runs-on: ubuntu-latest steps: # remove [pending::feedback] - - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 + - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 with: labels: ${{ env.FEEDBACK_LBL }} github_token: ${{ secrets.PROJECT_TOKEN }} # add [pending::support], if still open - - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf + - uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3 if: github.event.issue.state == 'open' with: labels: ${{ env.SUPPORT_LBL }} diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index e6817dd..4741235 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -19,20 +19,20 @@ jobs: GLOBAL: https://raw.githubusercontent.com/conda/infra/main/.github/global.yml LOCAL: .github/labels.yml steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - id: has_local - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 with: files: ${{ env.LOCAL }} - name: Global Only - uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a + uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3 if: steps.has_local.outputs.files_exists == 'false' with: config-file: ${{ env.GLOBAL }} delete-other-labels: true dry-run: ${{ github.event.inputs.dryrun }} - name: Global & Local - uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a + uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3 if: steps.has_local.outputs.files_exists == 'true' with: config-file: | diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 2204b62..0b63dec 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -17,7 +17,7 @@ jobs: if: '!github.event.repository.fork' runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: # Number of days of inactivity before a closed issue is locked issue-inactive-days: 365 diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index 7d06584..297ac22 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -13,7 +13,7 @@ jobs: if: '!github.event.repository.fork' runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 + - uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1 with: # issues are added to the Planning project # PRs are added to the Review project diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 78f4ac5..bde3340 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -33,12 +33,12 @@ jobs: days-before-issue-stale: 90 days-before-issue-close: 21 steps: - - uses: conda/actions/read-yaml@1e442e090ad28c9b0f85697105703a303320ffd1 + - uses: conda/actions/read-yaml@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0 id: read_yaml with: path: https://raw.githubusercontent.com/conda/infra/main/.github/messages.yml - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 id: stale with: # Only issues with these labels are checked whether they are stale diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 22cd0e7..53ff725 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,12 +61,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Download test results - uses: actions/download-artifact@v3 + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 - name: Upload combined test results # provides one downloadable archive of all .coverage/test-report.xml files # of all matrix runs for further analysis. - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: test-results-${{ github.sha }}-all path: test-results-${{ github.sha }}-* diff --git a/conda_index/index/__init__.py b/conda_index/index/__init__.py index 2c6b923..bdc1a19 100644 --- a/conda_index/index/__init__.py +++ b/conda_index/index/__init__.py @@ -1086,15 +1086,7 @@ def build_run_exports_data(self, subdir, verbose=False, progress=False): run_exports_conda_packages = {} # load cached packages - for row in cache.db.execute( - """ - SELECT path, run_exports FROM stat - LEFT JOIN run_exports USING (path) - WHERE stat.stage = ? - ORDER BY path - """, - (cache.upstream_stage,), - ): + for row in cache.run_exports(): path, run_exports_data = row run_exports_data = {"run_exports": json.loads(run_exports_data or "{}")} if path.endswith(CONDA_PACKAGE_EXTENSION_V1): diff --git a/conda_index/index/sqlitecache.py b/conda_index/index/sqlitecache.py index 5bfa097..112a30e 100644 --- a/conda_index/index/sqlitecache.py +++ b/conda_index/index/sqlitecache.py @@ -542,6 +542,21 @@ def store_index_json_stat(self, database_path, mtime, size, index_json): (database_path, mtime, size, index_json["sha256"], index_json["md5"]), ) + def run_exports(self): + """ + Query returning run_exports data, to be formatted by + ChannelIndex.build_run_exports_data() + """ + return self.db.execute( + """ + SELECT path, run_exports FROM stat + LEFT JOIN run_exports USING (path) + WHERE stat.stage = ? + ORDER BY path + """, + (self.upstream_stage,), + ) + def _cache_post_install_details(paths_json_str): post_install_details_json = { diff --git a/news/163-cache-run-exports b/news/163-cache-run-exports new file mode 100644 index 0000000..7cb2e32 --- /dev/null +++ b/news/163-cache-run-exports @@ -0,0 +1,20 @@ +### Enhancements + +* + +### Bug fixes + +* Move `run_exports.json` query into cache, instead of directly using SQL in + `ChannelIndex`. (#163) + +### Deprecations + +* + +### Docs + +* + +### Other + +*