Skip to content

Drop py37 #441

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

Merged
merged 4 commits into from
Sep 19, 2023
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
15 changes: 7 additions & 8 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install dependencies
run: poetry install --no-root
- name: Run tox
run: poetry run tox -e flake8 -s false
run: poetry run tox run -e flake8 -s false

static-code-analysis:
name: StaticCodingAnalysis (py${{ matrix.python-version}} ${{ matrix.toxenv-factor }})
Expand All @@ -62,7 +62,7 @@ jobs:
toxenv-factor: 'locked'
- # test with the lowest dependencies
os: ubuntu-latest
python-version: '3.7'
python-version: '3.8'
toxenv-factor: 'lowest'
steps:
- name: Checkout
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Install dependencies
run: poetry install --no-root
- name: Run tox
run: poetry run tox -e mypy-${{ matrix.toxenv-factor }} -s false
run: poetry run tox run -e mypy-${{ matrix.toxenv-factor }} -s false

build-and-test:
name: Test (${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.toxenv-factor }})
Expand All @@ -96,13 +96,12 @@ jobs:
- "3.11" # highest supported
- "3.10"
- "3.9"
- "3.8"
- "3.7" # lowest supported
- "3.8" # lowest supported
toxenv-factor: ['locked']
include:
- # test with the lowest dependencies
os: ubuntu-latest
python-version: '3.7'
python-version: '3.8'
toxenv-factor: 'lowest'
steps:
- name: Disabled Git auto EOL CRLF transforms
Expand Down Expand Up @@ -135,7 +134,7 @@ jobs:
- name: Ensure build successful
run: poetry build
- name: Run tox
run: poetry run tox -e py-${{ matrix.toxenv-factor }} -s false
run: poetry run tox run -e py-${{ matrix.toxenv-factor }} -s false
- name: Generate coverage reports
shell: bash
run: |
Expand Down Expand Up @@ -186,7 +185,7 @@ jobs:
# see https://github.com/actions/setup-python
uses: actions/setup-python@v4
with:
python-version: '>=3.7 <=3.11' # supported version range
python-version: '>=3.8 <=3.11' # supported version range
- name: Validate Python Environment
shell: python
run: |
Expand Down
4 changes: 1 addition & 3 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ no_implicit_optional = True
warn_redundant_casts = True
warn_return_any = True
no_implicit_reexport = True

# needed to silence some py37|py38 differences
warn_unused_ignores = False
warn_unused_ignores = True

[mypy-pytest.*]
ignore_missing_imports = True
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Get it all applied via:

```shell
poetry run isort .
poetry run flake8 cyclonedx/ tests/ typings/
poetry run autopep8 -ir cyclonedx/ tests/ typings/
```

## Documentation
Expand All @@ -45,7 +45,7 @@ make html
Run all tests in dedicated environments, via:

```shell
poetry run tox
poetry run tox run
```

## Sign off your commits
Expand Down
60 changes: 30 additions & 30 deletions cyclonedx/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, *, flow: DataFlow, classification: str) -> None:
self.flow = flow
self.classification = classification

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def flow(self) -> DataFlow:
"""
Expand All @@ -153,7 +153,7 @@ def flow(self) -> DataFlow:
def flow(self, flow: DataFlow) -> None:
self._flow = flow

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def classification(self) -> str:
"""
Expand Down Expand Up @@ -207,7 +207,7 @@ def __init__(self, *, content: str, content_type: str = DEFAULT_CONTENT_TYPE,
self.encoding = encoding
self.content = content

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
@serializable.xml_name('content-type')
def content_type(self) -> str:
Expand All @@ -223,7 +223,7 @@ def content_type(self) -> str:
def content_type(self, content_type: str) -> None:
self._content_type = content_type

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def encoding(self) -> Optional[Encoding]:
"""
Expand All @@ -238,7 +238,7 @@ def encoding(self) -> Optional[Encoding]:
def encoding(self, encoding: Optional[Encoding]) -> None:
self._encoding = encoding

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def content(self) -> str:
"""
Expand Down Expand Up @@ -347,7 +347,7 @@ def __init__(self, *, alg: HashAlgorithm, content: str) -> None:
self.alg = alg
self.content = content

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def alg(self) -> HashAlgorithm:
"""
Expand All @@ -362,7 +362,7 @@ def alg(self) -> HashAlgorithm:
def alg(self, alg: HashAlgorithm) -> None:
self._alg = alg

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def content(self) -> str:
"""
Expand Down Expand Up @@ -442,7 +442,7 @@ def __init__(self, uri: str) -> None:
)
self._uri = uri

@property # type: ignore[misc]
@property
@serializable.json_name('.')
@serializable.xml_name('.')
def uri(self) -> str:
Expand Down Expand Up @@ -499,7 +499,7 @@ def __init__(self, *, type: ExternalReferenceType, url: XsUri, comment: Optional
self.type = type
self.hashes = hashes or [] # type: ignore

@property # type: ignore[misc]
@property
@serializable.xml_sequence(1)
def url(self) -> XsUri:
"""
Expand Down Expand Up @@ -528,7 +528,7 @@ def comment(self) -> Optional[str]:
def comment(self, comment: Optional[str]) -> None:
self._comment = comment

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def type(self) -> ExternalReferenceType:
"""
Expand All @@ -546,7 +546,7 @@ def type(self) -> ExternalReferenceType:
def type(self, type: ExternalReferenceType) -> None:
self._type = type

@property # type: ignore[misc]
@property
@serializable.view(SchemaVersion1Dot3)
@serializable.view(SchemaVersion1Dot4)
@serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'hash')
Expand Down Expand Up @@ -775,7 +775,7 @@ def __init__(self, *, name: str, value: str) -> None:
self.name = name
self.value = value

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def name(self) -> str:
"""
Expand All @@ -792,7 +792,7 @@ def name(self) -> str:
def name(self, name: str) -> None:
self._name = name

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def value(self) -> str:
"""
Expand Down Expand Up @@ -842,7 +842,7 @@ def __init__(self, *, content: str, content_type: Optional[str] = None,
self.content_type = content_type or NoteText.DEFAULT_CONTENT_TYPE
self.encoding = encoding

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def content(self) -> str:
"""
Expand All @@ -857,7 +857,7 @@ def content(self) -> str:
def content(self, content: str) -> None:
self._content = content

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
@serializable.xml_name('content-type')
def content_type(self) -> Optional[str]:
Expand All @@ -875,7 +875,7 @@ def content_type(self) -> Optional[str]:
def content_type(self, content_type: str) -> None:
self._content_type = content_type

@property # type: ignore[misc]
@property
@serializable.xml_attribute()
def encoding(self) -> Optional[Encoding]:
"""
Expand Down Expand Up @@ -940,7 +940,7 @@ def text(self) -> NoteText:
def text(self, text: NoteText) -> None:
self._text = text

@property # type: ignore[misc]
@property
@serializable.xml_sequence(1)
def locale(self) -> Optional[str]:
"""
Expand Down Expand Up @@ -1003,7 +1003,7 @@ def __init__(self, *, name: Optional[str] = None, phone: Optional[str] = None, e
self.email = email
self.phone = phone

@property # type: ignore[misc]
@property
@serializable.xml_sequence(1)
def name(self) -> Optional[str]:
"""
Expand All @@ -1018,7 +1018,7 @@ def name(self) -> Optional[str]:
def name(self, name: Optional[str]) -> None:
self._name = name

@property # type: ignore[misc]
@property
@serializable.xml_sequence(2)
def email(self) -> Optional[str]:
"""
Expand All @@ -1033,7 +1033,7 @@ def email(self) -> Optional[str]:
def email(self, email: Optional[str]) -> None:
self._email = email

@property # type: ignore[misc]
@property
@serializable.xml_sequence(3)
def phone(self) -> Optional[str]:
"""
Expand Down Expand Up @@ -1086,7 +1086,7 @@ def __init__(self, *, name: Optional[str] = None, urls: Optional[Iterable[XsUri]
self.urls = urls or [] # type: ignore
self.contacts = contacts or [] # type: ignore

@property # type: ignore[misc]
@property
@serializable.xml_sequence(1)
def name(self) -> Optional[str]:
"""
Expand All @@ -1101,7 +1101,7 @@ def name(self) -> Optional[str]:
def name(self, name: Optional[str]) -> None:
self._name = name

@property # type: ignore[misc]
@property
@serializable.json_name('url')
@serializable.xml_array(serializable.XmlArraySerializationType.FLAT, 'url')
@serializable.xml_sequence(2)
Expand All @@ -1118,7 +1118,7 @@ def urls(self) -> "SortedSet[XsUri]":
def urls(self, urls: Iterable[XsUri]) -> None:
self._urls = SortedSet(urls)

@property # type: ignore[misc]
@property
@serializable.json_name('contact')
@serializable.xml_array(serializable.XmlArraySerializationType.FLAT, 'contact')
@serializable.xml_sequence(3)
Expand Down Expand Up @@ -1172,7 +1172,7 @@ def __init__(self, *, vendor: Optional[str] = None, name: Optional[str] = None,
self.hashes = hashes or [] # type: ignore
self.external_references = external_references or [] # type: ignore

@property # type: ignore[misc]
@property
@serializable.xml_sequence(1)
def vendor(self) -> Optional[str]:
"""
Expand All @@ -1187,7 +1187,7 @@ def vendor(self) -> Optional[str]:
def vendor(self, vendor: Optional[str]) -> None:
self._vendor = vendor

@property # type: ignore[misc]
@property
@serializable.xml_sequence(2)
def name(self) -> Optional[str]:
"""
Expand All @@ -1202,7 +1202,7 @@ def name(self) -> Optional[str]:
def name(self, name: Optional[str]) -> None:
self._name = name

@property # type: ignore[misc]
@property
@serializable.xml_sequence(3)
def version(self) -> Optional[str]:
"""
Expand All @@ -1217,7 +1217,7 @@ def version(self) -> Optional[str]:
def version(self, version: Optional[str]) -> None:
self._version = version

@property # type: ignore[misc]
@property
@serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'hash')
@serializable.xml_sequence(4)
def hashes(self) -> "SortedSet[HashType]":
Expand All @@ -1233,7 +1233,7 @@ def hashes(self) -> "SortedSet[HashType]":
def hashes(self, hashes: Iterable[HashType]) -> None:
self._hashes = SortedSet(hashes)

@property # type: ignore[misc]
@property
@serializable.view(SchemaVersion1Dot4)
@serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'reference')
@serializable.xml_sequence(5)
Expand Down Expand Up @@ -1289,7 +1289,7 @@ def __init__(self, *, timestamp: Optional[datetime] = None, name: Optional[str]
self.name = name
self.email = email

@property # type: ignore[misc]
@property
@serializable.type_mapping(serializable.helpers.XsdDateTime)
def timestamp(self) -> Optional[datetime]:
"""
Expand Down Expand Up @@ -1362,7 +1362,7 @@ class Copyright:
def __init__(self, *, text: str) -> None:
self.text = text

@property # type: ignore[misc]
@property
@serializable.xml_name('.')
def text(self) -> str:
"""
Expand Down
Loading