diff --git a/Makefile b/Makefile index 6d2ea0d..b15e7bc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ pkg: -rm dist/* - python3 setup.py sdist bdist_wheel + python3 -m build pypi-test: python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* diff --git a/iOSbackup/__init__.py b/iOSbackup/__init__.py index 05273a0..effa652 100644 --- a/iOSbackup/__init__.py +++ b/iOSbackup/__init__.py @@ -2,7 +2,7 @@ import os import sys import textwrap -from importlib import import_module +from importlib import import_module, metadata import pprint import tempfile import sqlite3 @@ -23,7 +23,10 @@ from Crypto.Cipher import AES # https://www.dlitz.net/software/pycrypto/ -__version__ = '0.9.925' +try: + __version__ = metadata.version("iOSbackup") +except metadata.PackageNotFoundError: + __version__ = "0.0+unknown" module_logger = logging.getLogger(__name__) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ac6d2cb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[project] +name = "iOSbackup" +version = "0.9.925" +description = "Reads and extracts files from password-encrypted iOS backups" +readme = "README.md" +authors = [{ name = "Avi Alkalay", email = "avibrazil@gmail.com" }] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Environment :: MacOS X", + "Environment :: Win32 (MS Windows)", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Legal Industry", + "Intended Audience :: Telecommunications Industry", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: iOS", + "Programming Language :: Python :: 3", + "Topic :: Database", + "Topic :: Security :: Cryptography", + "Topic :: Software Development :: Embedded Systems", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: System :: Archiving :: Backup", + "Topic :: System :: Recovery Tools", +] +requires-python = ">=3.7" +dependencies = ["NSKeyedUnArchiver", "pycryptodome"] + +[project.urls] +Homepage = "https://github.com/avibrazil/iOSbackup" + +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" diff --git a/setup.py b/setup.py deleted file mode 100644 index d5a033d..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -import setuptools -from iOSbackup import __version__ - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -setuptools.setup( - name="iOSbackup", - version=__version__, - author="Avi Alkalay", - author_email="avibrazil@gmail.com", - description="Reads and extracts files from password-encrypted iOS backups", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/avibrazil/iOSbackup", - install_requires=['NSKeyedUnArchiver','pycryptodome'], - packages=setuptools.find_packages(), - classifiers=[ - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - "Development Status :: 4 - Beta", - "Environment :: MacOS X", - "Environment :: Console", - "Environment :: Win32 (MS Windows)", - "Intended Audience :: Developers", - "Intended Audience :: End Users/Desktop", - "Intended Audience :: Legal Industry", - "Intended Audience :: Telecommunications Industry", - "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", - "Operating System :: MacOS", - "Operating System :: iOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Operating System :: Unix", - "Topic :: Database", - "Topic :: Security :: Cryptography", - "Topic :: Software Development :: Embedded Systems", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: System :: Archiving :: Backup", - "Topic :: System :: Recovery Tools" - ], - python_requires='>=3.7', -)