-
Notifications
You must be signed in to change notification settings - Fork 137
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
Feat: ARM64 Support for OSX / Linux + Windows 32 bit support #342
Changes from all commits
ccd1718
b7cfa26
d39941e
6f0ecd5
1aaafdd
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,55 @@ | ||
BUILD_TEST_TASK_TEMPLATE: &BUILD_TEST_TASK_TEMPLATE | ||
arch_check_script: | ||
- uname -am | ||
test_script: | ||
- python --version | ||
- python -m pip install --upgrade pip | ||
- python -m pip install -r requirements_dev.txt | ||
- python -m flake8 | ||
- python -m pydocstyle pact | ||
- python -m tox -e test | ||
# - make examples | ||
|
||
linux_arm64_task: | ||
env: | ||
matrix: | ||
# - IMAGE: python:3.6-slim # This works locally, with cirrus run, but fails in CI | ||
- IMAGE: python:3.7-slim | ||
- IMAGE: python:3.8-slim | ||
- IMAGE: python:3.9-slim | ||
- IMAGE: python:3.10-slim | ||
arm_container: | ||
image: $IMAGE | ||
install_script: | ||
- apt update --yes && apt install --yes gcc make | ||
<< : *BUILD_TEST_TASK_TEMPLATE | ||
|
||
|
||
macosx_arm64_task: | ||
macos_instance: | ||
image: ghcr.io/cirruslabs/macos-ventura-base:latest | ||
env: | ||
PATH: ${HOME}/.pyenv/shims:${PATH} | ||
matrix: | ||
- PYTHON: 3.6 | ||
- PYTHON: 3.7 | ||
- PYTHON: 3.8 | ||
- PYTHON: 3.9 | ||
- PYTHON: 3.10 | ||
install_script: | ||
# Per the pyenv homebrew recommendations. | ||
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment | ||
# - xcode-select --install # Unnecessary on Cirrus | ||
- brew update | ||
# - brew install openssl readline sqlite3 xz zlib | ||
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. preinstalled in cirrus's base image |
||
- brew install pyenv | ||
- pyenv install ${PYTHON} | ||
- pyenv global ${PYTHON} | ||
- pyenv rehash | ||
## To install rosetta | ||
# - softwareupdate --install-rosetta --agree-to-license | ||
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. rosetta isn't installed by default, so this is using arm64 binaries, and would fail if using x86_64 binaries without rosetta |
||
<< : *BUILD_TEST_TASK_TEMPLATE | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
os: [ ubuntu-latest ] | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
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. adds additional os's but skips the examples steps, as they require a broker and spin one up with docker-compose. docker isn't available in GH runners for macOS or Windows, hence skipped on line 53 unless Linux |
||
|
||
# These versions are no longer supported by Python team, and may | ||
# eventually be dropped from GitHub Actions. | ||
|
@@ -29,7 +29,7 @@ jobs: | |
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
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. fix deprecation warnings in build |
||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
|
@@ -50,4 +50,5 @@ jobs: | |
run: tox -e test | ||
|
||
- name: Test examples | ||
if: runner.os == 'Linux' | ||
run: make examples |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ jobs: | |
environment: "Upload Python Package" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
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. matches |
||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ARG PYTHON_VERSION=3.6 | ||
FROM python:$PYTHON_VERSION-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update --yes && apt install --yes gcc make | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN python -m pip install --upgrade pip | ||
RUN python -m pip install -r requirements_dev.txt | ||
RUN python -m flake8 | ||
RUN python -m pydocstyle pact | ||
RUN python -m tox -e test | ||
|
||
CMD ["sh","-c","python -m tox -e test"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM ubuntu:22.04 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ARG PYTHON_VERSION 3.9 | ||
|
||
#Set of all dependencies needed for pyenv to work on Ubuntu | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8 git | ||
|
||
# Set-up necessary Env vars for PyEnv | ||
ENV PYENV_ROOT /root/.pyenv | ||
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH | ||
|
||
# Install pyenv | ||
RUN set -ex \ | ||
&& curl https://pyenv.run | bash \ | ||
&& pyenv update \ | ||
&& pyenv install $PYTHON_VERSION \ | ||
&& pyenv global $PYTHON_VERSION \ | ||
&& pyenv rehash | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN python -m pip install --upgrade pip | ||
RUN python -m pip install -r requirements_dev.txt | ||
RUN python -m flake8 | ||
RUN python -m pydocstyle pact | ||
RUN python -m tox -e test | ||
|
||
CMD ["sh","-c","python -m tox -e test"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
for arch in arm64 amd64; do | ||
# for version in 3.6; do | ||
for version in 3.7 3.8 3.9 3.10 3.11; do | ||
docker build -t python-$arch-$version --build-arg PYTHON_VERSION=$version --platform=linux/$arch . | ||
docker run -it --rm python-$arch-$version | ||
done | ||
done |
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.
Failed in CI
https://cirrus-ci.com/task/5786844193882112