-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
175 lines (170 loc) · 5.38 KB
/
Copy pathci.yaml
File metadata and controls
175 lines (170 loc) · 5.38 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
concurrency:
group: >-
${{ github.workflow }}-
${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
push:
paths-ignore:
- ".editorconfig"
- ".gitattributes"
- ".gitignore"
- ".gitmodules"
- "*.ini"
- "*.md"
- "**/*.txt"
- "examples/**"
- "news/**"
branches:
- main
pull_request:
paths-ignore:
- ".editorconfig"
- ".gitattributes"
- ".gitignore"
- ".gitmodules"
- "*.ini"
- "*.md"
- "**/*.txt"
- "examples/**"
- "news/**"
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
lint:
name: Check code linting
runs-on: ubuntu-latest
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PYTHONIOENCODING: "utf-8"
GIT_ASK_YESNO: "false"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: |
python -m pip install pre-commit
pre-commit run --all-files --verbose --show-diff-on-failure
vendor:
name: Vendoring
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: |
python -m pip install --upgrade wheel invoke parver beautifulsoup4 towncrier requests parse hatch-fancy-pypi-readme semver
python -m invoke vendoring.update
tests:
name: ${{matrix.os}} / ${{ matrix.python-version }}
needs: lint
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
# Note: Python 3.15 removed until upstream pip supports it
# (pip's typing_extensions uses typing.no_type_check_decorator which was removed in 3.15)
python-version: ["3.10", 3.11, 3.12, 3.13, 3.14]
os: [MacOS, Ubuntu, Windows]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
check-latest: true
- name: Get python path
id: python-path
run: |
echo "path=$(python -c 'import sys; print(sys.executable)')" >> $GITHUB_OUTPUT
- name: Install latest pip, setuptools, wheel
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PYTHONIOENCODING: "utf-8"
GIT_ASK_YESNO: "false"
run: |
git submodule sync
git submodule update --init --recursive
python -m pip install -e . --upgrade
pipenv install --deploy --dev --python=${{ matrix.python-version }}
- name: Run pypiserver with pipenv (Python 3.10+)
run: |
pipenv run pypi-server --version
pipenv run pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
if: (contains(matrix.os, 'Ubuntu') || contains(matrix.os, 'macOS'))
- name: Run pypiserver with pipenv on Windows (Python 3.10+)
run: |
pipenv run pypi-server --version
cmd /c start pipenv run pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures
if: contains(matrix.os, 'Windows')
- name: Run tests
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: "1"
CI: "1"
GIT_ASK_YESNO: "false"
PYPI_VENDOR_DIR: "./tests/pypi/"
PYTHONIOENCODING: "utf-8"
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
run: |
pipenv run pytest -ra -n auto -v --fulltrace tests
benchmark:
name: Package Manager Benchmark
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libxmlsec1-dev librdkafka-dev
- name: Install benchmark utilities
run: pip install csv2md
- name: Run benchmark suite
working-directory: benchmarks
run: python benchmark.py
- name: Display benchmark results
working-directory: benchmarks
run: |
if [ -f stats.csv ]; then
csv2md stats.csv >> $GITHUB_STEP_SUMMARY
fi
- uses: actions/upload-artifact@v4
with:
name: pipenv-benchmark-stats
path: benchmarks/stats.csv
retention-days: 30
build:
name: Build Package
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install -U build twine
- run: |
python -m build
twine check dist/*