Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sys.exit with CondaBuildUserError exceptions #5255

Draft
wants to merge 42 commits into
base: 24.5.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a5a63c7
Bump codecov/codecov-action from 4.3.0 to 4.3.1 in /.github/workflows…
dependabot[bot] May 6, 2024
cf7e02e
Bump actions/checkout from 4.1.4 to 4.1.5 in /.github/workflows (#5328)
dependabot[bot] May 6, 2024
2afc503
🔄 synced file(s) with conda/infrastructure (#5331)
conda-bot May 12, 2024
5c53aa9
[pre-commit.ci] pre-commit autoupdate (#5327)
pre-commit-ci[bot] May 12, 2024
06cda41
Merge `24.5.x` back into `main`
kenodegard May 13, 2024
efb79db
🔄 synced file(s) with conda/infrastructure (#5335)
conda-bot May 13, 2024
0311d83
Add `upload.yml` workflow (#5339)
kenodegard May 13, 2024
9c0ceec
Bump conda/actions from 24.4.0 to 24.5.0 in /.github/workflows (#5337)
dependabot[bot] May 13, 2024
c49957f
Add CondaBuildUserError exception
kenodegard Mar 25, 2024
f87ea39
Replace sys.exit in copy_readme
kenodegard Mar 25, 2024
c99b53c
Add test for copy_readme()
beeankha Mar 25, 2024
972c9c2
Update test_filter_files
kenodegard Mar 27, 2024
d0587b6
Remove commented out code
kenodegard Mar 28, 2024
fad4399
Remove redundant error checking
kenodegard Mar 28, 2024
cfa5a1f
Replace sys.exit in bundle_conda
kenodegard Mar 28, 2024
4db9b36
Add test_wsl_unsupported
kenodegard Mar 28, 2024
2c648b9
Remove sys.exit from tests_failed(), add unit test
beeankha Apr 3, 2024
ae370ed
Mark check_external() for deprecation
beeankha Apr 3, 2024
baed5da
Add news file
beeankha Apr 3, 2024
f8a1906
Replace sys.exit in handle_anaconda_upload
kenodegard Apr 3, 2024
cb3d6cf
Replace sys.exit in inspect_linkages
kenodegard Apr 3, 2024
69f0ce9
Remove another sys.exit in inspect_linkages(), add test
beeankha Apr 3, 2024
b1f035a
Remove sys.exit call in inspect_objects() and add test
beeankha Apr 3, 2024
44bf3d6
Raise CondaBuildUserError in check_external
kenodegard Apr 4, 2024
a073f4b
Format strings
kenodegard Apr 4, 2024
192b334
Fix check_dist_info_version
kenodegard Apr 4, 2024
3795a49
Fix inspect tests
kenodegard Apr 4, 2024
cc6e292
Fix SystemExit tests
kenodegard Apr 4, 2024
e3a2b3d
Remove sys.exit from find_lib
kenodegard Apr 4, 2024
00062c8
Replace sys.exit in osx_ch_link
kenodegard May 1, 2024
f1d3b50
Update post.py
kenodegard May 1, 2024
cfb2ef4
Deprecate exception_on_error
kenodegard May 1, 2024
ddc9f96
Remove sys.exit from check_symlinks
kenodegard May 1, 2024
5c457d7
Remove ImportError for PyYAML since it is an explicit dependency
kenodegard May 1, 2024
e3e53fc
Fix test
kenodegard May 2, 2024
b886dcf
Remove sys.exit from select_lines
kenodegard May 2, 2024
46563a5
Remove sys.exit from sanitize/_git_clean
kenodegard May 2, 2024
8e9cbef
Remove sys.exit from check_bad_chrs
kenodegard May 2, 2024
8df5156
Use PrefixData instead of custom get_installed_packages
kenodegard May 2, 2024
e112c64
Jinaj2 is always installed
kenodegard May 2, 2024
5cb28a2
Replace sys.exit in _get_contents
kenodegard May 2, 2024
1943a58
Remove sys.exit from parse_until_resolved
kenodegard May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0

- name: Create and upload review build
uses: conda/actions/canary-release@1e442e090ad28c9b0f85697105703a303320ffd1
uses: conda/actions/canary-release@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0
with:
package-name: ${{ github.event.repository.name }}
subdir: ${{ matrix.subdir }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
- name: Setup
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
# 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 @@ -102,7 +102,7 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"

- name: Upload Coverage
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"

- name: Upload Coverage
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0

Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
-m "${{ env.PYTEST_MARKER }}"

- name: Upload Coverage
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}

Expand Down Expand Up @@ -504,7 +504,7 @@ 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.ref }}
clean: true
Expand Down Expand Up @@ -538,7 +538,7 @@ jobs:
Path(environ["GITHUB_ENV"]).write_text(f"ANACONDA_ORG_LABEL={label}")

- name: Create & Upload
uses: conda/actions/canary-release@1e442e090ad28c9b0f85697105703a303320ffd1
uses: conda/actions/canary-release@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0
with:
package-name: ${{ github.event.repository.name }}
subdir: ${{ matrix.subdir }}
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Upload release

on:
# https://docs.github.com/en/webhooks/webhook-events-and-payloads#release
release:
types: [published]

concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.ref_name || github.sha }}
cancel-in-progress: true

permissions:
contents: write

jobs:
# create source archive and upload it to the published release
# URL to the archive: https://github.com/conda/<repo>/releases/download/<tag>/<repo>-<tag>.tar.gz
upload:
if: '!github.event.repository.fork'
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}
steps:
- name: Checkout Source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Create Release Directory
run: mkdir -p release

- name: Archive Source
run: >
git archive
--prefix="${{ env.ARCHIVE_NAME }}/"
--output="release/${{ env.ARCHIVE_NAME }}.tar.gz"
HEAD

- name: Compute Checksum
run: >
sha256sum "release/${{ env.ARCHIVE_NAME }}.tar.gz"
| awk '{print $1}'
> "release/${{ env.ARCHIVE_NAME }}.tar.gz.sha256sum"

- name: Upload Archive
env:
GH_TOKEN: ${{ github.token }}
run: >
gh release upload
--clobber "${{ github.ref_name }}"
--repo "${{ github.repository }}"
release/*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ repos:
# auto format Python codes within docstrings
- id: blacken-docs
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
rev: v0.4.3
hooks:
# lint & attempt to correct failures (e.g. pyupgrade)
- id: ruff
Expand Down