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

Bugfix: Remove mutable default usage from Keystore model declaration #284

Merged
merged 8 commits into from
Nov 4, 2022
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
40 changes: 38 additions & 2 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
pull_request:

jobs:
test:

test-py-3-7:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
Expand Down Expand Up @@ -40,3 +40,39 @@ jobs:

- name: Test with pytest
run: poetry run pytest

test-py-3-11:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11

- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python
poetry config virtualenvs.in-project true
poetry install --no-interaction

- name: Check code formatting
run: poetry run flake8 .

- name: Check imports sort order
run: poetry run isort --check-only .

- name: Static type checks with mypy
run: poetry run mypy src

- name: Test with pytest
run: poetry run pytest
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.36.2
-------------

**Bugfix**
- Remove mutable default value from `codemagic.models.Keystore` field `certificate_attributes`. [PR #284](https://github.com/codemagic-ci-cd/cli-tools/pull/284)

Version 0.36.1
-------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "codemagic-cli-tools"
version = "0.36.1"
version = "0.36.2"
description = "CLI tools used in Codemagic builds"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion src/codemagic/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'codemagic-cli-tools'
__description__ = 'CLI tools used in Codemagic builds'
__version__ = '0.36.1.dev'
__version__ = '0.36.2.dev'
__url__ = 'https://github.com/codemagic-ci-cd/cli-tools'
__licence__ = 'GNU General Public License v3.0'
4 changes: 3 additions & 1 deletion src/codemagic/cli/action_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ class ActionGroupProperties(NamedTuple):
description: str


class ActionGroup(ActionGroupProperties, enum.Enum):
# mypy yields a false-positive type error on enums with multiple inheritance
# https://github.com/python/mypy/issues/9319
class ActionGroup(ActionGroupProperties, enum.Enum): # type: ignore
...
3 changes: 2 additions & 1 deletion src/codemagic/models/keystore.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pathlib
from dataclasses import dataclass
from dataclasses import field

from .certificate_attributes import CertificateAttributes

Expand All @@ -10,5 +11,5 @@ class Keystore:
key_password: str
store_password: str
store_path: pathlib.Path
certificate_attributes: CertificateAttributes = CertificateAttributes()
certificate_attributes: CertificateAttributes = field(default_factory=CertificateAttributes)
validity: int = 10000 # Validity duration in days