Skip to content

Commit

Permalink
Feature/python version upgrades (#2030)
Browse files Browse the repository at this point in the history
* Pushing changes up to see how CI fares

* os_name tweaks

* Adding wheel to fix pipeline error

* Fixes for pipeline issues

* Pipeline fixes

* Pipeline fixes

* Pipeline fixes

* Pipeline fixes

* Pipeline fixes

* Pipeline fixes

* Pipeline testing

* Pipeline testing

* Pipeline testing

* Testing pipeline

* Testing pipeline

* Testing moving pyinstaller out of poetry

* Pipeline testing

* Testing pipeline
  • Loading branch information
jake-skipper authored Dec 4, 2023
1 parent 7f2db9f commit 6ad49bb
Show file tree
Hide file tree
Showing 30 changed files with 269 additions and 330 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Add additional python options
RUN sudo add-apt-repository ppa:deadsnakes/ppa

# Install Python 3.10, 3.8, and 3.9
# Install Python 3.11, 3.10, and 3.9
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends python3.10 python3.10-venv python3.10-dev \
python3.8 python3.8-venv python3.8-dev \
&& apt-get -y install --no-install-recommends python3.11 python3.11-venv python3.11-dev \
python3.10 python3.10-venv python3.10-dev \
python3.9 python3.9-venv python3.9-dev


Expand All @@ -46,4 +46,4 @@ RUN pip3 install --user awscli poetry==1.5.1
RUN echo "complete -C '/home/vscode/.local/bin/aws_completer' aws" >> ~/.bashrc

# Setup OS_NAME var for runway builds from this dev container
RUN echo "export OS_NAME=ubuntu-20.04" >> ~/.bashrc
RUN echo "export OS_NAME=ubuntu-latest" >> ~/.bashrc
4 changes: 2 additions & 2 deletions .github/scripts/cicd/build_pyinstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

set -ev

if [ "$OS_NAME" == "ubuntu-20.04" ]; then
if [ "$OS_NAME" == "ubuntu-latest" ]; then
LOCAL_OS_NAME="linux"
elif [ "$OS_NAME" == "macos-12" ]; then
LOCAL_OS_NAME="osx"
elif [ "$OS_NAME" == "windows-latest" ]; then
LOCAL_OS_NAME="windows"
else
echo 'Environment variable "OS_NAME" must be one of ["ubuntu-20.04", "macos-12", "windows-latest"]'
echo 'Environment variable "OS_NAME" must be one of ["ubuntu-latest", "macos-12", "windows-latest"]'
exit 1
fi

Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ jobs:
name: Lint Python
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
#python-version: [3.8, 3.9]
python-version: [3.9, '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -126,7 +125,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -190,8 +189,7 @@ jobs:
name: Test Python
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
#python-version: [3.8, 3.9]
python-version: [3.9, '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/on-push-pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
name: Pyinstaller "One File" Build
strategy:
matrix:
os: [macos-12, ubuntu-20.04, windows-latest]
python-version: [3.8]
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
Expand Down Expand Up @@ -72,8 +72,8 @@ jobs:
name: Pyinstaller "One Folder" Build
strategy:
matrix:
os: [macos-12, ubuntu-20.04, windows-latest]
python-version: [3.8]
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
Expand Down Expand Up @@ -129,8 +129,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo (complete)
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefolder-ubuntu-20.04
name: pyinstaller-onefolder-ubuntu-22.04
path: artifacts
- name: Download Artifacts (windows)
if: steps.check_distance.outcome == 'success'
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [macos-12, ubuntu-20.04, windows-latest]
python-version: [3.8]
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
Expand Down Expand Up @@ -67,8 +67,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [macos-12, ubuntu-20.04, windows-latest]
python-version: [3.8]
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
Expand Down Expand Up @@ -123,8 +123,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo (complete)
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- name: Download Artifacts (ubuntu)
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefolder-ubuntu-20.04
name: pyinstaller-onefolder-ubuntu-22.04
path: artifacts
- name: Download Artifacts (windows)
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -200,8 +200,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
python-version: 3.9
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
python-version: 3.9
- uses: Gr1N/setup-poetry@v8
- uses: actions/[email protected]
id: cache
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
python-version: 3.9
- name: Download Artifacts (macOS)
uses: actions/download-artifact@v3
with:
Expand All @@ -311,7 +311,7 @@ jobs:
- name: Download Artifacts (ubuntu)
uses: actions/download-artifact@v3
with:
name: pyinstaller-onefile-ubuntu-20.04
name: pyinstaller-onefile-ubuntu-22.04
path: artifacts
- name: Download Artifacts (windows)
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
python-version: 3.9
- uses: Gr1N/setup-poetry@v8
- uses: actions/[email protected]
id: cache
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: '3.9'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Example
path: ./lambda_functions
dockerize_pip: non-linux
use_pipenv: true
runtime: python3.8
runtime: python3.9
include:
- '*.py'
- '*.txt'
Expand Down Expand Up @@ -221,6 +221,6 @@ Example
Code=code,
Handler="my_function.handler",
Role="...",
Runtime="python3.8",
Runtime="python3.9",
)
)
4 changes: 2 additions & 2 deletions docs/source/cfngin/hooks/awslambda.PythonLayer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ Example
args:
bucket_name: ${bucket_name}
compatible_runtimes:
- python3.8
- python3.9
- python3.10
docker:
disabled: true
extend_gitignore:
Expand All @@ -156,7 +156,7 @@ Example
extend_pip_args:
- '--proxy'
- '[user:passwd@]proxy.server:port'
runtime: python3.8
runtime: python3.9
slim: false
source_code: ./src/example-function
- path: runway.cfngin.hooks.awslambda.PythonLayer
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developers/pyinstaller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ These need to be installed globally.
Process
*******

1. Export ``OS_NAME`` environment variable for your system (``ubuntu-20.04``, ``macos-12``, or ``windows-latest``).
1. Export ``OS_NAME`` environment variable for your system (``ubuntu-22.04``, ``macos-12``, or ``windows-latest``).
2. Execute ``make build-pyinstaller-file`` or ``make build-pyinstaller-folder`` from the root of the repo.

The output of these commands can be found in ``./artifacts``
4 changes: 2 additions & 2 deletions docs/source/python_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Perform the following to install/configure Python & package management tools.
- Leave all Optional Features selected, and click Next
- On the Advanced Options page change the following options and click Install:
- Check the ``Install for all users`` and ``Add Python to environment variables`` options.
- Change the install location to ``C:\Python37`` (updating ``Python37`` to the appropriate directory for the installed version, e.g. ``Python38`` for Python 3.8)
- Change the install location to ``C:\Python37`` (updating ``Python37`` to the appropriate directory for the installed version, e.g. ``Python39`` for Python 3.9)
- At the ``Setup was successful`` screen, click ``Disable path length limit`` and then close the setup program.
- Edit the Path environment variable for your user:
- In the Start Menu, start typing ``environment variables`` and select ``Edit environment variables for your account``.
- In the User variables for your username, select ``Path`` and click ``Edit...``
- Append ``%USERPROFILE%\AppData\Roaming\Python\Python37\Scripts`` & ``%USERPROFILE%\.local\bin`` to the current Variable values and click Ok
- Change ``Python37`` to the appropriate directory for the installed version (e.g. ``Python38`` for Python 3.8)
- Change ``Python37`` to the appropriate directory for the installed version (e.g. ``Python39`` for Python 3.9)
- In Windows Server 2016, the value is shown in a single line -- add it with semicolons::

%USERPROFILE%\AppData\Roaming\Python\Python37\Scripts;%USERPROFILE%\.local\bin;
Expand Down
4 changes: 2 additions & 2 deletions docs/source/serverless/advanced_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The two data sources are merged by iterating over their content and combining th
functions:
example:
handler: handler.example
runtime: python3.8
runtime: python3.9
memorySize: 512
.. code-block:: yaml
Expand All @@ -98,7 +98,7 @@ The two data sources are merged by iterating over their content and combining th
functions:
example:
handler: handler.example
runtime: python3.8
runtime: python3.9
memorySize: 1024
resources:
Resources:
Expand Down
Loading

0 comments on commit 6ad49bb

Please sign in to comment.