8000 Support for Python3.9 type hint syntax by matthew-c-lee · Pull Request #2795 · glideapps/quicktype · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for Python3.9 type hint syntax #2795

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
388 changes: 194 additions & 194 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,197 +1,197 @@
name: Test PR
on:
pull_request:
branches:
- master
- "release/**"
pull_request:
branches:
- master
- "release/**"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup

test:
needs: [build]
runs-on: ${{ matrix.runs-on }}

strategy:
fail-fast: true

matrix:
fixture:
- typescript,typescript-zod,typescript-effect-schema
- javascript,schema-javascript
- golang,schema-golang
- cjson,schema-cjson
- cplusplus,schema-cplusplus
- flow,schema-flow
- java,schema-java
- python,schema-python
- haskell,schema-haskell
- csharp,schema-csharp,schema-json-csharp,graphql-csharp,csharp-SystemTextJson
- json-ts-csharp
- dart,schema-dart
# - swift,schema-swift # pgp issue
- javascript-prop-types
- ruby
- php
- scala3,schema-scala3
- elixir,schema-elixir,graphql-elixir

# Partially working
# - schema-typescript # TODO Unify with typescript once fixed

# Implementation is too outdated to test in GitHub Actions
# - elm,schema-elm

# Language is too niche / obscure to test easily on ubuntu-22.04
# - pike,schema-pike

# Not yet started
# @schani can you help me understand this fixture?
# It looks like it tests 13+ languages?
# - graphql

# Never tested?
# - crystal

runs-on: [ubuntu-22.04]

include:
# Rust is very slow, so we use a larger runner
- fixture: rust,schema-rust
runs-on: ubuntu-latest-16-cores
# Kotlin is also slow
- fixture: kotlin,schema-kotlin,kotlin-jackson,schema-kotlin-jackson
runs-on: ubuntu-latest-16-cores

# - fixture: objective-c # segfault on compiled test cmd
# runs-on: macos-latest

name: ${{ matrix.fixture }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup

- name: Setup PHP
if: ${{ contains(matrix.fixture, 'php') }}
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Setup Dart
if: ${{ contains(matrix.fixture, 'dart') }}
uses: dart-lang/setup-dart@v1.3
with:
sdk: 2.14.4

- name: Setup Swift
if: ${{ contains(matrix.fixture, 'swift') }}
uses: swift-actions/setup-swift@v1
with:
swift-version: "5.7.2"

- name: Install Ruby
uses: ruby/setup-ruby@v1
if: ${{ contains(matrix.fixture, 'ruby') }}
with:
ruby-version: "3.2.0"

- name: Setup .NET Core SDK
if: ${{ contains(matrix.fixture, 'csharp') }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6

- name: Install Rust
if: ${{ contains(matrix.fixture, 'rust') }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install Elm
if: ${{ contains(matrix.fixture, 'elm') }}
run: |
curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
gunzip elm.gz
chmod +x elm
sudo mv elm /usr/local/bin/
- name: Install Haskell
if: ${{ contains(matrix.fixture, 'haskell') }}
run: |
if ! command -v stack > /dev/null 2>&1; then
curl -sL "https://get.haskellstack.org/" | sh
fi
- name: Install Python 3.7
if: ${{ contains(matrix.fixture, 'python') }}
uses: actions/setup-python@v4
with:
python-version: 3.7

- name: Install Python Dependencies
if: ${{ contains(matrix.fixture, 'python') }}
run: |
pip3.7 install mypy python-dateutil types-python-dateutil
- name: Install flow
if: ${{ contains(matrix.fixture, 'flow') }}
run: |
npm install -g flow-bin@0.66.0 flow-remove-types@1.2.3
- name: Install Java
if: ${{ matrix.fixture == 'java,schema-java' || contains(matrix.fixture, 'kotlin') }}
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"

- name: Install Maven
if: ${{ matrix.fixture == 'java,schema-java' }}
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.2

- name: Install Kotlin
if: ${{ contains(matrix.fixture, 'kotlin') }}
uses: fwilhe2/setup-kotlin@main

- name: Install go
if: ${{ contains(matrix.fixture, 'golang') }}
uses: actions/setup-go@v3
with:
go-version: 1.15

- name: Install C
if: ${{ contains(matrix.fixture, 'cjson') }}
run: |
sudo apt-get update
sudo apt-get -y install build-essential valgrind

- name: Install C++
if: ${{ contains(matrix.fixture, 'cplusplus') }}
run: |
sudo apt-get update
sudo apt-get -y install libboost-all-dev software-properties-common g++ --assume-yes

- name: Install scala
if: ${{ contains(matrix.fixture, 'scala3') }}
uses: VirtusLab/scala-cli-setup@main
- run: echo '@main def hello() = println("We need this spam print statement for bloop to exit correctly...")' | scala-cli _
if: ${{ contains(matrix.fixture, 'scala3') }}

- name: Install Elixir
if: ${{ contains(matrix.fixture, 'elixir') }}
uses: erlef/setup-beam@v1
with:
elixir-version: "1.15.7"
otp-version: "26.0"

- run: QUICKTEST=true FIXTURE=${{ matrix.fixture }} npm test

test-complete:
if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }}
needs: test
runs-on: ubuntu-22.04
steps:
- run: |
echo "Some workflows have failed!"
exit 1
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup

test:
needs: [build]
runs-on: ${{ matrix.runs-on }}

strategy:
fail-fast: true

matrix:
fixture:
- typescript,typescript-zod,typescript-effect-schema
- javascript,schema-javascript
- golang,schema-golang
- cjson,schema-cjson
- cplusplus,schema-cplusplus
- flow,schema-flow
- java,schema-java
- python,schema-python
- haskell,schema-haskell
- csharp,schema-csharp,schema-json-csharp,graphql-csharp,csharp-SystemTextJson
- json-ts-csharp
- dart,schema-dart
# - swift,schema-swift # pgp issue
- javascript-prop-types
- ruby
- php
- scala3,schema-scala3
- elixir,schema-elixir,graphql-elixir

# Partially working
# - schema-typescript # TODO Unify with typescript once fixed

# Implementation is too outdated to test in GitHub Actions
# - elm,schema-elm

# Language is too niche / obscure to test easily on ubuntu-22.04
# - pike,schema-pike

# Not yet started
# @schani can you help me understand this fixture?
# It looks like it tests 13+ languages?
# - graphql

# Never tested?
# - crystal

runs-on: [ubuntu-22.04]

include:
# Rust is very slow, so we use a larger runner
- fixture: rust,schema-rust
runs-on: ubuntu-latest-16-cores
# Kotlin is also slow
- fixture: kotlin,schema-kotlin,kotlin-jackson,schema-kotlin-jackson
runs-on: ubuntu-latest-16-cores

# - fixture: objective-c # segfault on compiled test cmd
# runs-on: macos-latest

name: ${{ matrix.fixture }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup

- name: Setup PHP
if: ${{ contains(matrix.fixture, 'php') }}
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Setup Dart
if: ${{ contains(matrix.fixture, 'dart') }}
uses: dart-lang/setup-dart@v1.3
with:
sdk: 2.14.4

- name: Setup Swift
if: ${{ contains(matrix.fixture, 'swift') }}
uses: swift-actions/setup-swift@v1
with:
swift-version: "5.7.2"

- name: Install Ruby
uses: ruby/setup-ruby@v1
if: ${{ contains(matrix.fixture, 'ruby') }}
with:
ruby-version: "3.2.0"

- name: Setup .NET Core SDK
if: ${{ contains(matrix.fixture, 'csharp') }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6

- name: Install Rust
if: ${{ contains(matrix.fixture, 'rust') }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install Elm
if: ${{ contains(matrix.fixture, 'elm') }}
run: |
curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
gunzip elm.gz
chmod +x elm
sudo mv elm /usr/local/bin/
- name: Install Haskell
if: ${{ contains(matrix.fixture, 'haskell') }}
run: |
if ! command -v stack > /dev/null 2>&1; then
curl -sL "https://get.haskellstack.org/" | sh
fi
- name: Install Python 3.9
if: ${{ contains(matrix.fixture, 'python') }}
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Python Dependencies
if: ${{ contains(matrix.fixture, 'python') }}
run: |
pip3.9 install mypy python-dateutil types-python-dateutil
- name: Install flow
if: ${{ contains(matrix.fixture, 'flow') }}
run: |
npm install -g flow-bin@0.66.0 flow-remove-types@1.2.3
- name: Install Java
if: ${{ matrix.fixture == 'java,schema-java' || contains(matrix.fixture, 'kotlin') }}
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"

- name: Install Maven
if: ${{ matrix.fixture == 'java,schema-java' }}
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.8.2

- name: Install Kotlin
if: ${{ contains(matrix.fixture, 'kotlin') }}
uses: fwilhe2/setup-kotlin@main

- name: Install go
if: ${{ contains(matrix.fixture, 'golang') }}
uses: actions/setup-go@v3
with:
go-version: 1.15

- name: Install C
if: ${{ contains(matrix.fixture, 'cjson') }}
run: |
sudo apt-get update
sudo apt-get -y install build-essential valgrind

- name: Install C++
if: ${{ contains(matrix.fixture, 'cplusplus') }}
run: |
sudo apt-get update
sudo apt-get -y install libboost-all-dev software-properties-common g++ --assume-yes

- name: Install scala
if: ${{ contains(matrix.fixture, 'scala3') }}
uses: VirtusLab/scala-cli-setup@main
- run: echo '@main def hello() = println("We need this spam print statement for bloop to exit correctly...")' | scala-cli _
if: ${{ contains(matrix.fixture, 'scala3') }}

- name: Install Elixir
if: ${{ contains(matrix.fixture, 'elixir') }}
uses: erlef/setup-beam@v1
with:
elixir-version: "1.15.7"
otp-version: "26.0"

- run: QUICKTEST=true FIXTURE=${{ matrix.fixture }} npm test

test-complete:
if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }}
needs: test
runs-on: ubuntu-22.04
steps:
- run: |
echo "Some workflows have failed!"
exit 1
Loading
0