Prepare for PyPI! (#103)

This commit is contained in:
JJTech 2024-05-22 05:32:18 -07:00 committed by GitHub
parent ce88a8ea5c
commit c22904a39d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 95 additions and 32 deletions

38
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Lints
on:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/lint.yml'
- 'pypush/**'
- 'tests/**'
- 'pyproject.toml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.9, "3.10", "3.11", "3.12" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: chartboost/ruff-action@v1
- name: Test install
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[test,cli]' -U
- name: Tests
run: pytest

View File

@ -1,18 +0,0 @@
name: Pyright
on: [push, pull_request]
jobs:
pyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
cache: 'pip'
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -e '.[test,cli]'
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2

View File

@ -1,8 +0,0 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1

26
.github/workflows/upload.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Upload
on:
release:
types: [ created ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U build setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*

View File

@ -1,16 +1,21 @@
> [!WARNING] > [!WARNING]
> `pypush` is undergoing a major rewrite. The current version is not stable and may not work as expected. > `pypush` is undergoing a major rewrite. The current version is not stable and may not work as expected. Many features have been temporarily removed.
>
> Versioning starts at 2.0.0 due to conflicts with the original package to have the `pypush` name. Do not expect stability until 3.0.0.
# pypush # pypush
`pypush` is a POC demo of my recent iMessage reverse-engineering. `pypush` was originally a POC demo of my recent iMessage reverse-engineering.
It can currently register as a new device on an Apple ID, set up encryption keys, and ***send and receive iMessages***! It is now being developed into a community library aiming to cover all of Apple's internal API surface.
`pypush` is completely platform-independent, and does not require a Mac or other Apple device to use! Currently, the rewritten version supports using the client side of Apple's internal APNs API, meaning it can activate as an
Apple device and receive push notifications. Stay tuned for future updates as we bring back the iMessage API and more!
`pypush` is completely platform-independent, though it may require device identifiers to use some APIs.
## Installation ## Installation
Simple installation: Simple installation:
```bash ```bash
pip install git+https://github.com/JJTech0130/pypush pip install pypush[cli]
``` ```
Editable installation (for development): Editable installation (for development):
```bash ```bash

View File

@ -5,15 +5,35 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "pypush" name = "pypush"
dynamic = ["version"] dynamic = ["version"]
authors = [
{ name = "JJTech", email = "jjtech@jjtech.dev" },
]
description = "Interact with Apple Private API"
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"License :: Other/Proprietary License",
]
license = {text = "Server Side Public License (SSPL)"}
keywords = ["apple", "api", "reverse engineering", "imessage", "apns"]
dependencies = [ dependencies = [
"anyio", "anyio",
"httpx", "httpx[http2]",
"cryptography", "cryptography",
"typing-extensions", "typing-extensions",
"exceptiongroup", "exceptiongroup",
'importlib_metadata; python_version>="3.9"', 'importlib_metadata; python_version>="3.9"',
] ]
[project.urls]
Homepage = "https://github.com/JJTech0130/pypush"
Issues = "https://github.com/JJTech0130/pypush/issues"
[project.scripts] [project.scripts]
pypush = "pypush.cli:main" pypush = "pypush.cli:main"