-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from cdce8p/dev
Release v0.4.0
- Loading branch information
Showing
19 changed files
with
374 additions
and
381 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
pull_request: ~ | ||
|
||
env: | ||
CACHE_VERSION: 0 | ||
CACHE_VERSION: 1 | ||
DEFAULT_PYTHON: 3.8 | ||
LIB_FOLDER: python_typing_update | ||
PRE_COMMIT_CACHE: ~/.cache/pre-commit | ||
|
@@ -23,10 +23,10 @@ jobs: | |
pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }} | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v2.2.2 | ||
uses: actions/setup-python@v3.1.1 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Generate partial Python venv restore key | ||
|
@@ -37,7 +37,7 @@ jobs: | |
'requirements_test_pre_commit.txt') }}" | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: venv | ||
key: >- | ||
|
@@ -60,7 +60,7 @@ jobs: | |
hashFiles('.pre-commit-config.yaml') }}" | ||
- name: Restore pre-commit environment | ||
id: cache-precommit | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: >- | ||
|
@@ -79,15 +79,15 @@ jobs: | |
needs: prepare-base | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v2.2.2 | ||
uses: actions/setup-python@v3.1.1 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
|
@@ -99,7 +99,7 @@ jobs: | |
exit 1 | ||
- name: Restore pre-commit environment | ||
id: cache-precommit | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }} | ||
|
@@ -120,15 +120,15 @@ jobs: | |
needs: prepare-base | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v2.2.2 | ||
uses: actions/setup-python@v3.1.1 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
|
@@ -150,15 +150,15 @@ jobs: | |
needs: prepare-base | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v2.2.2 | ||
uses: actions/setup-python@v3.1.1 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
|
@@ -174,20 +174,20 @@ jobs: | |
mypy ${{ env.LIB_FOLDER }} tests | ||
prepare-tests-linux: | ||
name: Prepare tests for Python ${{ matrix.python-version }} (Linux) | ||
pytest-linux: | ||
name: Run tests Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
python-version: [3.8, 3.9, "3.10"] | ||
outputs: | ||
python-key: ${{ steps.generate-python-key.outputs.key }} | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/setup-python@v2.2.2 | ||
uses: actions/setup-python@v3.1.1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Generate partial Python venv restore key | ||
|
@@ -198,7 +198,7 @@ jobs: | |
'requirements_test_pre_commit.txt') }}" | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache@v2.1.6 | ||
uses: actions/cache@v3.0.1 | ||
with: | ||
path: venv | ||
key: >- | ||
|
@@ -214,35 +214,6 @@ jobs: | |
python -m pip install -U pip setuptools wheel | ||
pip install -U -r requirements_test.txt | ||
pip install -e . | ||
pytest-linux: | ||
name: Run tests Python ${{ matrix.python-version }} (Linux) | ||
runs-on: ubuntu-latest | ||
needs: prepare-tests-linux | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: venv | ||
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.prepare-tests-linux.outputs.python-key }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
echo "Failed to restore Python venv from cache" | ||
exit 1 | ||
- name: Run pytest | ||
run: | | ||
. venv/bin/activate | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[build-system] | ||
requires = ["setuptools~=60.5", "wheel~=0.37.1"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.isort] | ||
# https://pycqa.github.io/isort/docs/configuration/options.html | ||
multi_line_output = 4 | ||
line_length = 72 | ||
combine_as_imports = true | ||
force_sort_within_sections = true | ||
known_first_party = [ | ||
"python_typing_update", | ||
"tests", | ||
] | ||
forced_separate = ["tests"] | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = ["tests"] | ||
norecursedirs = ["fixtures"] | ||
console_output_style = "count" | ||
log_level = "NOTSET" | ||
asyncio_mode = "auto" # https://github.com/pytest-dev/pytest-asyncio#modes | ||
|
||
[tool.mypy] | ||
# https://mypy.readthedocs.io/en/stable/config_file.html | ||
python_version = 3.8 | ||
show_error_codes = true | ||
ignore_missing_imports = true | ||
strict = true | ||
follow_imports = "normal" | ||
exclude = "tests/fixtures/.+\\.py" | ||
# Untyped definitions and calls | ||
disallow_untyped_calls = true | ||
disallow_untyped_defs = true | ||
disallow_incomplete_defs = true | ||
check_untyped_defs = true | ||
# None and optional handeling | ||
no_implicit_optional = true | ||
strict_optional = true | ||
# Configure warnings | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
warn_unused_configs = true | ||
# Misc | ||
implicit_reexport = false | ||
strict_equality = true | ||
enable_error_code = ["ignore-without-code"] | ||
# TODO | ||
allow_any_generics = true | ||
|
||
# [[tool.mypy.overrides]] | ||
# module = "tests.*" | ||
# # Untyped definitions and calls | ||
# disallow_untyped_calls = false | ||
# disallow_untyped_defs = false | ||
# disallow_incomplete_defs = false |
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
Empty file.
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
Oops, something went wrong.