Skip to content

Commit

Permalink
Merge branch 'main' into python_sp_path
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhelmus authored Nov 4, 2024
2 parents 14ac30c + deb8399 commit 592c44b
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/builds-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
# Clean checkout of specific git ref needed for package metadata version
# which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0

- name: Create and upload review build
uses: conda/actions/canary-release@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0
uses: conda/actions/canary-release@15f883f14f4232f83658e3609c3316d58905138f # v24.8.0
with:
package-name: ${{ github.event.repository.name }}
subdir: ${{ matrix.subdir }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: '!github.event.repository.fork'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
GLOBAL: https://raw.githubusercontent.com/conda/infra/main/.github/global.yml
LOCAL: .github/labels.yml
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- id: has_local
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
code: ${{ steps.filter.outputs.code }}
steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# dorny/paths-filter needs git clone for non-PR events
# https://github.com/dorny/paths-filter#supported-workflows
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -103,15 +103,15 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Hash + Timestamp
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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
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@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

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

steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Hash + Timestamp
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-benchmark-$(date -u "+%Y%m")" >> $GITHUB_ENV

- name: Cache Conda
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
run: conda list --show-channel-urls

- name: Run Benchmarks
uses: CodSpeedHQ/action@a58b84c0b61569a9cbb7cfb378cc849d65cf1ce5 # v2.4.3
uses: CodSpeedHQ/action@b587655f756aab640e742fec141261bc6f0a569d # v3.0.1
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: $CONDA/envs/test/bin/pytest --codspeed
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

Expand All @@ -271,7 +271,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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
Expand Down Expand Up @@ -317,13 +317,13 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"
- name: Upload Coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.4.0
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
with:
name: test-results-${{ env.HASH }}
path: |
Expand Down Expand Up @@ -365,15 +365,15 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Hash + Timestamp
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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
~/conda_pkgs_dir
Expand Down Expand Up @@ -435,13 +435,13 @@ jobs:
CONDA_BUILD_SYSROOT: ${{ env.MACOSX_SDK_ROOT }}

- name: Upload Coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

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

- name: Upload Combined Test Results
# provides one downloadable archive of all matrix run test results for further analysis
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.4.0
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.0
with:
name: test-results-${{ github.sha }}-all
path: test-results-*
Expand Down Expand Up @@ -522,15 +522,15 @@ jobs:
# Clean checkout of specific git ref needed for package metadata version
# which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0

# Explicitly use Python 3.12 since each of the OSes has a different default Python
- name: Setup Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.12'

Expand All @@ -556,7 +556,7 @@ jobs:
Path(environ["GITHUB_ENV"]).write_text(f"ANACONDA_ORG_LABEL={label}")
- name: Create & Upload
uses: conda/actions/canary-release@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0
uses: conda/actions/canary-release@15f883f14f4232f83658e3609c3316d58905138f # v24.8.0
with:
package-name: ${{ github.event.repository.name }}
subdir: ${{ matrix.subdir }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
echo REPOSITORY=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.repo.full_name') >> $GITHUB_ENV
echo REF=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.ref') >> $GITHUB_ENV
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ${{ env.REPOSITORY || github.repository }}
ref: ${{ env.REF || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}
steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Create Release Directory
run: mkdir -p release
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ repos:
files: \.py$
args: [--license-filepath, .github/disclaimer.txt, --no-extra-eol]
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.0
rev: 1.19.1
hooks:
# auto format Python codes within docstrings
- id: blacken-docs
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.1
hooks:
# lint & attempt to correct failures (e.g. pyupgrade)
- id: ruff
Expand Down
6 changes: 4 additions & 2 deletions conda_build/skeletons/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
diff core.py core.py
--- core.py
+++ core.py
@@ -166,5 +167,40 @@ def setup (**attrs):
@@ -166,5 +167,42 @@ def setup (**attrs):
\n
+# ====== BEGIN CONDA SKELETON PYPI PATCH ======
+
Expand Down Expand Up @@ -154,7 +154,9 @@
+ data['classifiers'] = kwargs.get('classifiers', None)
+ data['version'] = kwargs.get('version', '??PACKAGE-VERSION-UNKNOWN??')
+ with io.open(os.path.join("{}", "pkginfo.yaml"), 'w', encoding='utf-8') as fn:
+ fn.write(yaml.safe_dump(data, encoding=None))
+ _yaml = yaml.YAML(typ='safe', pure=True)
+ _yaml.encoding = None
+ _yaml.dump(data, fn)
+
+
+# ======= END CONDA SKELETON PYPI PATCH ======
Expand Down
12 changes: 10 additions & 2 deletions conda_build/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,16 @@ def find_used_variables_in_text(variant, recipe_text, selectors_only=False):
)
# TODO: this `for` regex won't catch some common cases like lists of vars, multiline
# jinja2 blocks, if filters on the for loop, etc.
for_regex = r"(?:^|[^\{])\{%\s*for\s*.*\s*in\s*" + v_regex + r"(?:[^%]*?)?%\}"
set_regex = r"(?:^|[^\{])\{%\s*set\s*.*\s*=\s*.*" + v_regex + r"(?:[^%]*?)?%\}"
for_regex = (
r"(?:^|[^\{])\{%\s*for\s*.*\s*in\s*"
+ v_regex
+ r"(?![a-zA-Z_0-9])(?:[^%]*?)?%\}"
)
set_regex = (
r"(?:^|[^\{])\{%\s*set\s*.*\s*=\s*.*"
+ v_regex
+ r"(?![a-zA-Z_0-9])(?:[^%]*?)?%\}"
)
# plain req name, no version spec. Look for end of line after name, or comment or selector
requirement_regex = rf"^\s+\-\s+{v_req_regex}\s*(?:\s[\[#]|$)"
if selectors_only:
Expand Down
12 changes: 6 additions & 6 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Pillow==10.0.1
PyYAML==6.0.1
Sphinx==7.4.7
conda-sphinx-theme==0.2.1
Sphinx==8.1.3
conda-sphinx-theme==0.2.2
linkify-it-py==2.0.2
myst-parser==2.0.0
myst-parser==4.0.0
pylint==2.17.5
requests==2.31.0
ruamel.yaml==0.17.32
sphinx-argparse==0.4.0
sphinx-autobuild==2021.3.14
sphinx-sitemap==2.5.1
sphinx_design==0.5.0
sphinx_design==0.6.1
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-plantuml==0.26
sphinxcontrib-programoutput==0.17
Expand Down
19 changes: 19 additions & 0 deletions news/5514-better-jinja2-regex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Fixed regex for Jinja2 `set` / `for` statements to be more specific. (#5514)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
19 changes: 19 additions & 0 deletions news/5517-fix-skeleton-patch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Fixed ruamel.yaml usage to use supported APIs. (#5517)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
19 changes: 19 additions & 0 deletions news/5518-fix-docs-build.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Fixed bug in docs build by pinning conda-sphinx-theme to 0.2.2. (#5518)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
3 changes: 2 additions & 1 deletion tests/test_api_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ def test_pypi_section_order_preserved(tmp_path: Path):
]

# The loader below preserves the order of entries...
recipe = ruamel.yaml.load("\n".join(lines), Loader=ruamel.yaml.RoundTripLoader)
_yaml = ruamel.yaml.YAML(typ="rt")
recipe = _yaml.load("\n".join(lines))

major_sections = list(recipe.keys())
# Blank fields are omitted when skeletonizing, so prune any missing ones
Expand Down

0 comments on commit 592c44b

Please sign in to comment.