Skip to content

Python 3.11 #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'

Expand All @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

env:
PYTHON: ${{ matrix.python-version }}
Expand All @@ -40,10 +40,10 @@ jobs:
runs-on: ${{ matrix.os }}-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: ${{ matrix.python-version }}

Expand All @@ -56,7 +56,7 @@ jobs:

- run: coverage xml

- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
env_vars: EXTRAS,PYTHON,OS
Expand All @@ -69,25 +69,35 @@ jobs:

- run: coverage xml

- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
env_vars: EXTRAS,PYTHON,OS
env:
EXTRAS: no

# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

deploy:
needs:
- test
- lint
- check
if: "success() && startsWith(github.ref, 'refs/tags/')"
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.10'

Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.idea/
env/
env35/
env36/
env37/
env*/
*.py[cod]
*.egg-info/
dist/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pip install devtools[pygments]

`pygments` is not required but if it's installed, output will be highlighted and easier to read.

`devtools` has no other required dependencies except python 3.7, 3.8, 3.9 or 3.10.
`devtools` has no other required dependencies except python 3.7, 3.8, 3.9, 3.10 or 3.11.
If you've got python 3.7+ and `pip` installed, you're good to go.

## Usage
Expand Down
5 changes: 4 additions & 1 deletion devtools/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def __str__(self) -> str:
if self == self.function:
return repr(self)
else:
return super().__str__()
# this matches `super().__str__()` in python 3.7 - 3.10
# required since IntEnum.__str__ was changed in 3.11,
# see https://docs.python.org/3/library/enum.html#enum.IntEnum
return f'{self.__class__.__name__}.{self._name_}'


def _style_as_int(v: 'Union[Style, int]') -> str:
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pip install devtools[pygments]

`pygments` is not required but if it's installed, output will be highlighted and easier to read.

`devtools` has no other required dependencies except python 3.7, 3.8, 3.9 or 3.10.
`devtools` has no other required dependencies except python 3.7, 3.8, 3.9, 3.10 or 3.11.
If you've got python 3.7+ and `pip` installed, you're good to go.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ mkdocs-exclude==1.0.2
mkdocs-material==8.3.9
mkdocs-simple-hooks==0.1.5
markdown-include==0.7.0
pygments==2.12.0
pygments==2.13.0
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ classifiers = [
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet',
'Typing :: Typed',
Expand Down
10 changes: 5 additions & 5 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
coverage[toml]==6.4.2
Pygments==2.12.0
pytest==7.1.2
pytest-mock==3.8.2
pytest-sugar==0.9.5
coverage[toml]==6.5.0
Pygments==2.13.0
pytest==7.2.0
pytest-mock==3.10.0
pytest-pretty==0.0.1
# these packages are used in tests so install the latest version
pydantic
asyncpg
Expand Down