Skip to content

Commit 2683b6a

Browse files
authored
chore: upgrade pyyaml and lints (#30)
1 parent cb9dd99 commit 2683b6a

File tree

12 files changed

+47
-41
lines changed

12 files changed

+47
-41
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ labels: 'bug'
66
### Environment information
77

88
* Python Version: x.x.x
9-
* OS: osx/linux/win
9+
* OS: macOS/linux/win
1010

1111
Python environment
1212

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
### What I did
2+
<!-- Create a summary of the changes -->
23

3-
Related issue: #
4+
<!-- The `fixes:` field denotes an issue that will be marked resolved by merging this PR -->
5+
fixes: #
46

57
### How I did it
8+
<!-- Discuss the thought process behind the change -->
69

710
### How to verify it
11+
<!-- Discuss any methods that should be used to verify the change -->
812

913
### Checklist
14+
<!-- All PRs must complete the following checklist before being merged -->
1015

11-
- [ ] Passes all linting checks (pre-commit and CI jobs)
12-
- [ ] New test cases have been added and are passing
16+
- [ ] All changes are completed
17+
- [ ] New test cases have been added
1318
- [ ] Documentation has been updated
14-
- [ ] PR title follows [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) standard (will be automatically included in the changelog)

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ share/python-wheels/
2626
.installed.cfg
2727
*.egg
2828
MANIFEST
29+
*.swp
30+
.DS_Store
2931

3032
# PyInstaller
3133
# Usually these files are written by a python script from a template

.pre-commit-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,27 @@ repos:
44
hooks:
55
- id: check-yaml
66

7-
- repo: https://github.com/asottile/seed-isort-config
8-
rev: v2.2.0
9-
hooks:
10-
- id: seed-isort-config
11-
127
- repo: https://github.com/pre-commit/mirrors-isort
138
rev: v5.10.1
149
hooks:
1510
- id: isort
1611

1712
- repo: https://github.com/psf/black
18-
rev: 22.3.0
13+
rev: 22.6.0
1914
hooks:
2015
- id: black
2116
name: black
2217

2318
- repo: https://gitlab.com/pycqa/flake8
24-
rev: 3.9.2
19+
rev: 4.0.1
2520
hooks:
2621
- id: flake8
2722

2823
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v0.950
24+
rev: v0.971
3025
hooks:
3126
- id: mypy
32-
27+
additional_dependencies: [types-requests]
3328

3429
default_language_version:
3530
python: python3

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Dependencies
66

7-
* [python3](https://www.python.org/downloads/release/python-368/) version 3.6 or greater, python3-dev
7+
* [python3](https://www.python.org/downloads/release/python-368/) version 3.7.2 or greater, python3-dev
88

99
## Installation
1010

@@ -42,7 +42,9 @@ python3 setup.py install
4242

4343
## Development
4444

45-
This project is in early development and should be considered an alpha. Things might not work, breaking changes are likely. Comments, questions, criticisms and pull requests are welcomed.
45+
This project is in early development and should be considered an alpha.
46+
Things might not work, breaking changes are likely.
47+
Comments, questions, criticisms and pull requests are welcomed.
4648

4749
## License
4850

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[build-system]
1+
[build-system]
22
requires = ["setuptools>=51.1.1", "wheel", "setuptools_scm[toml]>=5.0"]
33

44
[tool.mypy]
@@ -36,7 +36,5 @@ markers = "fuzzing: Run Hypothesis fuzz test suite"
3636
line_length = 100
3737
force_grid_wrap = 0
3838
include_trailing_comma = true
39-
known_third_party = ["click", "github", "hypothesis", "hypothesis_jsonschema", "pydantic", "pytest", "requests", "semantic_version", "setuptools"]
40-
known_first_party = ["tokenlists"]
4139
multi_line_output = 3
4240
use_parentheses = true

setup.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55

66
extras_require = {
77
"test": [ # `test` GitHub Action jobs uses this
8-
"pytest>=6.0,<7.0", # Core testing package
8+
"pytest>=6.0", # Core testing package
99
"pytest-xdist", # multi-process runner
1010
"pytest-cov", # Coverage analyzer plugin
11-
"hypothesis>=6.2.0,<7.0", # Strategy-based fuzzer
12-
"PyGithub>=1.54,<2.0", # Necessary to pull official schema from github
11+
"hypothesis>=6.2.0,<7", # Strategy-based fuzzer
12+
"PyGithub>=1.54,<2", # Necessary to pull official schema from github
1313
"hypothesis-jsonschema==0.19.0", # Fuzzes based on a json schema
1414
],
1515
"lint": [
16-
"black>=22.3.0,<23.0", # auto-formatter and linter
17-
"mypy>=0.950,<1.0", # Static type analyzer
18-
"flake8>=4.0.1,<5.0", # Style linter
19-
"isort>=5.10.1,<6.0", # Import sorting linter
16+
"black>=22.6.0,<23", # auto-formatter and linter
17+
"mypy>=0.971,<1", # Static type analyzer
18+
"types-requests", # Needed due to mypy typeshed
19+
"flake8>=4.0.1,<5", # Style linter
20+
"isort>=5.10.1,<6", # Import sorting linter
2021
],
2122
"doc": [
2223
"Sphinx>=3.4.3,<4", # Documentation generator
@@ -48,6 +49,7 @@
4849
with open("./README.md") as readme:
4950
long_description = readme.read()
5051

52+
5153
setup(
5254
name="tokenlists",
5355
use_scm_version=True,
@@ -62,10 +64,11 @@
6264
python_requires=">=3.7.2,<3.11",
6365
install_requires=[
6466
"importlib-metadata ; python_version<'3.8'",
65-
"click>=8.0.1",
66-
"pydantic>=1.9.0,<2.0.0",
67-
"pyyaml>=6.0,<7.0",
68-
"semantic-version>=2.9.0,<3",
67+
"click>=8.1.3,<9",
68+
"pydantic>=1.9.2,<2",
69+
"pyyaml>=6.0,<7",
70+
"semantic-version>=2.10.0,<3",
71+
"requests>=2.28.1,<3",
6972
],
7073
entry_points={"console_scripts": ["tokenlists=tokenlists._cli:cli"]},
7174
extras_require=extras_require,

tests/functional/test_schema_fuzzing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
import requests # type: ignore
2+
import requests
33
from hypothesis import HealthCheck, given, settings
44
from hypothesis_jsonschema import from_schema
55
from pydantic import ValidationError

tests/functional/test_uniswap_examples.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import os
22

33
import github
4-
import pytest # type: ignore
5-
import requests # type: ignore
4+
import pytest
5+
import requests
66
from pydantic import ValidationError
77

88
from tokenlists import TokenList
99

1010
# NOTE: Must export GITHUB_ACCESS_TOKEN
1111
UNISWAP_REPO = github.Github(os.environ["GITHUB_ACCESS_TOKEN"]).get_repo("Uniswap/token-lists")
12-
1312
UNISWAP_RAW_URL = "https://raw.githubusercontent.com/Uniswap/token-lists/master/test/schema/"
1413

1514

@@ -20,6 +19,13 @@
2019
def test_uniswap_tokenlists(token_list_name):
2120
token_list = requests.get(UNISWAP_RAW_URL + token_list_name).json()
2221

22+
if token_list_name in (
23+
"example-crosschain.tokenlist.json",
24+
"extensions-valid-object.tokenlist.json",
25+
):
26+
# TODO: Unskip once can handle object extensions
27+
pytest.skip("https://github.com/ApeWorX/py-tokenlists/issues/20")
28+
2329
if "invalid" not in token_list_name:
2430
assert TokenList.parse_obj(token_list).dict() == token_list
2531

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
import pytest # type: ignore
3+
import pytest
44
from click.testing import CliRunner
55

66
from tokenlists import _cli, config

0 commit comments

Comments
 (0)