Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post release #115

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"]
python: ["3.8", "3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repos:
rev: v3.9.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
# exclude: *fixtures
language: python
types: [python]
Expand Down
7 changes: 5 additions & 2 deletions .sourcery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 📚 For a complete reference to this file, see the documentation at
# https://docs.sourcery.ai/Configuration/Project-Settings/

# This file was auto-generated by Sourcery on 2023-01-01 at 13:20.
# This file was auto-generated by Sourcery on 2023-07-08 at 01:13.

version: "1" # The schema version of this config file

Expand All @@ -18,6 +18,8 @@ ignore: # A list of paths or files which Sourcery will ignore.
- env
- .env
- .tox
- node_modules
- vendor

rule_settings:
enable:
Expand All @@ -27,12 +29,13 @@ rule_settings:
- refactoring
- suggestion
- comment
python_version: "3.7" # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.
python_version: "3.8" # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.

# rules: # A list of custom rules Sourcery will include in its analysis.
# - id: no-print-statements
# description: Do not use print statements in the test directory.
# pattern: print(...)
# language: python
# replacement:
# condition:
# explanation:
Expand Down
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Notable changes to the codebase are documented here.
Release names follow *[calendar versioning](https://calver.org/)*:
full year, short month, short day (YYYY-M-D)

## v2023.8 (work in progress, not released yet)

Major changes includes:

- dropped python 3.7 support

## v2023.7.12

This is the last release supporting py37.
Expand Down
2 changes: 1 addition & 1 deletion btclib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""__init__ module for the btclib package."""

name = "btclib"
__version__ = "2023.7.12"
__version__ = "2023.8"
__author__ = "The btclib developers"
__author_email__ = "[email protected]"
__copyright__ = "Copyright (C) 2017-2023 The btclib developers"
Expand Down
5 changes: 1 addition & 4 deletions btclib/b58.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ def h160_from_address(b58addr: String) -> tuple[str, bytes, str]:
prefix = payload[:1]

for script_type in ("p2pkh", "p2sh"):
# with python>=3.8 use walrus operator
# if network := network_from_key_value(script_type, prefix):
network = network_from_key_value(script_type, prefix)
if network:
if network := network_from_key_value(script_type, prefix):
return script_type, payload[1:], network

err_msg = f"invalid base58 address prefix: 0x{prefix.hex()}"
Expand Down
5 changes: 1 addition & 4 deletions btclib/bip32/slip132.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def address_from_xpub(xpub: BIP32Key) -> str:
b58.p2wpkh_p2sh,
]
for version, function in zip(version_list, function_list):
# with python>=3.8 use walrus operator
# if network := network_from_key_value(version, xpub.version):
network = network_from_key_value(version, xpub.version)
if network:
if network := network_from_key_value(version, xpub.version):
return function(xpub, network)
err_msg = f"unknown xpub version: {xpub.version.hex()}" # pragma: no cover
raise BTClibValueError(err_msg) # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions btclib/ec/curve_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def multiples(Q: JacPoint, size: int, ec: CurveGroup) -> list[JacPoint]:
MAX_W = 5


@functools.lru_cache() # results are cached to increase efficiency
@functools.lru_cache # results are cached to increase efficiency
def cached_multiples(Q: JacPoint, ec: CurveGroup) -> list[JacPoint]:
T = [INFJ, Q]
for i in range(3, 2**MAX_W, 2):
Expand All @@ -481,7 +481,7 @@ def cached_multiples(Q: JacPoint, ec: CurveGroup) -> list[JacPoint]:
return T


@functools.lru_cache() # results are cached to increase efficiency
@functools.lru_cache # results are cached to increase efficiency
def cached_multiples_fixwind(
Q: JacPoint, ec: CurveGroup, w: int = 4
) -> list[list[JacPoint]]:
Expand Down
5 changes: 1 addition & 4 deletions btclib/psbt/psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ def assert_signable(self) -> None:
for i, tx_in in enumerate(self.tx.vin):
non_witness_utxo = self.inputs[i].non_witness_utxo
redeem_script = self.inputs[i].redeem_script
# with python>=3.8 use walrus operator
# if witness_utxo := self.inputs[i].witness_utxo:
witness_utxo = self.inputs[i].witness_utxo
if witness_utxo:
if witness_utxo := self.inputs[i].witness_utxo:
script_pub_key = witness_utxo.script_pub_key
script_type, payload = type_and_payload(script_pub_key.script)
if script_type == "p2sh":
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
project = "btclib"
project_copyright = "2017-2023 The btclib developers"
author = "The btclib developers"
release = "2023.7.12"
release = "2023.8"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@
"bip32 bip39 electrum base58 bech32 segwit message-signing "
"bip340"
),
python_requires=">=3.7",
python_requires=">=3.8",
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down