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

Add support for python 3.13 and remove 3.9 #347

Merged
merged 1 commit into from
Nov 18, 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
24 changes: 8 additions & 16 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
FROM ubuntu:24.04

ARG USERNAME=ubuntu
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Ensure apt is in non-interactive to avoid prompts
ENV DEBIAN_FRONTEND=noninteractive

# Create the user
RUN apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

# Install dependencies.
Expand All @@ -39,18 +31,18 @@ SHELL ["/bin/bash","--login", "-c"]

# Stuff needed to make pyenv work correctly since the login shell
# above doesnt seem to run bachrc
ENV PYENV_ROOT="/home/ubuntu/.pyenv"
ENV PYENV_ROOT="/home/${USERNAME}/.pyenv"
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH


# Install the required python versions (this takes a bit usually) so we do lots of cacheing
RUN --mount=type=cache,target=/home/ubuntu/.pyenv/cache,uid=1000 \
pyenv install -s 3.8.18 && \
pyenv install -s 3.9.18 && \
pyenv install -s 3.10.13 && \
pyenv install -s 3.11.6 && \
pyenv install -s 3.12.0 && \
pyenv global 3.11.6 && \
RUN --mount=type=cache,target=/home/${USERNAME}/.pyenv/cache,uid=1000 \
pyenv install -s 3.9.20 && \
pyenv install -s 3.10.15 && \
pyenv install -s 3.11.10 && \
pyenv install -s 3.12.7 && \
pyenv install -s 3.13.0 && \
pyenv global 3.12.7 3.13.0 3.11.10 3.10.15 3.9.20 && \
pyenv rehash

# Install poetry to manage our python project
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
architecture: x64

- name: Install dependencies
Expand Down Expand Up @@ -77,10 +77,10 @@ jobs:
- name: Checkout Code
uses: actions/[email protected]

- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
architecture: x64

- name: Setup Poetry
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:
jobs:
single:
runs-on: ubuntu-latest
name: Python 3.11
name: Python 3.12
steps:
- name: Checkout Code
uses: actions/[email protected]

- name: Setup Latest Python
uses: actions/[email protected]
with:
python-version: 3.11
python-version: 3.12
architecture: x64

- name: Setup Poetry
Expand All @@ -30,10 +30,10 @@ jobs:
run: pip install nox nox_poetry coverage[toml]

- name: Run Tests
run: nox -s tests -p 3.11
run: nox -s tests -p 3.12

- name: Combine Coverage reports
run: nox -s coverage -p 3.11
run: nox -s coverage -p 3.12

- name: Convert Coverage
run: coverage xml --fail-under=0
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.12"] # 3.11 is done in the job above
python-version: ["3.9", "3.10", "3.11","3.13"] # 3.12 is done in the job above
name: Python ${{ matrix.python-version }}
steps:
- name: Checkout Code
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
language: python
language_version: python3
types: ["python"]
args: ["-rs", "black", "-p", "3.11"]
args: ["-rs", "black", "-p", "3.12"]
require_serial: true
additional_dependencies: []
- id: lint
Expand All @@ -18,7 +18,7 @@ repos:
language: python
language_version: python3
types: ["python"]
args: ["-rs", "lint", "-p", "3.11"]
args: ["-rs", "lint", "-p", "3.12"]
require_serial: true
additional_dependencies: []
- id: mypy
Expand All @@ -27,7 +27,7 @@ repos:
language: python
language_version: python3
types: ["python"]
args: ["-rs", "mypy", "-p", "3.11"]
args: ["-rs", "mypy", "-p", "3.12"]
require_serial: true
additional_dependencies: []
- id: tests
Expand All @@ -36,6 +36,6 @@ repos:
language: python
language_version: python3
types: ["python"]
args: ["-rs", "tests", "-p", "3.11"]
args: ["-rs", "tests", "-p", "3.12"]
require_serial: true
additional_dependencies: []
5 changes: 0 additions & 5 deletions .python-version

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Contributions are what make the open-source community such an amazing place to l



This project uses poetry to manage dependencies and pre-commit to run formatting, linting and tests. You will need to have both installed to your system as well as python 3.11.
This project uses poetry to manage dependencies and pre-commit to run formatting, linting and tests. You will need to have both installed to your system as well as python 3.12.

1. Fork the Project
2. Setup the environment.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
raise SystemExit(dedent(message)) from None


python_versions = ["3.12", "3.11", "3.10", "3.9", "3.8"]
python_versions = ["3.13", "3.12", "3.11", "3.10", "3.9"]

nox.options.sessions = (
# "pre-commit",
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "GPL-3.0-only"
cf2tf = "cf2tf.app:cli"

[tool.poetry.dependencies]
python = "^3.8.1"
python = ">=3.9,<3.14"
cfn-flip = "^1.3.0"
PyYAML = "^6.0"
click = "^8.1.2"
Expand Down
Loading