-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a02af91
commit aa494da
Showing
10 changed files
with
123 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: check | ||
on: | ||
push: | ||
tags-ignore: ["**"] | ||
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
@@ -11,108 +12,66 @@ concurrency: | |
|
||
jobs: | ||
test: | ||
name: test ${{ matrix.py }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
name: test on CPython ${{ matrix.py }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
py: | ||
- "3.12.0-beta.2" | ||
- "3.11" | ||
- "3.10" | ||
- "pypy-3.7-v7.3.7" # ahead to start it earlier because takes longer | ||
- "3.9" | ||
- "3.8" | ||
- "3.7" | ||
os: | ||
- ubuntu-22.04 | ||
- windows-2022 | ||
- macos-12 | ||
|
||
- 3.9 | ||
- 3.8 | ||
- 3.7 | ||
steps: | ||
- name: Setup python for tox | ||
- name: setup python for tox | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install tox | ||
- name: install tox | ||
run: python -m pip install tox | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup python for test ${{ matrix.py }} | ||
- name: setup python for test ${{ matrix.py }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Pick environment to run | ||
run: | | ||
import codecs | ||
import os | ||
import platform | ||
import sys | ||
cpy = platform.python_implementation() == "CPython" | ||
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2]) | ||
env = "TOXENV={}\n".format(base) | ||
print("Picked:\n{}for{}".format(env, sys.version)) | ||
import codecs; import os; import sys | ||
env = f"TOXENV=py3{sys.version_info[1]}\n" | ||
print("Picked:\n{env}for{sys.version}") | ||
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: | ||
file_handler.write(env) | ||
shell: python | ||
- name: Setup test suite | ||
- name: setup test suite | ||
run: tox -vv --notest | ||
- name: Run test suite | ||
- name: run test suite | ||
run: tox --skip-pkg-install | ||
env: | ||
PYTEST_ADDOPTS: "-vv --durations=20" | ||
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
|
||
check: | ||
name: tox env ${{ matrix.tox_env }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
name: tox env ${{ matrix.tox_env }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-22.04 | ||
- windows-2022 | ||
tox_env: | ||
- dev | ||
- type | ||
- readme | ||
exclude: | ||
- { os: windows-latest, tox_env: readme } | ||
- dev | ||
- pkg_check | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python "3.11" | ||
- name: setup Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install tox | ||
- name: install tox | ||
run: python -m pip install tox | ||
- name: Setup test suite | ||
run: tox -vv --notest -e ${{ matrix.tox_env }} | ||
- name: Run test suite | ||
run: tox --skip-pkg-install -e ${{ matrix.tox_env }} | ||
|
||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [check, test] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build sdist and wheel | ||
run: python -m build -s -w . -o dist | ||
- name: Publish to PyPi | ||
uses: pypa/[email protected] | ||
with: | ||
skip_existing: true | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
- name: run check for ${{ matrix.tox_env }} | ||
run: python -m tox -e ${{ matrix.tox_env }} | ||
env: | ||
UPGRADE_ADVISORY: "yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release to PyPI | ||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/sphinx-argparse-cli | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build package | ||
run: pyproject-build -s -w . -o dist | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,65 +2,32 @@ repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.2 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py37-plus"] | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
args: [--safe] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: 1.13.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.3] | ||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: "0.11.1" | ||
hooks: | ||
- id: pyproject-fmt | ||
additional_dependencies: [tox>=4.5.1] | ||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: "1.3.0" | ||
hooks: | ||
- id: tox-ini-fmt | ||
args: ["-p", "fix"] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: "0.12.0" | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear==23.3.23 | ||
- flake8-comprehensions==3.12 | ||
- flake8-pytest-style==1.7.2 | ||
- flake8-spellcheck==0.28 | ||
- flake8-unused-arguments==0.0.13 | ||
- flake8-noqa==1.3.1 | ||
- pep8-naming==0.13.3 | ||
- flake8-pyproject==1.2.3 | ||
- id: pyproject-fmt | ||
additional_dependencies: ["tox>=4.6.1"] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v2.7.1" | ||
rev: "v3.0.0-alpha.9-for-vscode" | ||
hooks: | ||
- id: prettier | ||
additional_dependencies: | ||
- [email protected] | ||
- "@prettier/[email protected]" | ||
args: ["--print-width=120", "--prose-wrap=always"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.0.272" | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
pytest_plugins = ["pytester"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from time import sleep | ||
from typing import Callable, Iterator | ||
|
||
|
Oops, something went wrong.