Skip to content

Commit 9595bb7

Browse files
committed
Upgrade dependencies and update runtime configs
1 parent a4bd84c commit 9595bb7

File tree

8 files changed

+35
-31
lines changed

8 files changed

+35
-31
lines changed

Diff for: .github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ ubuntu-latest, macos-latest, windows-latest ]
16-
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
16+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Fetch complete history for all tags and branches

Diff for: .pre-commit-config.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
3+
rev: v4.1.0
44
hooks:
55
- id: check-case-conflict
66
- id: check-executables-have-shebangs
@@ -12,20 +12,22 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: mixed-line-ending
1414
- repo: https://github.com/psf/black
15-
rev: 20.8b1
15+
rev: 22.1.0
1616
hooks:
1717
- id: black
1818
- repo: https://github.com/timothycrosley/isort
19-
rev: 5.7.0
19+
rev: 5.10.1
2020
hooks:
2121
- id: isort
2222
args: [ --profile, black ]
2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v0.790
24+
rev: v0.931
2525
hooks:
2626
- id: mypy
2727
files: ^binarytree/
28+
additional_dependencies: [ types-all ]
29+
args: [ --strict ]
2830
- repo: https://gitlab.com/pycqa/flake8
29-
rev: 3.8.4
31+
rev: 4.0.1
3032
hooks:
3133
- id: flake8

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![codecov](https://codecov.io/gh/joowani/binarytree/branch/main/graph/badge.svg?token=C2X2OMPL65)](https://codecov.io/gh/joowani/binarytree)
66
[![PyPI version](https://badge.fury.io/py/binarytree.svg)](https://badge.fury.io/py/binarytree)
77
[![GitHub license](https://img.shields.io/github/license/joowani/binarytree?color=brightgreen)](https://github.com/joowani/binarytree/blob/main/LICENSE)
8-
![Python version](https://img.shields.io/badge/python-3.6%2B-blue)
8+
![Python version](https://img.shields.io/badge/python-3.7%2B-blue)
99

1010
Are you studying binary trees for your next exam, assignment or technical interview?
1111

@@ -23,14 +23,14 @@ Binarytree can be used with [Graphviz](https://graphviz.org) and
2323

2424
## Requirements
2525

26-
Python 3.6+
26+
Python 3.7+
2727

2828
## Installation
2929

3030
Install via [pip](https://pip.pypa.io):
3131

3232
```shell
33-
pip install binarytree
33+
pip install binarytree --upgrade
3434
```
3535

3636
For [conda](https://docs.conda.io) users:

Diff for: binarytree/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def svg(self, node_radius: int = 16) -> str:
512512

513513
def scale_x(x: int, y: int) -> float:
514514
diff = tree_height - y
515-
x = 2 ** (diff + 1) * x + 2 ** diff - 1
515+
x = 2 ** (diff + 1) * x + 2**diff - 1
516516
return 1 + node_radius + scale * x / 2
517517

518518
def scale_y(y: int) -> float:
@@ -562,7 +562,7 @@ def add_node(node_x: int, node_y: int, node_value: NodeValue) -> None:
562562
y += 1
563563

564564
return _SVG_XML_TEMPLATE.format(
565-
width=scale * (2 ** tree_height),
565+
width=scale * (2**tree_height),
566566
height=scale * (2 + tree_height),
567567
body="\n".join(xml),
568568
)
@@ -1833,7 +1833,7 @@ def _generate_random_leaf_count(height: int) -> int:
18331833
:return: Random leaf count.
18341834
:rtype: int
18351835
"""
1836-
max_leaf_count = 2 ** height
1836+
max_leaf_count = 2**height
18371837
half_leaf_count = max_leaf_count // 2
18381838

18391839
# A very naive way of mimicking normal distribution
@@ -2016,7 +2016,7 @@ def _get_tree_properties(root: Node) -> NodeProperties:
20162016
size=size,
20172017
is_max_heap=is_complete and is_descending,
20182018
is_min_heap=is_complete and is_ascending,
2019-
is_perfect=leaf_count == 2 ** max_leaf_depth,
2019+
is_perfect=leaf_count == 2**max_leaf_depth,
20202020
is_strict=is_strict,
20212021
is_complete=is_complete,
20222022
leaf_count=leaf_count,
@@ -2486,7 +2486,7 @@ def heap(
24862486

24872487
if not is_perfect:
24882488
# Randomly cut some of the leaf nodes away
2489-
random_cut = random.randint(2 ** height, len(values))
2489+
random_cut = random.randint(2**height, len(values))
24902490
values = values[:random_cut]
24912491

24922492
if is_max:

Diff for: docs/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Binarytree: Python Library for Studying Binary Trees
55
:alt: GitHub License
66
:target: https://github.com/joowani/binarytree/blob/main/LICENSE
77

8-
.. image:: https://img.shields.io/badge/python-3.6%2B-blue
8+
.. image:: https://img.shields.io/badge/python-3.7%2B-blue
99
:alt: Python Versions
1010

1111
Welcome to the documentation for **binarytree**.
@@ -18,7 +18,7 @@ supported.
1818
Requirements
1919
============
2020

21-
Python 3.6+
21+
Python 3.7+
2222

2323
Installation
2424
============
@@ -27,7 +27,7 @@ Install via pip_:
2727

2828
.. code-block:: bash
2929
30-
pip install binarytree
30+
pip install binarytree --upgrade
3131
3232
For conda_ users:
3333

Diff for: pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ testpaths = ["tests"]
1111

1212
[tool.setuptools_scm]
1313
write_to = "binarytree/version.py"
14+
15+
[tool.mypy]
16+
warn_return_any = true
17+
warn_unused_configs = true
18+
ignore_missing_imports = true
19+
strict = true

Diff for: setup.cfg

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,3 @@ max-line-length = 88
33
extend-ignore = E203, E741, W503
44
exclude =.git .idea .*_cache dist htmlcov venv
55
per-file-ignores = __init__.py:F401 conf.py:E402
6-
7-
[mypy]
8-
ignore_missing_imports = True
9-
strict = True

Diff for: setup.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414
keywords=["tree", "heap", "bst", "education"],
1515
packages=find_packages(exclude=["tests"]),
1616
include_package_data=True,
17-
python_requires=">=3.6",
17+
python_requires=">=3.7",
1818
license="MIT",
1919
use_scm_version=True,
2020
setup_requires=["setuptools_scm"],
2121
install_requires=[
2222
"graphviz",
23-
"setuptools>=42",
24-
"setuptools_scm[toml]>=3.4",
23+
"setuptools>=60.8.2",
24+
"setuptools_scm[toml]>=5.0.1",
2525
],
2626
extras_require={
2727
"dev": [
28-
"black",
29-
"flake8>=3.8.4",
30-
"isort>=5.0.0",
31-
"mypy>=0.790",
32-
"pre-commit>=2.9.3",
33-
"pytest>=6.0.0",
34-
"pytest-cov>=2.0.0",
28+
"black>=22.1.0",
29+
"flake8>=4.0.1",
30+
"isort>=5.10.1",
31+
"mypy>=0.931",
32+
"pre-commit>=2.17.0",
33+
"pytest>=6.2.1",
34+
"pytest-cov>=2.10.1",
3535
"sphinx",
3636
"sphinx_rtd_theme",
3737
"types-setuptools",

0 commit comments

Comments
 (0)