Skip to content

Commit ed8d338

Browse files
committed
ci: work around issue with pypi-server and older python
It failes to start with: usage: pypi-server run [-h] [-v] [--log-file FILE] [--log-stream STREAM] [--log-frmt FORMAT] [--hash-algo HASH_ALGO] [--backend {auto,simple-dir,cached-dir}] [--version] [-p PORT] [-i HOST] [-a AUTHENTICATE] [-P PASSWORD_FILE] [--disable-fallback] [--fallback-url FALLBACK_URL] [--health-endpoint HEALTH_ENDPOINT] [--server METHOD] [-o] [--welcome HTML_FILE] [--cache-control AGE] [--log-req-frmt FORMAT] [--log-res-frmt FORMAT] [--log-err-frmt FORMAT] [package_directory ...] pypi-server run: error: argument --welcome: invalid html_file_arg value: 'pypiserver/welcome.html' But only on those versions.
1 parent 2c90d27 commit ed8d338

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Diff for: .github/workflows/ci.yaml

+12-5
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,24 @@ jobs:
104104
git submodule update --init --recursive
105105
python -m pip install -e . --upgrade
106106
pipenv install --deploy --dev --python=${{ steps.python-path.outputs.path }}
107-
python -m pip install pypiserver==2.3.2
107+
if [[ "${{ matrix.python-version }}" == 3.9* ]] || [[ "${{ matrix.python-version }}" == 3.10* ]]; then
108+
python -m pip install pypiserver==2.3.2
109+
fi
108110
- name: Run pypiserver Windows
109111
run: |
110112
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
111113
if: ${{matrix.os == 'Windows' }}
112114
- name: Run pypiserver ${{ matrix.os }}
113115
run: |
114-
pipenv run pypi-server --version
115-
pypi-server --version
116-
pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
117-
pipenv run pypi-server run -v --host=0.0.0.0 --port=8081 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
116+
if [[ "${{ matrix.python-version }}" == 3.9* ]] || [[ "${{ matrix.python-version }}" == 3.10* ]]; then
117+
# For Python 3.9 and 3.10, run without pipenv
118+
pypi-server --version
119+
pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
120+
else
121+
# For Python 3.11, 3.12, and 3.13, run with pipenv
122+
pipenv run pypi-server --version
123+
pipenv run pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
124+
fi
118125
if: contains(matrix.os, 'Ubuntu') || contains(matrix.os, 'macOS')
119126
- name: Run tests
120127
env:

0 commit comments

Comments
 (0)