-
Notifications
You must be signed in to change notification settings - Fork 146
Switched from miniconda-setup to micromamba-setup for mypy workflow #781
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,11 +55,11 @@ jobs: | |
| matrix: | ||
| python-version: ["3.10", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: pre-commit/[email protected] | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: pre-commit/[email protected] | ||
|
|
||
| test_ubuntu: | ||
| name: "Test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}" | ||
|
|
@@ -72,8 +72,8 @@ jobs: | |
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.12"] | ||
| fast-compile: [0,1] | ||
| float32: [0,1] | ||
| fast-compile: [0, 1] | ||
| float32: [0, 1] | ||
| install-numba: [0] | ||
| install-jax: [0] | ||
| part: | ||
|
|
@@ -84,7 +84,7 @@ jobs: | |
| - "tests/tensor/conv" | ||
| - "tests/tensor/rewriting" | ||
| - "tests/tensor/test_math.py" | ||
| - "tests/tensor/test_basic.py tests/tensor/test_inplace.py" | ||
| - "tests/tensor/test_basic.py tests/tensor/test_inplace.py" | ||
| - "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py" | ||
| exclude: | ||
| - python-version: "3.10" | ||
|
|
@@ -121,11 +121,13 @@ jobs: | |
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| uses: mamba-org/setup-micromamba@v1 | ||
| with: | ||
| miniforge-variant: Mambaforge | ||
| miniforge-version: latest | ||
| python-version: ${{ matrix.python-version }} | ||
| environment-name: pytensor-test | ||
| micromamba-version: "latest" | ||
| init-shell: bash | ||
| post-cleanup: "all" | ||
| create-args: python=${{ matrix.python-version }} | ||
|
|
||
| - name: Create matrix id | ||
| id: matrix-id | ||
|
|
@@ -138,7 +140,7 @@ jobs: | |
| echo "id=$MATRIX_ID" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash -l {0} | ||
| shell: micromamba-shell {0} | ||
| run: | | ||
| mamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock sympy | ||
| if [[ $INSTALL_NUMBA == "1" ]]; then mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi | ||
HangenYuu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
@@ -153,7 +155,7 @@ jobs: | |
| INSTALL_JAX: ${{ matrix.install-jax }} | ||
|
|
||
| - name: Run tests | ||
| shell: bash -l {0} | ||
| shell: micromamba-shell {0} | ||
| run: | | ||
| if [[ $FAST_COMPILE == "1" ]]; then export PYTENSOR_FLAGS=$PYTENSOR_FLAGS,mode=FAST_COMPILE; fi | ||
| if [[ $FLOAT32 == "1" ]]; then export PYTENSOR_FLAGS=$PYTENSOR_FLAGS,floatX=float32; fi | ||
|
|
@@ -175,55 +177,57 @@ jobs: | |
| path: coverage/coverage-${{ steps.matrix-id.outputs.id }}.xml | ||
|
|
||
| benchmarks: | ||
| name: "Benchmarks" | ||
| needs: | ||
| - changes | ||
| - style | ||
| runs-on: ubuntu-latest | ||
| if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }} | ||
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python 3.10 | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| miniforge-variant: Mambaforge | ||
| miniforge-version: latest | ||
| - name: Install dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark | ||
| pip install -e ./ | ||
| mamba list && pip freeze | ||
| python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))' | ||
| python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"' | ||
| env: | ||
| PYTHON_VERSION: 3.10 | ||
| - name: Download previous benchmark data | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ./cache | ||
| key: ${{ runner.os }}-benchmark | ||
| - name: Run benchmarks | ||
| shell: bash -l {0} | ||
| run: | | ||
| export PYTENSOR_FLAGS=mode=FAST_COMPILE,warn__ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc__cxxflags=-pipe | ||
| python -m pytest --runslow --benchmark-only --benchmark-json output.json | ||
| - name: Store benchmark result | ||
| uses: benchmark-action/github-action-benchmark@v1 | ||
| with: | ||
| name: Python Benchmark with pytest-benchmark | ||
| tool: 'pytest' | ||
| output-file-path: output.json | ||
| external-data-json-path: ./cache/benchmark-data.json | ||
| alert-threshold: '200%' | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| comment-on-alert: false | ||
| fail-on-alert: false | ||
| auto-push: false | ||
| name: "Benchmarks" | ||
| needs: | ||
| - changes | ||
| - style | ||
| runs-on: ubuntu-latest | ||
| if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }} | ||
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python 3.10 | ||
| uses: mamba-org/setup-micromamba@v1 | ||
| with: | ||
| environment-name: pytensor-test | ||
| micromamba-version: "latest" | ||
| init-shell: bash | ||
| post-cleanup: "all" | ||
| - name: Install dependencies | ||
| shell: micromamba-shell {0} | ||
| run: | | ||
| mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark | ||
HangenYuu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pip install -e ./ | ||
| mamba list && pip freeze | ||
HangenYuu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))' | ||
| python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"' | ||
| env: | ||
| PYTHON_VERSION: 3.10 | ||
| - name: Download previous benchmark data | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ./cache | ||
| key: ${{ runner.os }}-benchmark | ||
| - name: Run benchmarks | ||
| shell: micromamba-shell {0} | ||
| run: | | ||
| export PYTENSOR_FLAGS=mode=FAST_COMPILE,warn__ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc__cxxflags=-pipe | ||
| python -m pytest --runslow --benchmark-only --benchmark-json output.json | ||
| - name: Store benchmark result | ||
| uses: benchmark-action/github-action-benchmark@v1 | ||
| with: | ||
| name: Python Benchmark with pytest-benchmark | ||
| tool: "pytest" | ||
| output-file-path: output.json | ||
| external-data-json-path: ./cache/benchmark-data.json | ||
| alert-threshold: "200%" | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| comment-on-alert: false | ||
| fail-on-alert: false | ||
| auto-push: false | ||
|
|
||
| all-checks: | ||
| if: ${{ always() }} | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.