Skip to content

Commit

Permalink
Merge pull request #48 from Justintime50/py313
Browse files Browse the repository at this point in the history
feat: upgrades Python from 3.12 to 3.13
  • Loading branch information
Justintime50 authored Oct 9, 2024
2 parents 602a087 + 3fbed4e commit de8f639
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: extractions/setup-just@v2
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- run: just install lint
test:
runs-on: ubuntu-latest
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: extractions/setup-just@v2
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- run: just install coverage
brew-audit:
runs-on: ubuntu-latest
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Build Docker image
run: docker build . -t justintime50/homebrew-releaser
coverage:
Expand All @@ -62,7 +62,7 @@ jobs:
- uses: extractions/setup-just@v2
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- run: just install coverage
- uses: coverallsapp/github-action@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next Release

- Upgrades Python from 3.12 to 3.13

## v0.19.0 (2024-07-11)

- Adds new `formula_includes` parameter to allow including items in the built formula
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-alpine
FROM python:3.13-alpine

RUN apk add --no-cache \
# Install git to push new Homebrew formula
Expand Down
57 changes: 27 additions & 30 deletions homebrew_releaser/formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,41 +203,38 @@ def install
target_linux = True if TARGET_LINUX_AMD64 or TARGET_LINUX_ARM64 else False

template_data = {
'template': template,
'data': {
'class_name': class_name,
'description': description,
'owner': owner,
'repo_name': repo_name,
'tar_url': tar_url,
'autogenerated_tar_checksum': autogenerated_tar_checksum,
'license_type': license_type,
'dependencies': dependencies_list,
'install_instructions': install.strip(),
'test_instructions': test.strip() if test else None,
'download_strategy': download_strategy,
'custom_require': custom_require,
'formula_includes': formula_includes.strip() if formula_includes else None,
'version': version,
'darwin_amd64_url': darwin_amd64_url,
'darwin_amd64_checksum': darwin_amd64_checksum,
'darwin_arm64_url': darwin_arm64_url,
'darwin_arm64_checksum': darwin_arm64_checksum,
'linux_amd64_url': linux_amd64_url,
'linux_amd64_checksum': linux_amd64_checksum,
'linux_arm64_url': linux_arm64_url,
'linux_arm64_checksum': linux_arm64_checksum,
'darwin_amd_and_arm': darwin_amd_and_arm,
'linux_amd_and_arm': linux_amd_and_arm,
'darwin': target_darwin,
'linux': target_linux,
},
'class_name': class_name,
'description': description,
'owner': owner,
'repo_name': repo_name,
'tar_url': tar_url,
'autogenerated_tar_checksum': autogenerated_tar_checksum,
'license_type': license_type,
'dependencies': dependencies_list,
'install_instructions': install.strip(),
'test_instructions': test.strip() if test else None,
'download_strategy': download_strategy,
'custom_require': custom_require,
'formula_includes': formula_includes.strip() if formula_includes else None,
'version': version,
'darwin_amd64_url': darwin_amd64_url,
'darwin_amd64_checksum': darwin_amd64_checksum,
'darwin_arm64_url': darwin_arm64_url,
'darwin_arm64_checksum': darwin_arm64_checksum,
'linux_amd64_url': linux_amd64_url,
'linux_amd64_checksum': linux_amd64_checksum,
'linux_arm64_url': linux_arm64_url,
'linux_arm64_checksum': linux_arm64_checksum,
'darwin_amd_and_arm': darwin_amd_and_arm,
'linux_amd_and_arm': linux_amd_and_arm,
'darwin': target_darwin,
'linux': target_linux,
}

# TODO: We replace the multiple newlines here for shortcomings in the chevron template above so that
# `brew audit` passes correctly.
rendered_template = (
chevron.render(**template_data)
chevron.render(template=template, data=template_data)
.replace('\n\n\n def install', '\n\n def install')
.replace('\n\n\n on_macos', '\n\n on_macos')
.replace('\n\n\n on_linux', '\n\n on_linux')
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ flake8:

# Run mypy type checking on the project
mypy:
{{VIRTUAL_BIN}}/mypy {{PROJECT_NAME}}/ {{TEST_DIR}}/
{{VIRTUAL_BIN}}/mypy --install-types --non-interactive {{PROJECT_NAME}}/ {{TEST_DIR}}/

# Test the project
test:
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
'black == 24.*',
'flake8 == 7.*',
'isort == 5.*',
'mypy == 1.10.*',
'mypy == 1.11.*',
'pytest == 8.*',
'pytest-cov == 5.*',
'types-requests',
]

setuptools.setup(
Expand Down Expand Up @@ -66,5 +65,5 @@
'homebrew-releaser=homebrew_releaser.releaser:main',
]
},
python_requires='==3.12.*',
python_requires='==3.13.*',
)

0 comments on commit de8f639

Please sign in to comment.