-
Notifications
You must be signed in to change notification settings - Fork 3
Minor Updates #17
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
Minor Updates #17
Changes from all commits
b29d924
dcaf6e8
31c3862
a3fb6f3
73026bc
9d8bba4
a467653
ba57033
1ae2327
2e0c065
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Generate release schedule artifacts | ||
| on: | ||
| schedule: | ||
| # At 00:00 on day-of-month 2 in every 3rd month. (i.e. every quarter) | ||
| # 2nd is chosen to avoid fencepost errors | ||
| - cron: "0 0 2 */3 *" | ||
| push: | ||
| branches: | ||
| - "main" | ||
| # On demand | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| create-artifacts: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| # We're going to make a tag that we can we release so we'll need the full history for that | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: prefix-dev/[email protected] | ||
| with: | ||
| pixi-version: "v0.49.0" | ||
|
|
||
| - name: Generate artifacts | ||
| run: | | ||
| pixi run generate-schedule --locked | ||
|
|
||
| - name: Test json artifact | ||
| run: | | ||
| cat schedule.json | jq | ||
|
|
||
| - name: setup git | ||
| run: | | ||
| # git will complain if we don't do this first | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: determine tag name | ||
| id: tag_name | ||
| run: | | ||
| echo "TAG_NAME=$(date '+%Y-Q%q')" >> "$GITHUB_OUTPUT" | ||
| - name: Commit artifacts and create tag | ||
| env: | ||
| GH_TOKEN: ${{ secrets.RELEASE_PAT }} | ||
| run: | | ||
| git add -f schedule.md chart.md schedule.json | ||
| git commit -m "generate schedule for ${{ steps.tag_name.outputs.TAG_NAME }} release" || echo "No changes to commit" | ||
| git tag ${{ steps.tag_name.outputs.TAG_NAME }} | ||
| git push origin main | ||
| git push origin tag ${{ steps.tag_name.outputs.TAG_NAME }} | ||
|
|
||
| - name: Publish github release | ||
| uses: softprops/action-gh-release@v2 | ||
| env: | ||
| GH_TOKEN: ${{ secrets.RELEASE_PAT }} | ||
| with: | ||
| generate_release_notes: true | ||
| tag_name: ${{ steps.tag_name.outputs.TAG_NAME }} | ||
| make_latest: true | ||
| files: | | ||
| schedule.md | ||
| chart.md | ||
| schedule.json | ||
|
|
||
| permissions: | ||
| contents: write |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| name: Run the update test suite | ||
| on: | ||
| push: | ||
| branches: main | ||
| branches: | ||
| - "main" | ||
| - "*.*" | ||
| tags: | ||
| - "v*" | ||
| pull_request: | ||
| branches: main | ||
| # On demand | ||
| # Allow manual runs through the web UI | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
|
|
@@ -13,7 +16,6 @@ jobs: | |
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - uses: prefix-dev/[email protected] | ||
| with: | ||
| pixi-version: "v0.49.0" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| # action.yml | ||
| name: "Update SPEC 0 dependencies" | ||
| description: "Update the lower bounds of Python dependencies covered by the Scientific Python SPEC 0 support schedule" | ||
| author: Scientific Python Developers | ||
|
|
||
| inputs: | ||
| target_branch: | ||
| description: "Target branch for the pull request" | ||
|
|
@@ -34,63 +36,51 @@ runs: | |
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Git | ||
| shell: bash | ||
| run: | | ||
| git config user.name "Scientific Python [bot]" | ||
| git config user.email "[email protected]" | ||
|
|
||
| - uses: prefix-dev/[email protected] | ||
| name: Setup Pixi | ||
| with: | ||
| pixi-version: v0.49.0 | ||
| manifest-path: ${{ github.action_path }}/pyproject.toml | ||
|
|
||
| - name: Regenerate schedule file if necessary | ||
| shell: bash | ||
| env: | ||
| SCHEDULE_FILE: ${{ inputs.schedule_path }} | ||
| GH_TOKEN: ${{ inputs.token }} | ||
| run: | | ||
| set -e | ||
| if [ ! -f "${{ github.workspace }}/$SCHEDULE_FILE" ]; then | ||
| echo "Regenerating schedule.json..." | ||
| pixi run generate-schedule --locked | ||
| if diff -q schedule.json "${{ github.workspace }}/$SCHEDULE_FILE" >/dev/null; then | ||
| echo "Source and destination have identical contents – nothing to move." | ||
| else | ||
| mv schedule.json "${{ github.workspace }}/$SCHEDULE_FILE" | ||
| fi | ||
| else | ||
| echo "Schedule file already exists at $SCHEDULE_FILE" | ||
| fi | ||
|
|
||
| - name: Fetch Schedule from release | ||
| uses: robinraju/[email protected] | ||
| with: | ||
| repository: "savente93/SPEC0-schedule" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should not rely on a third party location for any SPEC0 related content
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree but I need to get the release working on this repo first. Or even if we want to do it in this repo or a separate repo. |
||
| latest: true | ||
| fileName: "schedule.json" | ||
| - name: Run update script | ||
| shell: bash | ||
| run: | | ||
| set -e | ||
| echo "Updating ${{inputs.project_file_name}} using schedule ${{inputs.schedule_path}}" | ||
| pixi run --manifest-path ${{ github.action_path }}/pyproject.toml update-dependencies "${{ github.workspace }}/${{ inputs.project_file_name }}" "${{ github.workspace }}/${{ inputs.schedule_path }}" | ||
|
|
||
| - name: Show changes (dry-run) | ||
| if: ${{ inputs.create_pr != 'true' }} | ||
| echo "Updating ${{ inputs.project_file_name }} using schedule ${{ inputs.schedule_path }}" | ||
| pixi run --manifest-path ${{ github.action_path }}/pyproject.toml update-dependencies "${{ github.workspace }}/${{ inputs.project_file_name }}" "${{ github.workspace }}/${{ inputs.schedule_path }}" | ||
| - name: Changes | ||
| id: changes | ||
| shell: bash | ||
| run: | | ||
| echo "Dry run: showing changes that would be committed" | ||
| echo "Showing changes that would be committed" | ||
| git --no-pager diff ${{ inputs.project_file_name }} | ||
|
|
||
| if git diff --quiet ${{ inputs.project_file_name }}; then | ||
| echo "changes_detected=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "changes_detected=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Create Pull Request | ||
| if: ${{ inputs.create_pr == 'true' }} | ||
| if: ${{ fromJSON(inputs.create_pr) && fromJSON(steps.changes.outputs.changes_detected) }} | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| token: ${{ inputs.token }} | ||
| commit-message: ${{ inputs.commit_msg }} | ||
| path: ${{ inputs.project_file_name }} | ||
| title: ${{ inputs.pr_title }} | ||
| body: "This PR was created automatically" | ||
| base: ${{ inputs.target_branch }} | ||
| branch: update-spec0-dependencies-${{ github.run_id }} | ||
| add-paths: | | ||
| ${{ inputs.project_file_name }} | ||
|
|
||
| branding: | ||
| icon: "check-square" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,16 @@ | ||
| [project] | ||
| authors = [{ name = "Scientific Python Developers"}] | ||
| name = "tests" | ||
| description = "This is just a dummy package for testing the spec 0 update github action and should not be used" | ||
| requires-python = ">=3.10" | ||
| version = "0.1.0" | ||
| dependencies = ["ipython>=8.7.0,<4", "numpy[foo,bar]>=1.10.0,<2"] | ||
|
|
||
| [build-system] | ||
| build-backend = "hatchling.build" | ||
| requires = ["hatchling"] | ||
|
|
||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64"] | ||
|
|
||
| [tool.pixi.pypi-dependencies] | ||
| tests = { path = ".", editable = true } | ||
| scikit-learn = ">=1.2.0" | ||
| requires = [ | ||
| "setuptools>=62.1", | ||
| "setuptools_scm[toml]>=8.0.0", | ||
| "wheel", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.pixi.tasks] | ||
|
|
||
| [tool.pixi.feature.foo.dependencies] | ||
| xarray = "*" | ||
|
|
||
| [tool.pixi.environments] | ||
| bar = ["foo"] | ||
|
|
||
| [tool.pixi.dependencies] | ||
| numpy = ">=1.10.0,<2" | ||
| [project] | ||
| name = "setuptools_test" | ||
| requires-python = ">=3.11" | ||
| dependencies = [ | ||
| 'numpy>=1.20.0,<2', | ||
| 'pandas>=1.0.0,<3', | ||
| 'xarray>=2021.1.0', | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [project] | ||
| authors = [{ name = "Scientific Python Developers"}] | ||
| name = "tests" | ||
| description = "This is just a dummy package for testing the spec 0 update github action and should not be used" | ||
| requires-python = ">=3.10" | ||
| version = "0.1.0" | ||
| dependencies = ["ipython>=8.7.0,<4", "numpy[foo,bar]>=1.10.0,<2"] | ||
|
|
||
| [build-system] | ||
| build-backend = "hatchling.build" | ||
| requires = ["hatchling"] | ||
|
|
||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64"] | ||
|
|
||
| [tool.pixi.pypi-dependencies] | ||
| tests = { path = ".", editable = true } | ||
| scikit-learn = ">=1.2.0" | ||
|
|
||
| [tool.pixi.tasks] | ||
|
|
||
| [tool.pixi.feature.foo.dependencies] | ||
| xarray = "*" | ||
|
|
||
| [tool.pixi.environments] | ||
| bar = ["foo"] | ||
|
|
||
| [tool.pixi.dependencies] | ||
| numpy = ">=1.10.0,<2" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| [project] | ||
| authors = [{ name = "Scientific Python Developers"}] | ||
| name = "tests" | ||
| description = "This is just a dummy package for testing the spec 0 update github action and should not be used" | ||
| requires-python = ">=3.11" | ||
| version = "0.1.0" | ||
| dependencies = ["ipython>=8.8.0,<4", "numpy[foo,bar]>=1.25.0,<2"] | ||
|
|
||
| [build-system] | ||
| build-backend = "hatchling.build" | ||
| requires = ["hatchling"] | ||
|
|
||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64"] | ||
|
|
||
| [tool.pixi.pypi-dependencies] | ||
| tests = { path = ".", editable = true } | ||
| scikit-learn = ">=1.3.0" | ||
|
|
||
| [tool.pixi.tasks] | ||
|
|
||
| [tool.pixi.feature.foo.dependencies] | ||
| xarray = ">=2023.1.0" | ||
|
|
||
| [tool.pixi.environments] | ||
| bar = ["foo"] | ||
|
|
||
| [tool.pixi.dependencies] | ||
| numpy = ">=1.25.0,<2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely for the third party actions please use the hashes, but maybe to be consistent do it for everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update