mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 14:50:16 +00:00
6ac1451ec8
* Move away from requirementslib models * Revise test since PEP-440 does not support wildcard versions but does support equivalent compatible release specifiers. * simplify and remove dead code * Ensure the os_name marker is AND with the other markers. * Move what we still need from requirementslib into the pipenv utils and stop vendoring it. * Remove requirementslib. * force upgrade of virtualenv for python 3.12 * remove virtualenv-clone * Update vcs specifiers documentation; infer name from specific pip line formats where possible. * Provide helpful text and error for recently removed commands * Set the right log levels and verbosity to show users the errors generated by pip resolver when supplying -v flag * Fix the collection of all matching package hashes for non-pypi indexes. Plus lesson from testing torch which contains local identifiers.
145 lines
4.4 KiB
YAML
145 lines
4.4 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:
|
|
- "news/**"
|
|
- "examples/**"
|
|
- "peeps/**"
|
|
- "*.ini"
|
|
- "*.md"
|
|
- "**/*.txt"
|
|
- ".gitignore"
|
|
- ".gitmodules"
|
|
- ".gitattributes"
|
|
- ".editorconfig"
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths-ignore:
|
|
- "news/**"
|
|
- "examples/**"
|
|
- "peeps/**"
|
|
- "*.ini"
|
|
- "*.md"
|
|
- "**/*.txt"
|
|
- ".gitignore"
|
|
- ".gitmodules"
|
|
- ".gitattributes"
|
|
- ".editorconfig"
|
|
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@v3
|
|
- uses: actions/setup-python@v4
|
|
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@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
- run: |
|
|
python -m pip install --upgrade wheel invoke parver beautifulsoup4 towncrier requests parse hatch-fancy-pypi-readme
|
|
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.7, 3.8, 3.9, "3.10", "3.11"] # "3.12-dev" Windows CI hangs indefinitely
|
|
os: [MacOS, Ubuntu, Windows]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- 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=${{ steps.python-path.outputs.path }}
|
|
- name: Run pypiserver Windows
|
|
run: |
|
|
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: ${{matrix.os == 'Windows' }}
|
|
- name: Run pypiserver Mac
|
|
run: |
|
|
pipenv run pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
|
|
if: ${{matrix.os == 'MacOS' }}
|
|
- name: Run pypiserver Ubuntu
|
|
run: |
|
|
pipenv run pypi-server run -v --host=0.0.0.0 --port=8080 --hash-algo=sha256 --disable-fallback ./tests/pypi/ ./tests/fixtures &
|
|
if: ${{matrix.os == 'Ubuntu' }}
|
|
- 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@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.x
|
|
- run: pip install -U build twine
|
|
- run: |
|
|
python -m build
|
|
twine check dist/*
|