|
| 1 | +name: Test packaging |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + wheel: |
| 12 | + name: Test wheel install |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Set up Python |
| 19 | + uses: actions/setup-python@v2 |
| 20 | + with: |
| 21 | + python-version: 3 |
| 22 | + |
| 23 | + - name: Install pypa/build |
| 24 | + run: | |
| 25 | + # Be wary of running `pip install` here, since it becomes easy for us to |
| 26 | + # accidentally pick up typing_extensions as installed by a dependency |
| 27 | + python -m pip install --upgrade build |
| 28 | + python -m pip list |
| 29 | +
|
| 30 | + - name: Build and install wheel |
| 31 | + run: | |
| 32 | + cd typing_extensions |
| 33 | + python -m build . |
| 34 | + export path_to_file=$(find dist -type f -name "typing_extensions-*.whl") |
| 35 | + echo "::notice::Installing wheel: $path_to_file" |
| 36 | + pip install -vvv $path_to_file |
| 37 | + python -m pip list |
| 38 | +
|
| 39 | + - name: Attempt to import typing_extensions |
| 40 | + run: python -c "import typing_extensions; print(typing_extensions.__all__)" |
| 41 | + |
| 42 | + sdist: |
| 43 | + name: Test sdist install |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + |
| 49 | + - name: Set up Python |
| 50 | + uses: actions/setup-python@v2 |
| 51 | + with: |
| 52 | + python-version: 3 |
| 53 | + |
| 54 | + - name: Install pypa/build |
| 55 | + run: | |
| 56 | + # Be wary of running `pip install` here, since it becomes easy for us to |
| 57 | + # accidentally pick up typing_extensions as installed by a dependency |
| 58 | + python -m pip install --upgrade build |
| 59 | + python -m pip list |
| 60 | +
|
| 61 | + - name: Build and install sdist |
| 62 | + run: | |
| 63 | + cd typing_extensions |
| 64 | + python -m build . |
| 65 | + export path_to_file=$(find dist -type f -name "typing_extensions-*.tar.gz") |
| 66 | + echo "::notice::Installing sdist: $path_to_file" |
| 67 | + pip install -vvv $path_to_file |
| 68 | + python -m pip list |
| 69 | +
|
| 70 | + - name: Attempt to import typing_extensions |
| 71 | + run: python -c "import typing_extensions; print(typing_extensions.__all__)" |
0 commit comments