Skip to content

Commit

Permalink
feat: Python 3.11 support (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jun 13, 2023
1 parent 2683b6a commit b4f2fdb
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 49 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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?

Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
21 changes: 14 additions & 7 deletions .github/ISSUE_TEMPLATE/work-item.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
---
name: Work item
about: New work item
labels: 'backlog'

labels: backlog
---

### Elevator pitch:

<!-- 1-2 line summary of the scope of this work item -->

### Value:

<!--
Who is this for?
Persona or group of people whom will derive value from the scenario.
What benefits will be achieved or business metrics improved?
-->

### Dependencies:

<!-- Call out key people, teams, tech dependencies, or assumptions. -->

### Design approach:

<!--
Free text / diagram / whiteboard picture / etc. that clearly shows your approach and considerations to build the task list.
Existing code patterns in production code base that you will base your work off of.
-->

### Task list:

<!-- Bulleted list describing the exit criteria, desired end state and any documentation, monitors, work for DRI, etc. that will need to be added to make sure someone else can support once it's live. -->
* [ ] Tasks go here

### Estimated completion date:
- [ ] Tasks go here

### Estimated completion date:

### Design review:

<!-- 1-2 people needed for signoff -->

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)
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
### What I did

<!-- Create a summary of the changes -->

<!-- The `fixes:` field denotes an issue that will be marked resolved by merging this PR -->

fixes: #

### How I did it

<!-- Discuss the thought process behind the change -->

### How to verify it

<!-- Discuss any methods that should be used to verify the change -->

### Checklist

<!-- All PRs must complete the following checklist before being merged -->

- [ ] All changes are completed
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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 }}

Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/title.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
number = true
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -90,5 +93,6 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
)

0 comments on commit b4f2fdb

Please sign in to comment.