|
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | strategy: |
11 | 11 | matrix: |
12 | | - python-version: [ 3.6, 3.7, 3.8, 3.9 ] |
| 12 | + python-version: [3.7, 3.8, 3.9] |
13 | 13 | steps: |
14 | | - - uses: actions/checkout@v2 |
15 | | - - name: Set up Python ${{ matrix.python-version }} |
16 | | - uses: actions/setup-python@v2 |
17 | | - with: |
18 | | - python-version: ${{ matrix.python-version }} |
19 | | - |
20 | | - - name: Patch for Python 3.6 |
21 | | - if: matrix.python-version == 3.6 |
22 | | - run: | |
23 | | - pip install strip-hints==0.1.9 |
24 | | - ./patch-python3.6.sh |
25 | | -
|
26 | | - git config --global user.email "actions@github.com" |
27 | | - git config --global user.name "Github Actions" |
28 | | -
|
29 | | - git add --all |
30 | | - git commit --message "Python 3.6 patch" |
31 | | - latest_tag=$(git describe --abbrev=0 --tags) |
32 | | - git tag --force ${latest_tag} |
33 | | -
|
34 | | - - name: Install dependencies |
35 | | - run: | |
36 | | - pip install -r requirements.txt |
37 | | -
|
38 | | - - name: Install dev dependencies |
39 | | - run: | |
40 | | - pip install -r dev_requirements.txt |
41 | | -
|
42 | | - - name: Test |
43 | | - run: | |
44 | | - pytest |
45 | | -
|
46 | | - - name: Test install package |
47 | | - env: |
48 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
49 | | - run: | |
50 | | - python setup.py bdist_wheel --python-tag py${PYTHON_VERSION//.} |
51 | | -
|
52 | | - - name: Test install package |
53 | | - run: | |
54 | | - pip install virtualenv |
55 | | - virtualenv installable |
56 | | - source installable/bin/activate |
57 | | -
|
58 | | - pip install dist/$(ls dist) |
59 | | -
|
60 | | - mkdir test_install |
61 | | - cd test_install |
62 | | - python -c "import datastream" |
63 | | -
|
64 | | - - name: PyPi Publish |
65 | | - env: |
66 | | - TWINE_USERNAME: __token__ |
67 | | - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
68 | | - run: |
69 | | - twine upload dist/* |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Set up Python ${{ matrix.python-version }} |
| 16 | + uses: actions/setup-python@v2 |
| 17 | + with: |
| 18 | + python-version: ${{ matrix.python-version }} |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
| 23 | + source $HOME/.poetry/env |
| 24 | + poetry install |
| 25 | +
|
| 26 | + - name: Run tests |
| 27 | + run: | |
| 28 | + source $HOME/.poetry/env |
| 29 | + poetry run pytest |
| 30 | +
|
| 31 | + - name: Build wheels |
| 32 | + run: | |
| 33 | + source $HOME/.poetry/env |
| 34 | + poetry version $(git tag --points-at HEAD) |
| 35 | + poetry build |
| 36 | +
|
| 37 | + - name: Test install package |
| 38 | + run: | |
| 39 | + source $HOME/.poetry/env |
| 40 | + mkdir test_install |
| 41 | + cd test_install |
| 42 | + poetry init |
| 43 | + poetry add ../dist/$(ls dist/*.whl) |
| 44 | +
|
| 45 | + poetry run python -c "import datastream" |
| 46 | +
|
| 47 | + - name: Upload |
| 48 | + env: |
| 49 | + USERNAME: __token__ |
| 50 | + PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 51 | + run: | |
| 52 | + source $HOME/.poetry/env |
| 53 | + poetry publish --username=$USERNAME --password=$PASSWORD |
0 commit comments