diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9ca619d..6ee9d2b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,7 +10,7 @@ jobs: tests: strategy: matrix: - python-version: [3.8, 3.9, '3.10', 3.11, 3.12] + python-version: [3.9, '3.10', 3.11, 3.12, 3.13, 3.14] os: - ubuntu-latest - macos-13 # (non-M1) @@ -24,17 +24,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install pip and setuptools - run: | - python -m pip install --upgrade pip - pip install setuptools - - name: On MacOS, install coincurve's dependencies and install it from wheels # FIXME: installing from source fails for some reason. - if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' - run: | - brew install autoconf automake libffi libtool pkg-config python - pip install -r requirements.txt + - name: Upgrade pip + run: python -m pip install --upgrade pip - name: Install python-bip32 from source - run: python setup.py install + run: pip install . - name: Test with pytest run: | pip install -r tests/requirements.txt @@ -62,7 +55,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - name: Set up Python 3.12 uses: actions/setup-python@v2 with: python-version: 3.12 @@ -72,4 +65,4 @@ jobs: pip install setuptools pip install -r tests/requirements.txt pip install -I coincurve==${{ matrix.coincurve-version }} - python setup.py install + pip install . diff --git a/README.md b/README.md index f7ea9b4..e8bbd40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # python-bip32 -A basic implementation of [BIP-0032](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). +A minimalistic implementation of [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). ## Usage diff --git a/bip32/__init__.py b/bip32/__init__.py index 29f40eb..7a60652 100644 --- a/bip32/__init__.py +++ b/bip32/__init__.py @@ -1,8 +1,6 @@ from .bip32 import BIP32, PrivateDerivationError, InvalidInputError from .utils import BIP32DerivationError, HARDENED_INDEX -__version__ = "4.0" - __all__ = [ "BIP32", "BIP32DerivationError", diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a899f69 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["setuptools>=77.0.3"] # Because of the license keys. See https://setuptools.pypa.io/en/stable/history.html#v77-0-3 +build-backend = "setuptools.build_meta" + +[project] +name = "bip32" +version = "4.0.0" +dependencies = [ + "coincurve>=15.0,<21", +] +requires-python = ">=3.8" +authors = [ + {name = "Antoine Poinsot", email = "darosior@protonmail.com"}, +] +maintainers = [ + {name = "Antoine Poinsot", email = "darosior@protonmail.com"}, +] +description = "Minimalistic implementation of BIP32 (Bitcoin HD wallets)" +readme = "README.md" +license = "BSD-3-Clause" +license-files = ["LICENCE"] +keywords = ["bitcoin", "key derivation", "HD wallet"] +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + "Topic :: Security :: Cryptography", +] + +[project.urls] +Homepage = "https://github.com/darosior/python-bip32" +Repository = "https://github.com/darosior/python-bip32" +Issues = "https://github.com/darosior/python-bip32/issues" +"Bug Tracker" = "https://github.com/darosior/python-bip32/issues" +Changelog = "https://github.com/darosior/python-bip32/tree/master/CHANGELOG.md" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 2eba943..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -coincurve>=15.0,<21 diff --git a/setup.py b/setup.py deleted file mode 100644 index 21fc04a..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -import io -import os - -from setuptools import setup - - -# Taken from https://github.com/pypa/pip/blob/003c7ac56b4da80235d4a147fbcef84b6fbc8248/setup.py#L7-L21 -def read(rel_path: str) -> str: - here = os.path.abspath(os.path.dirname(__file__)) - # intentionally *not* adding an encoding option to open, See: - # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 - with open(os.path.join(here, rel_path)) as fp: - return fp.read() - - -# Taken from https://github.com/pypa/pip/blob/003c7ac56b4da80235d4a147fbcef84b6fbc8248/setup.py#L7-L21 -def get_version(rel_path: str) -> str: - for line in read(rel_path).splitlines(): - if line.startswith("__version__"): - # __version__ = "0.9" - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - raise RuntimeError("Unable to find version string.") - - -with io.open("README.md", encoding="utf-8") as f: - long_description = f.read() - -with io.open("requirements.txt", encoding="utf-8") as f: - requirements = [r for r in f.read().split('\n') if len(r)] - -setup(name="bip32", - # We use the first approach from https://packaging.python.org/en/latest/guides/single-sourcing-package-version - version=get_version("bip32/__init__.py"), - description="Minimalistic implementation of the BIP32 key derivation scheme", - long_description=long_description, - long_description_content_type="text/markdown", - url="http://github.com/darosior/python-bip32", - author="Antoine Poinsot", - author_email="darosior@protonmail.com", - license="MIT", - packages=["bip32"], - keywords=["bitcoin", "bip32", "hdwallet"], - install_requires=requirements)