Skip to content

Commit

Permalink
Merge pull request #2 from matan1008/refactor/package
Browse files Browse the repository at this point in the history
Refactor/package
  • Loading branch information
doronz88 committed Jul 12, 2023
2 parents 7749785 + 216d7a8 commit f4ece73
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 64 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ jobs:
python-version: [3.8, 3.9, "3.10", 3.11]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install flake8 isort
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --max-complexity=10 --max-line-length=127
- name: Verify sorted imports
run: |
isort . -m HANGING_INDENT -l 120 --check-only
- name: Test installation
run: |
python3 -m pip install .
- name: Test usage
run: |
python3 -m pyipsw
8 changes: 4 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
2 changes: 1 addition & 1 deletion pyipsw/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import click
from humanfriendly.tables import format_smart_table

from pyipsw.pyipsw import get_devices, DEVICES_FIELDS, get_itunes, ITUNES_FIELDS, download_devices
from pyipsw.pyipsw import DEVICES_FIELDS, ITUNES_FIELDS, download_devices, get_devices, get_itunes

DEFAULT_DEVICES_COLUMNS = ['device', 'version', 'buildid', 'filename']
DEFAULT_ITUNES_COLUMNS = ['os', 'version', 'releasedate', 'url']
Expand Down
4 changes: 2 additions & 2 deletions pyipsw/pyipsw.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from functools import lru_cache
import hashlib
import os
from functools import lru_cache

from tqdm import tqdm
import requests
from tqdm import tqdm

IPSW_API_FIRMWARES_JSON = 'https://api.ipsw.me/v2.1/firmwares.json/condensed'
DEVICES_FIELDS = ['device', 'name', 'version', 'buildid', 'url', 'uploaddate', 'size', 'signed', 'sha1sum',
Expand Down
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[project]
name = "pyipsw"
version = "2.0.3"
description = "utility created in order to access ipsw.me data easily using python/cli"
readme = "README.md"
requires-python = ">=3.8"
license = { file = "LICENSE" }
keywords = ["ios", "ipsw", "firmware", "cli"]
authors = [
{ name = "matan1008", email = "matan1008@gmail.com" }
]
maintainers = [
{ name = "matan1008", email = "matan1008@gmail.com" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]
dynamic = ["dependencies"]

[project.optional-dependencies]
test = ["pytest"]

[project.urls]
"Homepage" = "https://github.com/matan1008/pyipsw"
"Bug Reports" = "https://github.com/matan1008/pyipsw/issues"

[project.scripts]
pyipsw = "pyipsw.__main__:cli"

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*"]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }

[build-system]
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

0 comments on commit f4ece73

Please sign in to comment.