aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/package.yml
blob: 25f958684311e0bb2403a4439e09aa1ac507dd2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Test packaging

on:
  push:
  pull_request:

permissions:
  contents: read

jobs:
  wheel:
    name: Test wheel install
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3

      - name: Install pypa/build
        run: |
          # Be wary of running `pip install` here, since it becomes easy for us to
          # accidentally pick up typing_extensions as installed by a dependency 
          python -m pip install --upgrade build
          python -m pip list

      - name: Build and install wheel
        run: |
          cd typing_extensions
          python -m build .
          export path_to_file=$(find dist -type f -name "typing_extensions-*.whl")
          echo "::notice::Installing wheel: $path_to_file"
          pip install -vvv $path_to_file
          python -m pip list

      - name: Attempt to import typing_extensions
        run: python -c "import typing_extensions; print(typing_extensions.__all__)"

  sdist:
    name: Test sdist install
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3

      - name: Install pypa/build
        run: |
          # Be wary of running `pip install` here, since it becomes easy for us to
          # accidentally pick up typing_extensions as installed by a dependency 
          python -m pip install --upgrade build
          python -m pip list

      - name: Build and install sdist
        run: |
          cd typing_extensions
          python -m build .
          export path_to_file=$(find dist -type f -name "typing_extensions-*.tar.gz")
          echo "::notice::Installing sdist: $path_to_file"
          pip install -vvv $path_to_file
          python -m pip list

      - name: Attempt to import typing_extensions
        run: python -c "import typing_extensions; print(typing_extensions.__all__)"