Skip to content

Commit

Permalink
Merge branch 'main' into mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Oct 18, 2024
2 parents d255ceb + 062c2ff commit 41f61ce
Show file tree
Hide file tree
Showing 12 changed files with 676 additions and 660 deletions.
36 changes: 0 additions & 36 deletions .codeclimate.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.github/dependabot.yml @ItsDrike
.github/workflows/** @ItsDrike
.github/scripts/** @ItsDrike
.codeclimate.yml

# Meta (config files for the repo itself)
.github/CODEOWNERS @ItsDrike
Expand Down
11 changes: 0 additions & 11 deletions .github/scripts/normalize_coverage.py

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,6 @@ jobs:
run: |
poetry run task test
python .github/scripts/normalize_coverage.py
mv .coverage .coverage.${{ matrix.platform }}.${{ matrix.python-version }}
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage.${{ matrix.platform }}.${{ matrix.python-version }}
path: .coverage.${{ matrix.platform }}.${{ matrix.python-version }}
retention-days: 1
if-no-files-found: error

upload-coverage:
needs: [unit-tests]
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup poetry
id: poetry_setup
uses: ItsDrike/setup-poetry@v1
with:
python-version: 3.12
install-args: "--no-root --only test"

- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage.*
merge-multiple: true # support downloading multiple artifacts to same dir

# Combine all of the coverage files (for each os, python version - from matrix)
# into a single coverage file (.coverage), and produce a final (combined) coverage report.
- name: Combine coverage
run: |
coverage combine
coverage xml
coverage report
- name: Upload coverage to codeclimate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: .coverage.xml:coverage.py

tests-done:
needs: [unit-tests]
if: always() && !cancelled()
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![discord chat](https://img.shields.io/discord/936788458939224094.svg?logo=Discord)](https://discord.gg/C2wX7zduxC)
![supported python versions](https://img.shields.io/pypi/pyversions/mcproto.svg)
[![current PyPI version](https://img.shields.io/pypi/v/mcproto.svg)](https://pypi.org/project/mcproto/)
[![Test Coverage](https://api.codeclimate.com/v1/badges/9464f1037f07a795de35/test_coverage)](https://codeclimate.com/github/py-mine/mcproto/test_coverage)
[![Validation](https://github.com/ItsDrike/mcproto/actions/workflows/validation.yml/badge.svg)](https://github.com/ItsDrike/mcproto/actions/workflows/validation.yml)
[![Unit tests](https://github.com/ItsDrike/mcproto/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ItsDrike/mcproto/actions/workflows/unit-tests.yml)
[![Docs](https://img.shields.io/readthedocs/mcproto?label=Docs)](https://mcproto.readthedocs.io/)
Expand Down
1 change: 1 addition & 0 deletions changes/379.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove codeclimate
8 changes: 4 additions & 4 deletions mcproto/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def __init__(self, socket: T_SOCK):
def make_client(cls, address: tuple[str, int], timeout: float) -> Self:
sock = socket.create_connection(address, timeout=timeout)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
return cls(sock)
return cls(sock) # pyright: ignore reportArgumentType # pyright doesn't understand the generic

@override
def _read(self, length: int) -> bytearray:
Expand Down Expand Up @@ -325,7 +325,7 @@ def __init__(self, reader: T_STREAMREADER, writer: T_STREAMWRITER, timeout: floa
async def make_client(cls, address: tuple[str, int], timeout: float) -> Self:
conn = asyncio.open_connection(address[0], address[1])
reader, writer = await asyncio.wait_for(conn, timeout=timeout)
return cls(reader, writer, timeout)
return cls(reader, writer, timeout) # pyright: ignore reportArgumentType # pyright doesn't understand the generic

@override
async def _read(self, length: int) -> bytearray:
Expand Down Expand Up @@ -377,7 +377,7 @@ def __init__(self, socket: T_SOCK, address: tuple[str, int]):
def make_client(cls, address: tuple[str, int], timeout: float) -> Self:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(timeout)
return cls(sock, address)
return cls(sock, address) # pyright: ignore reportArgumentType # pyright doesn't understand the generic

@override
def _read(self, length: int | None = None) -> bytearray:
Expand Down Expand Up @@ -411,7 +411,7 @@ def __init__(self, stream: T_DATAGRAM_CLIENT, timeout: float):
async def make_client(cls, address: tuple[str, int], timeout: float) -> Self:
conn = asyncio_dgram.connect(address)
stream = await asyncio.wait_for(conn, timeout=timeout)
return cls(stream, timeout)
return cls(stream, timeout) # pyright: ignore reportArgumentType # pyright doesn't understand the generic

@override
async def _read(self, length: int | None = None) -> bytearray:
Expand Down
6 changes: 3 additions & 3 deletions mcproto/types/nbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class _NumberNBTag(NBTag, RequiredParamsABCMixin):

_REQUIRED_CLASS_VARS = ("STRUCT_FORMAT", "DATA_SIZE")

STRUCT_FORMAT: ClassVar[INT_FORMATS_TYPE] = NotImplemented # type: ignore
STRUCT_FORMAT: ClassVar[INT_FORMATS_TYPE] = NotImplemented
DATA_SIZE: ClassVar[int] = NotImplemented

payload: int
Expand Down Expand Up @@ -595,7 +595,7 @@ class _FloatingNBTag(NBTag, RequiredParamsABCMixin):

_REQUIRED_CLASS_VARS = ("STRUCT_FORMAT", "DATA_SIZE")

STRUCT_FORMAT: ClassVar[FLOAT_FORMATS_TYPE] = NotImplemented # type: ignore
STRUCT_FORMAT: ClassVar[FLOAT_FORMATS_TYPE] = NotImplemented
DATA_SIZE: ClassVar[int] = NotImplemented

payload: float
Expand Down Expand Up @@ -1016,7 +1016,7 @@ class _NumberArrayNBTag(NBTag, RequiredParamsABCMixin):

_REQUIRED_CLASS_VARS = ("STRUCT_FORMAT", "DATA_SIZE")

STRUCT_FORMAT: ClassVar[INT_FORMATS_TYPE] = NotImplemented # type: ignore
STRUCT_FORMAT: ClassVar[INT_FORMATS_TYPE] = NotImplemented
DATA_SIZE: ClassVar[int] = NotImplemented

payload: list[int]
Expand Down
Loading

0 comments on commit 41f61ce

Please sign in to comment.