Skip to content

Commit 9a29a7f

Browse files
Copilotrichardkiss
andcommitted
Remove Python 2 compatibility code and add mypy configuration
Co-authored-by: richardkiss <5336+richardkiss@users.noreply.github.com>
1 parent b928925 commit 9a29a7f

File tree

17 files changed

+75
-143
lines changed

17 files changed

+75
-143
lines changed

.github/workflows/mypy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Type checking with mypy
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
mypy:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
strategy:
16+
matrix:
17+
python-version: [3.8, "3.10", "3.11"]
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Python environment
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
pip install --upgrade pip
33+
pip install mypy>=1.0
34+
35+
- name: Run mypy
36+
run: |
37+
mypy pycoin

.github/workflows/test-py27.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
max-parallel: 4
1717
matrix:
18-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
18+
python-version: [3.8, 3.9, "3.10", "3.11"]
1919

2020
steps:
2121
- name: Checkout Code

mypy.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[mypy]
2+
python_version = 3.8
3+
warn_return_any = False
4+
warn_unused_configs = True
5+
disallow_untyped_defs = False
6+
ignore_missing_imports = True
7+
strict_optional = False
8+
files = pycoin
9+
10+
# Specific module ignores can be added as needed
11+
# [mypy-pycoin.contrib.*]
12+
# ignore_errors = True

pycoin/cmds/b58.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64

75
from pycoin.encoding.b58 import a2b_base58, b2a_base58, a2b_hashed_base58, b2a_hashed_base58

pycoin/cmds/dump.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21

32
import datetime
43

pycoin/cmds/keychain.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import sqlite3
75
import sys

pycoin/cmds/ku.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import json
75
import re

pycoin/cmds/msg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import sys
75

pycoin/cmds/tx.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import calendar
75
import codecs

0 commit comments

Comments
 (0)