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

chore(deps-dev): bump black, bump flake8, remove unused dev-dependencies #742

Merged
merged 16 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration for xrpl-py."""

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
Expand Down
122 changes: 53 additions & 69 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include = ["LICENSE"]
packages = [{ include = "xrpl" }]

[tool.poetry.dependencies]
python = "^3.8"
python = ">=3.8.1,<3.14"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a max number here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the dependencies darglint has an upper bound on the supported Python version. Here is the error message:

The current project's supported Python range (>=3.8.1) is not compatible with some of the required packages Python requirement:
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the complete error log:

➜  xrpl-py git:(dependabot/pip/black-24.8.0) poetry lock
Updating dependencies
Resolving dependencies... (2.1s)

The current project's supported Python range (>=3.8.1) is not compatible with some of the required packages Python requirement:
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0
  - darglint requires Python >=3.6,<4.0, so it will not be satisfied for Python >=4.0

Because no versions of darglint match >1.5.8,<1.6.0 || >1.6.0,<1.7.0 || >1.7.0,<1.8.0 || >1.8.0,<1.8.1 || >1.8.1,<2.0.0
 and darglint (1.5.8) requires Python >=3.6,<4.0, darglint is forbidden.
And because darglint (1.6.0) requires Python >=3.6,<4.0, darglint is forbidden.
And because darglint (1.7.0) requires Python >=3.6,<4.0
 and darglint (1.8.0) requires Python >=3.6,<4.0, darglint is forbidden.
So, because darglint (1.8.1) requires Python >=3.6,<4.0
 and xrpl-py depends on darglint (^1.5.8), version solving failed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a PR replacing darglint, so this is probably a moot point: #749

It's a very outdated package.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can include <4.0, but it shouldn't be gating minor releases. Most of them work automatically (see #753), so gating it would actually be worse/require more work, since this would prevent it from working automatically without a version bump.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 43fc875

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't yet looked at the darglint PR. We could revisit the gating upper bound later.

base58 = "^2.1.0"
ECPy = "^1.2.5"
typing-extensions = "^4.2.0"
Expand All @@ -34,14 +34,13 @@ types-Deprecated = "^1.2.9"
pycryptodome = "^3.16.0"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
black = "23.3.0"
flake8 = "^7.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title should be updated with this as well

black = "24.8.0"
flake8-black = "^0.3.6"
flake8-docstrings = "^1.7.0"
mypy = "^1"
isort = "^5.11.5"
flake8-isort = "^6.0.0"
flake8-annotations = "2.7.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the rationale for the removal in the description of the PR.
flake8-annotations depends on an older version of flake8. The solution is to upgrade flake8-annotations to a higher version.

But I couldn't find any usages of this dependency. Where is it used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't used directly, it's used by flake8 to check function annotations: https://github.com/sco1/flake8-annotations?tab=readme-ov-file#table-of-warnings

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. updated in 563897f

flake8-absolute-import = "^1.0"
darglint = "^1.5.8"
sphinx-rtd-theme = "^3.0.0"
Expand Down
1 change: 1 addition & 0 deletions snippets/get_transaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of how we can see a transaction that was validated on the ledger"""

from xrpl.clients import JsonRpcClient
from xrpl.models import Ledger, Tx

Expand Down
1 change: 1 addition & 0 deletions snippets/partial_payment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of how to handle partial payments"""

from xrpl.clients import JsonRpcClient
from xrpl.models import (
AccountLines,
Expand Down
1 change: 1 addition & 0 deletions snippets/set_regular_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of how we can setting a regular key"""

from xrpl.account import get_balance
from xrpl.clients import JsonRpcClient
from xrpl.models import Payment, SetRegularKey
Expand Down
1 change: 1 addition & 0 deletions snippets/submit_payment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of how to send a transaction and see its validation response"""

from xrpl.account import get_balance
from xrpl.clients import JsonRpcClient
from xrpl.models import Payment, Tx
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/core/binarycodec/types/test_serialized_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TestSerializedType(TestCase):
def fixture_test(self, fixture: ValueTest):
"""Run the appropriate test for given fixture case."""
serialized_type: SerializedType = TYPE_MAP[fixture.type]
if type(fixture.test_json) == dict:
if isinstance(fixture.test_json, dict):
json_value = fixture.test_json
else:
json_value = str(fixture.test_json)
Expand Down
1 change: 1 addition & 0 deletions xrpl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level XRPL exports."""

from xrpl import account, clients, core, ledger, models, transaction, utils, wallet
from xrpl.constants import CryptoAlgorithm, XRPLException

Expand Down
1 change: 1 addition & 0 deletions xrpl/account/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Methods for interacting with XRPL accounts."""

from xrpl.account.main import (
does_account_exist,
get_account_root,
Expand Down
1 change: 1 addition & 0 deletions xrpl/account/transaction_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level methods to obtain information about account transaction history."""

import asyncio

from xrpl.asyncio.account import transaction_history
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level XRPL exports for async support."""

from xrpl.asyncio import account, clients, ledger, transaction, wallet

__all__ = ["account", "clients", "ledger", "transaction", "wallet"]
1 change: 1 addition & 0 deletions xrpl/asyncio/account/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Async methods for interacting with XRPL accounts."""

from xrpl.asyncio.account.main import (
does_account_exist,
get_account_root,
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/account/transaction_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level methods to obtain information about account transaction history."""

from xrpl.asyncio.clients import Client, XRPLRequestFailureException
from xrpl.core.addresscodec import is_valid_xaddress, xaddress_to_classic_address
from xrpl.models.requests import AccountTx
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/clients/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Asynchronous network clients for interacting with the XRPL."""

from xrpl.asyncio.clients.async_json_rpc_client import AsyncJsonRpcClient
from xrpl.asyncio.clients.async_websocket_client import AsyncWebsocketClient
from xrpl.asyncio.clients.client import Client
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/clients/async_json_rpc_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""An async client for interacting with the rippled JSON RPC."""

from xrpl.asyncio.clients.async_client import AsyncClient
from xrpl.asyncio.clients.json_rpc_base import JsonRpcBase

Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/ledger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Async methods for obtaining information about the status of the XRP Ledger."""

from xrpl.asyncio.ledger.main import (
get_fee,
get_latest_open_ledger_sequence,
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/wallet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Async methods for working with XRPL wallets."""

from xrpl.asyncio.wallet.wallet_generation import (
XRPLFaucetException,
generate_faucet_wallet,
Expand Down
1 change: 1 addition & 0 deletions xrpl/asyncio/wallet/wallet_generation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handles wallet generation from a faucet."""

import asyncio
from typing import Optional
from urllib.parse import urlparse, urlunparse
Expand Down
1 change: 1 addition & 0 deletions xrpl/clients/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Synchronous network clients for interacting with the XRPL."""

from xrpl.asyncio.clients.client import Client
from xrpl.asyncio.clients.exceptions import XRPLRequestFailureException
from xrpl.asyncio.clients.utils import (
Expand Down
1 change: 1 addition & 0 deletions xrpl/clients/json_rpc_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A sync client for interacting with the rippled JSON RPC."""

from xrpl.asyncio.clients.json_rpc_base import JsonRpcBase
from xrpl.clients.sync_client import SyncClient

Expand Down
1 change: 1 addition & 0 deletions xrpl/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of public constants for XRPL."""

import re
from decimal import Context
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions xrpl/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core codec functions for interacting with the XRPL."""

from xrpl.core import addresscodec, binarycodec, keypairs

__all__ = ["addresscodec", "binarycodec", "keypairs"]
1 change: 1 addition & 0 deletions xrpl/core/addresscodec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for encoding and decoding XRP Ledger addresses and seeds."""

from xrpl.core.addresscodec.codec import (
SEED_LENGTH,
decode_account_public_key,
Expand Down
4 changes: 2 additions & 2 deletions xrpl/core/addresscodec/codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def _encode(bytestring: bytes, prefix: List[int], expected_length: int) -> str:
length.
"""
if expected_length and len(bytestring) != expected_length:
error_message = """unexpected_payload_length: len(bytestring) does not match expected_length.
Ensure that the bytes are a bytestring."""
error_message = """unexpected_payload_length: len(bytestring) does not match
expected_length. Ensure that the bytes are a bytestring."""
raise XRPLAddressCodecException(error_message)
encoded_prefix = bytes(prefix)
payload = encoded_prefix + bytestring
Expand Down
1 change: 1 addition & 0 deletions xrpl/core/addresscodec/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""General XRPL Address Codec Exceptions."""

from xrpl.constants import XRPLException


Expand Down
7 changes: 4 additions & 3 deletions xrpl/core/addresscodec/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""This module contains commonly-used constants."""

from typing_extensions import Final

# The dictionary used for XRPL base58 encodings
XRPL_ALPHABET: Final[
bytes
] = b"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"
XRPL_ALPHABET: Final[bytes] = (
b"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"
)
1 change: 1 addition & 0 deletions xrpl/core/binarycodec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Functions for encoding objects into the XRP Ledger's canonical
binary format and decoding them.
"""

from xrpl.core.binarycodec.exceptions import XRPLBinaryCodecException
from xrpl.core.binarycodec.main import (
decode,
Expand Down
Loading