@@ -6,104 +6,127 @@ jobs:
66 CI :
77 continue-on-error : true
88 runs-on : ${{ matrix.os }}
9- # Supported Versions:
10- # https://github.com/actions/python-versions/blob/main/versions-manifest.json
9+
1110 strategy :
11+ fail-fast : false
1212 matrix :
13- os : [macos-13, windows-latest]
14- python-version : [3.6, 3.7, 3.8, pypy-3.7]
15- exclude :
16- - os : windows-latest
17- python-version : 3.6
18- include :
19- - os : ubuntu-20.04
20- python-version : 3.7
21- - os : ubuntu-20.04
22- python-version : 2.7
13+ os : [macos-15-intel, macos-latest, windows-latest, ubuntu-latest]
14+ python-version : ["3.9", "3.10", "3.11"]
15+
2316 steps :
24- - uses : actions/checkout@v2
25- - if : ${{ matrix.python-version == '2.7' }}
26- name : Setup Python environment (2.7)
27- run : |
28- sudo apt-get install python-is-python2
29- curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
30- python get-pip.py
31- - if : ${{ matrix.python-version != '2.7' }}
32- name : Setup Python environment
33- 17+ - uses : actions/checkout@v5
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v6
3421 with :
3522 python-version : ${{ matrix.python-version }}
36- - name : Install Requirements
23+ cache : " pip"
24+
25+ - name : Install dependencies
3726 run : |
38- python -m pip install --upgrade pip
39- pip install flake8 pytest
40- pip install -r requirements.txt
41- pip install -r test/requirements.txt
42- python setup.py install --user
43- - name : Run Linter
27+ python -m pip install -U pip
28+ python -m pip install -U build flake8 pytest
29+ python -m pip install -r requirements.txt
30+ python -m pip install -r test/requirements.txt
31+
32+ - name : Build wheel
33+ run : python -m build --wheel
34+
35+ - name : Show dist contents
36+ run : ls -la dist
37+ shell : bash
38+
39+ - name : Install package from wheel (robust)
40+ shell : bash
41+ run : |
42+ WHEEL="$(python -c "import glob; w=glob.glob('dist/*.whl'); print(w[0] if w else '')")"
43+ if [ -z "$WHEEL" ]; then
44+ echo "No wheel was built. dist contains:"
45+ ls -la dist || true
46+ exit 1
47+ fi
48+ python -m pip install "$WHEEL"
49+
50+ - name : Run linter
4451 run : |
4552 flake8 setup.py dropbox example test
46- - name : Run Unit Tests
53+
54+ - name : Run unit tests
4755 run : |
4856 pytest -v test/unit/test_dropbox_unit.py
4957 Docs :
50- runs-on : ubuntu-20.04
58+ runs-on : ubuntu-latest
5159 steps :
52- - uses : actions/checkout@v2
53- - name : Setup Python environment
54- 60+ - uses : actions/checkout@v5
61+
62+ - name : Set up Python
63+ uses : actions/setup-python@v6
5564 with :
56- python-version : ' 3.7'
57- - name : Install Requirements
65+ python-version : " 3.9"
66+ cache : " pip"
67+
68+ - name : Install build and doc tooling
5869 run : |
59- python -m pip install --upgrade pip
60- pip install twine sphinx
61- pip install -r requirements.txt
62- pip install -r test/requirements.txt
63- python setup.py install
64- - name : Test Doc Generation
70+ python -m pip install -U pip
71+ python -m pip install build twine sphinx
72+ python -m pip install -r requirements.txt
73+ python -m pip install -r test/requirements.txt
74+
75+ - name : Build sdist and wheel (PEP 517)
76+ run : python -m build
77+
78+ - name : Validate distribution metadata
79+ run : twine check dist/*
80+
81+ - name : Build wheel
82+ run : python -m build --wheel
83+
84+ - name : Install package from wheel
6585 run : |
66- sphinx-build -b html docs build/html
67- - name : Test Dist Generation
86+ python -c "import glob,sys; w=glob.glob('dist/*.whl'); assert w, f'No wheel built. dist contains: {glob.glob(\"dist/*\")}'; print(w[0])"
87+ python -c "import glob; print(glob.glob('dist/*.whl')[0])" > wheel_path.txt
88+ python -m pip install "$(cat wheel_path.txt)"
89+ shell : bash
90+
91+
92+ - name : Test documentation generation
6893 run : |
69- python setup.py sdist bdist_wheel
70- twine check dist/*
94+ sphinx-build -b html docs build/html
95+
7196 Integration :
7297 continue-on-error : true
7398 runs-on : ${{ matrix.os }}
7499 strategy :
100+ fail-fast : false
75101 matrix :
76- os : [macos-13, windows-latest]
77- python-version : [3.6, 3.7, 3.8, pypy-3.7]
78- exclude :
79- - os : windows-latest
80- python-version : 3.6
81- include :
82- - os : ubuntu-20.04
83- python-version : 3.7
84- - os : ubuntu-20.04
85- python-version : 2.7
102+ os : [macos-15-intel, macos-latest, windows-latest, ubuntu-latest]
103+ python-version : ["3.9", "3.10", "3.11"]
104+
86105 steps :
87- 88- - if : ${{ matrix.python-version == '2.7' }}
89- name : Setup Python environment (2.7)
90- run : |
91- sudo apt-get install python-is-python2
92- curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
93- python get-pip.py
94- - if : ${{ matrix.python-version != '2.7' }}
95- name : Setup Python environment
96- 106+ - uses : actions/checkout@v5
107+
108+ - name : Set up Python
109+ uses : actions/setup-python@v6
97110 with :
98111 python-version : ${{ matrix.python-version }}
99- - name : Install Requirements
112+ cache : " pip"
113+
114+ - name : Install dependencies
100115 run : |
101- python -m pip install --upgrade pip
102- pip install flake8 pytest
103- pip install -r requirements.txt
104- pip install -r test/requirements.txt
105- python setup.py install --user
106- - name : Run Integration Tests
116+ python -m pip install -U pip
117+ python -m pip install -U build pytest
118+ python -m pip install -r requirements.txt
119+ python -m pip install -r test/requirements.txt
120+
121+ - name : Build wheel
122+ run : python -m build --wheel
123+
124+ - name : Install package from wheel (cross-platform)
125+ shell : bash
126+ run : |
127+ python -m pip install "$(python -c "import glob,sys; w=glob.glob('dist/*.whl'); assert w, f'No wheel built. dist contains: {glob.glob(\"dist/*\")}'; print(w[0])")"
128+
129+ - name : Run integration tests
107130 env :
108131 LEGACY_USER_DROPBOX_TOKEN : ${{ secrets.LEGACY_USER_DROPBOX_TOKEN }}
109132 LEGACY_USER_CLIENT_ID : ${{ secrets.LEGACY_USER_CLIENT_ID }}
@@ -119,4 +142,4 @@ jobs:
119142 SCOPED_TEAM_REFRESH_TOKEN : ${{ secrets.SCOPED_TEAM_REFRESH_TOKEN }}
120143 DROPBOX_SHARED_LINK : ${{ secrets.DROPBOX_SHARED_LINK }}
121144 run : |
122- pytest -v test/integration/test_dropbox.py
145+ pytest -v test/integration/test_dropbox.py
0 commit comments