Skip to content

Commit

Permalink
update python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
machadojoy committed Jan 20, 2025
1 parent eb04a5a commit 3c495f6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
- name: Install build requirements
run: python -m pip install wheel
- name: Build package
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
- name: Install dependencies
run: pip install tox
- name: Validate formatting
Expand All @@ -22,11 +22,11 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.9, 3.10, 3.11, 3.12]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -46,15 +46,15 @@ jobs:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: coverage-data
path: .
- name: Set up Python 3.7
uses: actions/setup-python@v1
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
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.7-alpine
FROM python:3.12-alpine

RUN adduser -S app app

Expand Down
23 changes: 12 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

install_requires = [
"boto3>=1.36.2",
"click==7.0",
"pyaml==16.12.2",
"click==8.1.8",
"pyaml==25.1.0",
"pytz",
]

tests_requires = [
"coverage[toml]==5.0.3",
"flake8==3.7.8",
"isort==5.0.6",
"moto==1.3.14",
"pytest==5.4.3",
"pytest-cov==2.10.0",
"coverage[toml]==7.6.10",
"flake8",
"isort",
"moto",
"pytest==8.3.4",
"pytest-cov==6.0.0",
]

with open("README.rst") as fh:
Expand Down Expand Up @@ -45,8 +45,9 @@
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)
5 changes: 0 additions & 5 deletions src/ecs_deplojo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
from ecs_deplojo.logger import logger
from ecs_deplojo.task_definitions import generate_task_definitions

try:
from botocore.compat import six
except ImportError:
pass


class VarType(click.ParamType):
name = "var"
Expand Down
17 changes: 7 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import boto3
import moto
import pytest
from moto.ec2 import ec2_backend
from moto.ec2 import utils as ec2_utils

from ecs_deplojo.connection import Connection
Expand All @@ -14,21 +13,19 @@
BASE_DIR = os.path.dirname(os.path.abspath(__file__))


@pytest.yield_fixture(scope="function")
@pytest.fixture(scope="function")
def cluster():

with moto.mock_ecs(), moto.mock_ec2():
with moto.mock_aws():
boto3.setup_default_session(region_name="eu-west-1")

ec2 = boto3.resource("ec2", region_name="eu-west-1")
ec2_resource = boto3.resource("ec2", region_name="eu-west-1")
ec2_client = boto3.client("ec2", region_name="eu-west-1")
ecs = boto3.client("ecs", region_name="eu-west-1")

known_amis = list(ec2_backend.describe_images())

test_instance = ec2.create_instances(
ImageId=known_amis[0].id, MinCount=1, MaxCount=1
test_instance = ec2_resource.create_instances(
ImageId="ami-12c6146b", MinCount=1, MaxCount=1
)[0]


instance_id_document = json.dumps(
ec2_utils.generate_instance_identity_document(test_instance)
)
Expand Down
15 changes: 9 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
[tox]
envlist = py36,py37,py38
envlist = py39,py310,py311,py312,py313

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313


[testenv]
commands = coverage run --source ecs_deplojo --parallel -m pytest {posargs}
extras = test

[testenv:coverage-report]
basepython = python3.7
basepython = python3.12
deps = coverage[toml]
skip_install = true
commands =
Expand All @@ -21,7 +24,7 @@ commands =
coverage report

[testenv:format]
basepython = python3.7
basepython = python3.12
deps =
black
isort
Expand Down

0 comments on commit 3c495f6

Please sign in to comment.