diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3980217..7cd8862 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' @@ -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 }} @@ -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 }} @@ -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 @@ -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' diff --git a/.gitignore b/.gitignore index a0f90dd..c6e6fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ .idea/ env/ -env35/ -env36/ -env37/ +env*/ *.py[cod] *.egg-info/ dist/ diff --git a/README.md b/README.md index 80218cc..6a78b47 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/devtools/ansi.py b/devtools/ansi.py index daa4c9d..e31a2d1 100644 --- a/devtools/ansi.py +++ b/devtools/ansi.py @@ -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: diff --git a/docs/install.md b/docs/install.md index 36cc597..94630bb 100644 --- a/docs/install.md +++ b/docs/install.md @@ -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. diff --git a/docs/requirements.txt b/docs/requirements.txt index 540379d..3a7c1d2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/pyproject.toml b/pyproject.toml index ebe9dd4..87bff20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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', diff --git a/tests/requirements.txt b/tests/requirements.txt index bf6b169..cd9c6b2 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -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