-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from ThatXliner/v2
Version 2
- Loading branch information
Showing
25 changed files
with
177 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3 | ||
- name: Install Poetry | ||
|
@@ -20,18 +20,43 @@ jobs: | |
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: dist/* | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
upload: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/aioudp # Replace <package-name> with your PyPI project name | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
python-version: 3 | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Build artifacts | ||
run: poetry build | ||
- name: Upload artifacts to PyPi | ||
run: poetry publish --username __token__ --password $PYPI_TOKEN | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
# AioUDP | ||
|
||
<picture> | ||
<!-- Dark mode image --> | ||
<source srcset="docs/assets/[email protected]" media="(prefers-color-scheme: dark)"> | ||
<!-- Light mode image --> | ||
<source srcset="docs/assets/[email protected]" media="(prefers-color-scheme: light)"> | ||
<!-- Fallback image --> | ||
<img src="docs/assets/[email protected]" alt="AioUDP Banner" style="max-width: 100%; height: auto;"> | ||
</picture> | ||
|
||
> A better API for asynchronous UDP | ||
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) | ||
|
@@ -13,7 +24,6 @@ | |
[![PyPI](https://img.shields.io/pypi/v/aioudp)](https://pypi.org/project/aioudp) | ||
[![PyPI - License](https://img.shields.io/pypi/l/aioudp)](#license) | ||
|
||
> A better API for asynchronous UDP | ||
|
||
A [websockets](https://websockets.readthedocs.io/en/stable/index.html)-like API for [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol) | ||
|
||
|
@@ -31,10 +41,10 @@ async def main(): | |
async for message in connection: | ||
await connection.send(message) | ||
|
||
# Optional. This is for properly exiting the server when Ctrl-C is pressed | ||
# or when the process is killed/terminated | ||
loop = asyncio.get_running_loop() | ||
stop = loop.create_future() | ||
# Optional. This is for properly exiting the server when Ctrl-C is pressed | ||
# or when the process is killed/terminated | ||
loop.add_signal_handler(signal.SIGTERM, stop.set_result, None) | ||
loop.add_signal_handler(signal.SIGINT, stop.set_result, None) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
__all__ = ["connect", "serve", "Connection", "exceptions"] | ||
|
||
|
||
__version__ = "1.0.1" | ||
__version__ = "2.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.