Skip to content

Commit 2713a41

Browse files
authored
Merge pull request #2 from magnuslo/rename
Switch from poetry to PDM, update repo name
2 parents b5f7eab + 6c9be45 commit 2713a41

File tree

5 files changed

+457
-183
lines changed

5 files changed

+457
-183
lines changed

.github/workflows/pypi_publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: Build distribution 📦
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install PDM
23+
uses: pdm-project/setup-pdm@v4
24+
with:
25+
python-version: "3.10"
26+
version: "2.22.1"
27+
- name: Build a binary wheel and a source tarball
28+
run: pdm build
29+
- name: Store the distribution packages
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: python-package-distributions
33+
path: dist/
34+
35+
publish-to-pypi:
36+
name: >-
37+
Publish Python 🐍 distribution 📦 to PyPI
38+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
39+
needs:
40+
- build
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/mopyapns
45+
permissions:
46+
id-token: write # IMPORTANT: mandatory for trusted publishing
47+
48+
steps:
49+
- name: Download all the dists
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
- name: Publish distribution 📦 to PyPI
55+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ venv/
4848
# Poetry
4949
poetry.lock
5050
.pdm-python
51+
.DS_Store

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# PyAPNs2
1+
# MoPyAPNs
22

3-
[![PyPI version](https://img.shields.io/pypi/v/apns2.svg)](https://pypi.python.org/pypi/apns2)
4-
[![PyPI version](https://img.shields.io/pypi/pyversions/apns2.svg)](https://pypi.python.org/pypi/apns2)
3+
[![PyPI version](https://img.shields.io/pypi/v/pyapns.svg)](https://pypi.org/project/pyapns/)
4+
[![PyPI version](https://img.shields.io/pypi/pyversions/pyapns.svg)](https://pypi.org/project/pyapns/)
55
[![Build Status](https://drone.pr0ger.dev/api/badges/Pr0Ger/PyAPNs2/status.svg)](https://drone.pr0ger.dev/Pr0Ger/PyAPNs2)
66

77
Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol using httpx
@@ -10,7 +10,7 @@ Python library for interacting with the Apple Push Notification service (APNs) v
1010

1111
Either download the source from GitHub or use pip:
1212

13-
pip install apns2
13+
pip install mopyapns
1414

1515
## Sample usage
1616

@@ -25,6 +25,10 @@ topic = 'com.example.App'
2525
client = APNsClient('key.pem', use_sandbox=False, use_alternative_port=False)
2626
client.send_notification(token_hex, payload, topic)
2727

28+
# To send a notification with a specific interruption level (iOS 15+)
29+
payload = Payload(alert="Hello World!", sound="default", interruption_level='time-sensitive')
30+
client.send_notification(token_hex, payload, topic)
31+
2832
# To send multiple notifications in a batch
2933
Notification = collections.namedtuple('Notification', ['token', 'payload'])
3034
notifications = [Notification(payload=payload, token=token_hex)]
@@ -43,7 +47,7 @@ client.send_notification_batch(notifications=notifications, topic=topic)
4347

4448
## Requirements
4549

46-
- Python 3.9 or later
50+
- Python 3.10 or later
4751
- httpx 0.28.1 or later (with http2 support)
4852
- cryptography 45.0.4 or later
4953
- PyJWT 2.10.1 or later
@@ -54,12 +58,12 @@ client.send_notification_batch(notifications=notifications, topic=topic)
5458

5559
## Contributing
5660

57-
To develop PyAPNs2, check out the code and install dependencies using PDM:
61+
To develop mopyapns, check out the code and install dependencies using PDM:
5862

5963
```shell
6064
# Clone the source code.
61-
git clone https://github.com/Pr0Ger/PyAPNs2.git
62-
cd PyAPNs2
65+
git clone https://github.com/magnuslo/mopyapns.git
66+
cd mopyapns
6367
# Create a virtualenv and install dependencies.
6468
pdm install
6569
```
@@ -78,7 +82,7 @@ pdm run pylint --reports=n apns2 test
7882

7983
## License
8084

81-
PyAPNs2 is distributed under the terms of the MIT license.
85+
mopyapns is distributed under the terms of the MIT license.
8286

8387
See [LICENSE](LICENSE) file for the complete license details.
8488

0 commit comments

Comments
 (0)