From b4f2fdbd7c2df436fe8da3b71a52366edc53674e Mon Sep 17 00:00:00 2001 From: antazoey Date: Mon, 12 Jun 2023 20:35:08 -0500 Subject: [PATCH] feat: Python 3.11 support (#32) --- .github/ISSUE_TEMPLATE/bug.md | 13 +++++++------ .github/ISSUE_TEMPLATE/feature.md | 6 +++--- .github/ISSUE_TEMPLATE/work-item.md | 21 ++++++++++++++------- .github/PULL_REQUEST_TEMPLATE.md | 5 +++++ .github/workflows/commitlint.yaml | 6 +++--- .github/workflows/publish.yml | 6 +++--- .github/workflows/test.yaml | 27 +++++++++++++++------------ .github/workflows/title.yaml | 6 +++--- .mdformat.toml | 1 + .pre-commit-config.yaml | 16 +++++++++++----- README.md | 2 +- pyproject.toml | 2 +- setup.py | 14 +++++++++----- 13 files changed, 76 insertions(+), 49 deletions(-) create mode 100644 .mdformat.toml diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 3407e7d..fff978d 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,12 +1,13 @@ --- name: Bug report about: Report an error that you've encountered. -labels: 'bug' +labels: bug --- + ### Environment information -* Python Version: x.x.x -* OS: macOS/linux/win +- Python Version: x.x.x +- OS: macOS/linux/win Python environment @@ -19,9 +20,9 @@ $ pip freeze Please include information like: -* what command you ran -* the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code) -* full output of the error you received +- what command you ran +- the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code) +- full output of the error you received ### How can it be fixed? diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md index 742ce66..1b56056 100644 --- a/.github/ISSUE_TEMPLATE/feature.md +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -1,15 +1,15 @@ --- name: Feature request about: Request a new feature, or an improvement to existing functionality. -labels: 'enhancement' +labels: enhancement --- ### Overview Provide a simple overview of what you wish to see added. Please include: -* What you are trying to do -* Why Ape's current functionality is inadequate to address your goal +- What you are trying to do +- Why Ape's current functionality is inadequate to address your goal ### Specification diff --git a/.github/ISSUE_TEMPLATE/work-item.md b/.github/ISSUE_TEMPLATE/work-item.md index d5bb99c..23b115a 100644 --- a/.github/ISSUE_TEMPLATE/work-item.md +++ b/.github/ISSUE_TEMPLATE/work-item.md @@ -1,14 +1,15 @@ --- name: Work item about: New work item -labels: 'backlog' - +labels: backlog --- ### Elevator pitch: + ### Value: + ### Dependencies: + ### Design approach: + ### Task list: + -* [ ] Tasks go here -### Estimated completion date: +- [ ] Tasks go here +### Estimated completion date: ### Design review: + + Do not signoff unless: -- 1) agreed the tasks and design approach will achieve acceptance, and -- 2) the work can be completed by one person within the SLA. -Design reviewers should consider simpler approaches to achieve goals. + +- 1. agreed the tasks and design approach will achieve acceptance, and +- 2. the work can be completed by one person within the SLA. + Design reviewers should consider simpler approaches to achieve goals. (Please leave a comment to sign off) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 996197d..d238534 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,21 @@ ### What I did + + fixes: # ### How I did it + ### How to verify it + ### Checklist + - [ ] All changes are completed diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml index f6263a7..d804cb4 100644 --- a/.github/workflows/commitlint.yaml +++ b/.github/workflows/commitlint.yaml @@ -9,14 +9,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install Dependencies run: pip install .[dev] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1b9019..88b2e64 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install dependencies run: | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e4edd66..e02a780 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install Dependencies run: pip install .[lint] @@ -29,16 +29,19 @@ jobs: - name: Run isort run: isort --check-only . + - name: Run mdformat + run: mdformat . --check + type-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install Dependencies run: pip install .[lint,test] # Might need test deps @@ -52,13 +55,13 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] # eventually add `windows-latest` - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -75,12 +78,12 @@ jobs: fail-fast: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install Dependencies run: pip install .[test] diff --git a/.github/workflows/title.yaml b/.github/workflows/title.yaml index d283678..a6cd3b0 100644 --- a/.github/workflows/title.yaml +++ b/.github/workflows/title.yaml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: "3.10" - name: Install Dependencies run: pip install commitizen diff --git a/.mdformat.toml b/.mdformat.toml new file mode 100644 index 0000000..01b2fb0 --- /dev/null +++ b/.mdformat.toml @@ -0,0 +1 @@ +number = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a267258..38a4406 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,21 +10,27 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 23.3.0 hooks: - id: black name: black -- repo: https://gitlab.com/pycqa/flake8 - rev: 4.0.1 +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.971 + rev: v0.991 hooks: - id: mypy - additional_dependencies: [types-requests] + additional_dependencies: [types-setuptools, types-requests] + +- repo: https://github.com/executablebooks/mdformat + rev: 0.7.14 + hooks: + - id: mdformat + additional_dependencies: [mdformat-gfm, mdformat-frontmatter] default_language_version: python: python3 diff --git a/README.md b/README.md index 9dc879f..58eb8b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Dependencies -* [python3](https://www.python.org/downloads/release/python-368/) version 3.7.2 or greater, python3-dev +- [python3](https://www.python.org/downloads/release/python-368/) version 3.7.2 or greater, python3-dev ## Installation diff --git a/pyproject.toml b/pyproject.toml index 26e1f3d..57885b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ write_to = "tokenlists/version.py" [tool.black] line-length = 100 -target-version = ['py37', 'py38', 'py39', 'py310'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = '\.pyi?$' [tool.pytest.ini_options] diff --git a/setup.py b/setup.py index c6cca95..2fde40e 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,14 @@ "hypothesis-jsonschema==0.19.0", # Fuzzes based on a json schema ], "lint": [ - "black>=22.6.0,<23", # auto-formatter and linter - "mypy>=0.971,<1", # Static type analyzer + "black>=23.3.0,<24", # auto-formatter and linter + "mypy>=0.991,<1", # Static type analyzer "types-requests", # Needed due to mypy typeshed - "flake8>=4.0.1,<5", # Style linter - "isort>=5.10.1,<6", # Import sorting linter + "flake8>=6.0.0,<7", # Style linter + "isort>=5.10.1", # Import sorting linter + "mdformat>=0.7.16", # Auto-formatter for markdown + "mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown + "mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates ], "doc": [ "Sphinx>=3.4.3,<4", # Documentation generator @@ -61,7 +64,7 @@ long_description_content_type="text/markdown", url="https://github.com/ApeWorX/py-tokenlists", include_package_data=True, - python_requires=">=3.7.2,<3.11", + python_requires=">=3.7.2,<4", install_requires=[ "importlib-metadata ; python_version<'3.8'", "click>=8.1.3,<9", @@ -90,5 +93,6 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], )