Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez authored Jan 24, 2025
2 parents 29a41d1 + cf35214 commit e783b71
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.conda-version }}-${{ matrix.test-type }}-$(date -u "+%Y%m")" >> $GITHUB_ENV

- name: Cache Conda
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
Expand Down Expand Up @@ -151,13 +151,13 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"
- name: Upload Coverage
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.4.0
with:
name: test-results-${{ env.HASH }}
path: |
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-benchmark-$(date -u "+%Y%m")" >> $GITHUB_ENV

- name: Cache Conda
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.conda-version }}-${{ matrix.test-type }}-$(date -u "+%Y%m")" >> $GITHUB_ENV

- name: Cache Conda
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
# Use faster GNU tar for all runners
enableCrossOsArchive: true
Expand Down Expand Up @@ -319,13 +319,13 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"
- name: Upload Coverage
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.4.0
with:
name: test-results-${{ env.HASH }}
path: |
Expand Down Expand Up @@ -375,7 +375,7 @@ jobs:
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.conda-version }}-${{ matrix.test-type }}-$(date -u "+%Y%m")" >> $GITHUB_ENV

- name: Cache Conda
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/conda_pkgs_dir
Expand Down Expand Up @@ -437,13 +437,13 @@ jobs:
CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }}

- name: Upload Coverage
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.4.0
with:
name: test-results-${{ env.HASH }}
path: |
Expand All @@ -469,7 +469,7 @@ jobs:

- name: Upload Combined Test Results
# provides one downloadable archive of all matrix run test results for further analysis
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.4.0
with:
name: test-results-${{ github.sha }}-all
path: test-results-*
Expand Down
5 changes: 5 additions & 0 deletions conda_build/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,11 @@ def find_used_variables_in_text(variant, recipe_text, selectors_only=False):
variant_lines = [
line for line in recipe_lines if v in line or target_lang in line
]
elif v.startswith("cdt_"):
variant_lines = [
line for line in recipe_lines if v in line or "cdt(" in line
]
all_res.append(r"\{{\s*cdt\(")
else:
variant_lines = [
line for line in recipe_lines if v in line.replace("-", "_")
Expand Down
19 changes: 19 additions & 0 deletions news/5599-cdt-used-vars.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Add `cdt_arch` and `cdt_name` as used vars when cdt jinja is used. (#5599)

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ pthread_stubs:
some_package:
- mooo
- llama
cdt_name:
- cos6
cdt_arch:
- baz
# not directly used, but is "used" by virtue of being zipped
zipped_var:
- chicken
Expand Down
2 changes: 2 additions & 0 deletions tests/test-recipes/variants/19_used_variables/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ requirements:
- zlib
# an implicit usage containing a dash
- pthread-stubs
# cdts
- {{ cdt('foo') }} # [linux]
run:
# python is only "used" if it's used in build and run - see above
- python
2 changes: 2 additions & 0 deletions tests/test_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ def test_get_used_loop_vars():
"zlib",
"pthread_stubs",
"target_platform",
"cdt_name",
"cdt_arch",
}


Expand Down

0 comments on commit e783b71

Please sign in to comment.