Skip to content

Don't run the PyPi job all the time #1363

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Apr 9, 2025

This was mostly Claude-generated changes, so appreciate careful review.

Trying to save tons of compute time we wast building the cython-scan extension on the ubuntu wheel for every PR and push to main. Closes #219


📚 Documentation preview 📚: https://pytensor--1363.org.readthedocs.build/en/1363/

outputs:
should_run: ${{ steps.filter.outputs.any_changed }}
steps:
- uses: actions/checkout@v4

Check warning

Code scanning / zizmor

does not set persist-credentials: false Warning

does not set persist-credentials: false
Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.05%. Comparing base (0c398e3) to head (047065f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1363   +/-   ##
=======================================
  Coverage   82.05%   82.05%           
=======================================
  Files         203      203           
  Lines       48863    48863           
  Branches     8695     8695           
=======================================
  Hits        40093    40093           
  Misses       6619     6619           
  Partials     2151     2151           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94 ricardoV94 requested review from maresb and lucianopaz April 9, 2025 18:08
# Run if it's a release, auto-release branch, or if relevant files changed on main
if: |
github.event_name == 'release' ||
github.ref == 'refs/heads/auto-release' ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should delete all references to auto-release AFAIK it predates PyTensor

outputs:
should_run: ${{ steps.filter.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
persist-credentials: false

@@ -17,9 +17,34 @@ concurrency:
cancel-in-progress: true

jobs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make zizmor happy about default permissions

Suggested change
jobs:
permissions: {}
jobs:

Copy link
Contributor

@lucianopaz lucianopaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like there's potential to group the whole condition of the if job runs into an output of the check_changes job. I'm not sure how to do that though. Maybe Claude knows. I've added a suggestion on to kind of hint at what I mean.

should_run: ${{ steps.filter.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3

Comment on lines +46 to +47
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
(
(github.ref == 'refs/heads/main' || github.event_name == 'pull_request')
&& needs.check_changes.outputs.should_run == 'true'
)

Comment on lines +82 to +83
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
(
(github.ref == 'refs/heads/main' || github.event_name == 'pull_request')
&& needs.check_changes.outputs.should_run == 'true'
)

Comment on lines +102 to +103
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
(
(github.ref == 'refs/heads/main' || github.event_name == 'pull_request')
&& needs.check_changes.outputs.should_run == 'true'
)

Comment on lines +143 to +144
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
(
(github.ref == 'refs/heads/main' || github.event_name == 'pull_request')
&& needs.check_changes.outputs.should_run == 'true'
)

Comment on lines +186 to +187
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
(github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
(
(github.ref == 'refs/heads/main' || github.event_name == 'pull_request')
&& needs.check_changes.outputs.should_run == 'true'
)

check_changes:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.filter.outputs.any_changed }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
should_run: ${{ steps.filter.outputs.any_changed }}
should_run: |
echo "${{ github.event_name == 'release' ||
github.ref == 'refs/heads/auto-release' ||
(
github.ref == 'refs/heads/main' || github.event_name == 'pull_request') &&
steps.filter.outputs.any_changed == 'true'
) }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build wheels on Ubuntu CI takes a long time
3 participants