generated from br3ndonland/template-python
-
Notifications
You must be signed in to change notification settings - Fork 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
Support multiple Python versions #19
Merged
Merged
Conversation
This file contains 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
- Output Python version from Python job to Docker job in GitHub Actions - Use Python version build argument when building Docker images - Build Docker images in each workflow run to test Docker builds, but only push images to registry if run is triggered by a Git tag or long-running branch (develop, master) - Push Docker images without Python version tag if the latest Python version is being used - Add Python version tag to Docker images - Add Python version tag and Git tag to Docker images when workflow is triggered by pushing a Git tag
Codecov Report
@@ Coverage Diff @@
## develop #19 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 219 219
=========================================
Hits 219 219
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
#19 Commit dc8da18 updated the builds.yml GitHub Actions workflow to build Docker images for multiple Python versions. The initial strategy was to output the Python version used to the Docker job, so that the Docker job depends on the success of the Python job with the same version. This may not be possible. If it is, it's unclear how to set a downstream job to depend on one specific matrix job (for example, 3.8 in the python job, instead of just the python job in general). https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
br3ndonland
added a commit
that referenced
this pull request
Feb 14, 2021
#19 https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions inboard provides a variety of Docker tags. The least specific tags are: - ghcr.io/br3ndonland/inboard - ghcr.io/br3ndonland/inboard:base - ghcr.io/br3ndonland/inboard:fastapi - ghcr.io/br3ndonland/inboard:starlette Images with these tags should only be pushed if they are built with the latest Python version and the Git ref is either a tag, develop, or main. Docker images built with Python 3.8 were still being pushed with these tags, because the syntax evaluated to true if only one of the conditions was true. This commit will add a logical grouping to the if statement to correct the Docker push behavior.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This project started with Python 3.8. Python 3.9 is now available, so the Dockerfile and GitHub Actions workflows have been updated to Python 3.9.
It is helpful to retain support for Python 3.8, as some Python packages and software stacks have not yet been updated for Python 3.9. For example, some macOS developers (like me) are transitioning to Macs with Apple Silicon M1 ARM processors. The easiest and safest way to install Python for the new processor architecture is to use the
xcode-select
command-line tools. The Python version included withxcode-select
is still 3.8.This PR will add support for multiple Python versions, starting with 3.8.
Changes
Related
d9734b4
6f01d75