mirror of
https://github.com/pypa/pipenv.git
synced 2026-05-09 09:49:47 -04:00
a5a6069246
* chore: bump pypi-server version to 2.3.2 This version supports modern python versions Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * chore: pin dev dependencies These were breaking on python3.8 which is now EOL. Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * fix: attempt checking which pypi-server is installed Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: don't run pypi-server via pipenv Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: simplify pipeline Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * 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. Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: on windows also conditionally use pipenv with pypi-server Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: windows worker have default powershell Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: revert usage of power shell Signed-off-by: Oz Tiram <oz.tiram@gmail.com> * ci: add installation of gunicorn and waitress Signed-off-by: Oz Tiram <oz.tiram@gmail.com> --------- Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
155 lines
5.5 KiB
YAML
155 lines
5.5 KiB
YAML
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:
|
|
python-version: [3.9, "3.10", 3.11, 3.12, 3.13]
|
|
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 without pipenv (Python 3.9-3.11)
|
|
run: |
|
|
python -m pip install gunicorn pypiserver==2.3.2
|
|
python -m pypiserver --version
|
|
python -m pypiserver 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')) && (startsWith(matrix.python-version, '3.9') || startsWith(matrix.python-version, '3.10') || startsWith(matrix.python-version, '3.11'))
|
|
- name: Run pypiserver with pipenv (Python 3.12+)
|
|
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')) && (startsWith(matrix.python-version, '3.12') || startsWith(matrix.python-version, '3.13'))
|
|
- name: Run pypiserver without pipenv on Windows (Python 3.9-3.11)
|
|
run: |
|
|
python -m pip install waitress pypiserver==2.3.2
|
|
python -m pypiserver --version
|
|
cmd /c start 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') && (startsWith(matrix.python-version, '3.9') || startsWith(matrix.python-version, '3.10') || startsWith(matrix.python-version, '3.11'))
|
|
- name: Run pypiserver with pipenv on Windows (Python 3.12+)
|
|
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') && (startsWith(matrix.python-version, '3.12') || startsWith(matrix.python-version, '3.13'))
|
|
- 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
|
|
|
|
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/*
|