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

ci: Set current version to v0.0.1 #17

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/_reusable-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
previous-changelog-filepath: ${{ inputs.previous-changelog-filepath }}
previous-release-notes-filepath: ${{ inputs.previous-release-notes-filepath }}
- if: ${{ !endsWith(github.repository, '/python-package-ci-cd') }} # Run the public action when this is run outside the python-package-ci-cd repository
uses: tektronix/python-package-ci-cd/actions/[email protected].0
uses: tektronix/python-package-ci-cd/actions/[email protected].1
with:
release-level: ${{ inputs.release-level }}
previous-changelog-filepath: ${{ inputs.previous-changelog-filepath }}
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
previous-changelog-filepath: ${{ inputs.previous-changelog-filepath }}
previous-release-notes-filepath: ${{ inputs.previous-release-notes-filepath }}
- if: ${{ !endsWith(github.repository, '/python-package-ci-cd') }} # Run the public action when this is run outside the python-package-ci-cd repository
uses: tektronix/python-package-ci-cd/actions/[email protected].0
uses: tektronix/python-package-ci-cd/actions/[email protected].1
with:
previous-changelog-filepath: ${{ inputs.previous-changelog-filepath }}
previous-release-notes-filepath: ${{ inputs.previous-release-notes-filepath }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_reusable-package-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
package-name: ${{ inputs.package-name }}
- if: ${{ !endsWith(github.repository, '/python-package-ci-cd') }} # Run the public action when this is run outside the python-package-ci-cd repository
uses: tektronix/python-package-ci-cd/actions/[email protected].0
uses: tektronix/python-package-ci-cd/actions/[email protected].1
id: create-version
with:
package-name: ${{ inputs.package-name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
pre-commit-hook-skip-list: ${{ inputs.pre-commit-hook-skip-list }}
export-dependency-groups: ${{ inputs.export-dependency-groups }}
- if: ${{ !endsWith(github.repository, '/python-package-ci-cd') }} # Run the public action when this is run outside the python-package-ci-cd repository
uses: tektronix/python-package-ci-cd/actions/[email protected].0
uses: tektronix/python-package-ci-cd/actions/[email protected].1
with:
dependency-dict: ${{ inputs.dependency-dict }}
update-pre-commit: ${{ inputs.update-pre-commit }}
Expand Down
2 changes: 1 addition & 1 deletion actions/create_unique_testpypi_version/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./actions/create_unique_testpypi_version
- uses: tektronix/python-package-ci-cd/actions/create_unique_testpypi_version@v0.0.1
id: create-version
with:
package-name: my-package # required
Expand Down
2 changes: 1 addition & 1 deletion actions/find_unreleased_changelog_items/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tektronix/python-package-ci-cd/actions/find_unreleased_changelog_items@main # it is recommended to use the latest release tag instead of `main`
- uses: tektronix/python-package-ci-cd/actions/find_unreleased_changelog_items@v0.0.1
with:
release-level: ${{ inputs.release-level }} # optional
previous-changelog-filepath: .previous_changelog_for_template.md # optional
Expand Down
2 changes: 1 addition & 1 deletion actions/update_development_dependencies/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
ref: ${{ github.head_ref }}
token: ${{ secrets.checkout-token }}
- uses: tektronix/python-package-ci-cd/actions/update_development_dependencies@main # it is recommended to use the latest release tag instead of `main`
- uses: tektronix/python-package-ci-cd/actions/update_development_dependencies@v0.0.1
with:
repo-root: . # optional, defaults to the current working directory
install-dependencies: false # optional, this will almost never need to be set to true
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ wrap-summaries = 0

[tool.poetry]
package-mode = false
version = "0.0.0"
version = "0.0.1"

[tool.poetry.dependencies]
python = "~3.12"
Expand Down
6 changes: 5 additions & 1 deletion scripts/bump_version_in_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def update_github_actions_version(filepath: Path, incoming_version: str) -> None
filepath: The path to the file to update.
incoming_version: The version to update the file to
"""
file_content = filepath.read_text()
try:
file_content = filepath.read_text()
except UnicodeDecodeError:
print(f'Skipping "{filepath}" due to a UnicodeDecodeError.')
return
# Check if there's a match before replacing
if GITHUB_WORKFLOW_AND_ACTION_REGEX.search(file_content):
# Replace the version numbers with the new version
Expand Down
16 changes: 16 additions & 0 deletions tests/test_bump_version_in_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@ def test_update_github_actions_version_multiple_matches(temporary_directory: Pat
"uses: tektronix/python-package-ci-cd/[email protected]\n"
"uses: tektronix/python-package-ci-cd/[email protected]"
)


def test_update_github_actions_version_unicode_error(
temporary_directory: Path, capsys: pytest.CaptureFixture[str]
) -> None:
"""Test handling of UnicodeDecodeError."""
file_path = temporary_directory / "file4.txt"
# Write binary content to the file to trigger a UnicodeDecodeError
file_path.write_bytes(b"\x80\x81\x82")

update_github_actions_version(file_path, "1.2.3")

# Capture the stdout output
captured = capsys.readouterr()

assert captured.out == f'Skipping "{file_path}" due to a UnicodeDecodeError.\n'
2 changes: 1 addition & 1 deletion workflows/check-api-for-breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ on:
jobs:
check-api-for-breaking-changes:
uses:
tektronix/python-package-ci-cd/.github/workflows/_reusable-check-api-for-breaking-changes.yml@main # it is recommended to use the latest release tag instead of `main`
tektronix/python-package-ci-cd/.github/workflows/_reusable-check-api-for-breaking-changes.yml@v0.0.0
with:
package-name: my_package_name # required
```
Expand Down
2 changes: 1 addition & 1 deletion workflows/codeql-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on:
branches: [main]
jobs:
analyze:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-codeql-analysis.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-codeql-analysis.yml@v0.0.1
with:
languages-array: '["python", "javascript"]'
codeql-queries: security-extended,security-and-quality
Expand Down
2 changes: 1 addition & 1 deletion workflows/enforce-community-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ on:
branches: [main]
jobs:
enforce-community-standards:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-enforce-community-standards.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-enforce-community-standards.yml@v0.0.1
```
[workflow-file]: ../.github/workflows/_reusable-enforce-community-standards.yml
2 changes: 1 addition & 1 deletion workflows/package-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
package-build:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-build.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-build.yml@v0.0.1
with:
package-name: my_package # required
python-versions-array: '["3.9", "3.10", "3.11", "3.12"]' # required
Expand Down
2 changes: 1 addition & 1 deletion workflows/package-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ concurrency: # This concurrency is not required, but can be added if extra cont
group: pypi
jobs:
package-release:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-release.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-release.yml@v0.0.1
with:
package-name: my-package # required
repo-name: owner/my-package # required
Expand Down
2 changes: 1 addition & 1 deletion workflows/package-testpypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ concurrency: # This concurrency is not required, but can be added if extra cont
group: pypi
jobs:
package-testpypi:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-testpypi.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-package-testpypi.yml@v0.0.1
with:
package-name: my-package # required
repo-name: owner/my-package # required
Expand Down
2 changes: 1 addition & 1 deletion workflows/publish-api-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ on:
types: [completed]
jobs:
publish-api-comparison:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-publish-api-comparison.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-publish-api-comparison.yml@v0.0.1
permissions:
checks: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion workflows/publish-test-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ on:
types: [completed]
jobs:
publish-test-results:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-publish-test-results.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-publish-test-results.yml@v0.0.1
with:
operating-systems-array: '["ubuntu", "windows", "macos"]' # required
permissions:
Expand Down
2 changes: 1 addition & 1 deletion workflows/sbom-scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ on:
types: [published]
jobs:
sbom-scan:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-sbom-scan.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-sbom-scan.yml@v0.0.1
permissions:
security-events: write
contents: write
Expand Down
2 changes: 1 addition & 1 deletion workflows/test-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test-code:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-test-code.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-test-code.yml@v0.0.1
with:
repo-name: owner/repo # required
operating-systems-array: '["ubuntu", "windows", "macos"]' # optional
Expand Down
2 changes: 1 addition & 1 deletion workflows/test-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test-docs:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-test-docs.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-test-docs.yml@v0.0.1
with:
node-version: 20 # required
python-version: '3.11' # required
Expand Down
2 changes: 1 addition & 1 deletion workflows/update-python-and-pre-commit-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ on:
branches: [main]
jobs:
update-python-and-pre-commit-dependencies:
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml@main # it is recommended to use the latest release tag instead of `main`
uses: tektronix/python-package-ci-cd/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml@v0.0.1
with:
commit-user-name: 'User Name'
commit-user-email: 'user-email'
Expand Down