forked from python-poetry/poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into removeUnnecessaryExplicitCwd
- Loading branch information
Showing
367 changed files
with
10,082 additions
and
5,794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,79 @@ | ||
freebsd_instance: | ||
image_family: freebsd-14-0 | ||
cpu: 2 | ||
memory: 4G | ||
|
||
test_task: | ||
name: "Tests / FreeBSD / " | ||
only_if: $CIRRUS_TAG == '' | ||
skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', '**.json','**.py')" | ||
tests_task: | ||
# We only use Cirrus CI for FreeBSD at present; the rest of the task will assume FreeBSD. | ||
freebsd_instance: | ||
image_family: freebsd-14-0 | ||
# Cirrus has a concurrency limit of 8 vCPUs for FreeBSD. Allow executing 4 tasks in parallel. | ||
cpu: 2 | ||
memory: 2G | ||
|
||
env: | ||
# `SHELL` environment variable is not set by default, so we explicitly set it to | ||
# avoid failures on tests that depend on it. | ||
SHELL: sh | ||
matrix: | ||
- PYTHON: python3.8 | ||
PYTHON_VERSION: 3.8 | ||
PYTHON_PACKAGE: python38 | ||
SQLITE_PACKAGE: py38-sqlite3 | ||
- PYTHON: python3.9 | ||
PYTHON_VERSION: 3.9 | ||
PYTHON_PACKAGE: python39 | ||
SQLITE_PACKAGE: py39-sqlite3 | ||
- PYTHON: python3.10 | ||
PYTHON_VERSION: 3.10 | ||
PYTHON_PACKAGE: python310 | ||
SQLITE_PACKAGE: py310-sqlite3 | ||
- PYTHON: python3.11 | ||
install_prereqs_script: | ||
- V=$(printf '%s' $PYTHON | tr -d '.[:alpha:]') | ||
- pkg install -y python${V} py${V}-sqlite3 | ||
install_poetry_script: | ||
- POETRY_HOME=/opt/poetry | ||
PYTHON_VERSION: 3.11 | ||
PYTHON_PACKAGE: python311 | ||
SQLITE_PACKAGE: py311-sqlite3 | ||
# FIXME: Python 3.12 is not available in Ports. | ||
# - PYTHON: python3.12 | ||
# PYTHON_VERSION: 3.12 | ||
# PYTHON_PACKAGE: python312 | ||
# SQLITE_PACKAGE: py312-sqlite3 | ||
# FIXME: use pipx for install. pipx is currently broken in Ports. | ||
POETRY_HOME: /opt/poetry | ||
# SHELL is not set by default, and we have tests that depend on it. | ||
SHELL: sh | ||
|
||
bootstrap_poetry_script: | ||
- pkg install -y git $PYTHON_PACKAGE $SQLITE_PACKAGE | ||
- $PYTHON -m venv $POETRY_HOME | ||
- $POETRY_HOME/bin/pip install --upgrade pip setuptools wheel | ||
- $POETRY_HOME/bin/pip install poetry | ||
- echo "PATH=$POETRY_HOME/bin:$PATH" >> $CIRRUS_ENV | ||
install_and_test_script: | ||
- echo "PATH=${POETRY_HOME}/bin:${PATH}" >> $CIRRUS_ENV | ||
|
||
setup_environment_script: | ||
# TODO: caching | ||
- poetry install | ||
- poetry run pytest --junitxml=junit.xml -v | ||
on_failure: | ||
annotate_failure_artifacts: | ||
path: junit.xml | ||
format: junit | ||
type: text/xml | ||
- poetry env info | ||
- poetry show | ||
|
||
matrix: | ||
- alias: pytest | ||
name: "Tests / FreeBSD (Python ${PYTHON_VERSION}) / pytest" | ||
skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', 'src/**.py', 'tests/**')" | ||
pytest_script: poetry run pytest --integration -v --junitxml=junit.xml | ||
on_failure: | ||
annotate_failure_artifacts: | ||
path: junit.xml | ||
format: junit | ||
type: text/xml | ||
|
||
# TODO: caching | ||
- alias: mypy | ||
name: "Tests / FreeBSD (Python ${PYTHON_VERSION}) / mypy" | ||
skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', 'src/**.py')" | ||
mypy_script: poetry run mypy | ||
|
||
status_task: | ||
name: "Tests / FreeBSD Status" | ||
|
||
depends_on: | ||
- pytest | ||
- mypy | ||
|
||
container: | ||
image: alpine:latest | ||
cpu: 0.5 | ||
memory: 512M | ||
|
||
# No-op the clone. | ||
clone_script: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Do not mess with line endings in metadata files or the hash will be wrong. | ||
*.metadata binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Bootstrap Poetry | ||
description: Configure the environment with the specified Python and Poetry version. | ||
|
||
inputs: | ||
python-version: | ||
description: Desired node-semver compatible Python version expression (or 'default') | ||
default: 'default' | ||
python-latest: | ||
description: Use an uncached Python if a newer match is available | ||
default: 'false' | ||
python-prereleases: | ||
description: Allow usage of pre-release Python versions | ||
default: 'false' | ||
poetry-spec: | ||
description: pip-compatible installation specification to use for Poetry | ||
default: 'poetry' | ||
|
||
outputs: | ||
python-path: | ||
description: Path to the installed Python interpreter | ||
value: ${{ steps.setup-python.outputs.python-path }} | ||
python-version: | ||
description: Version of the installed Python interpreter | ||
value: ${{ steps.setup-python.outputs.python-version }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 | ||
id: setup-python | ||
if: inputs.python-version != 'default' | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
check-latest: ${{ inputs.python-latest == 'true' }} | ||
allow-prereleases: ${{ inputs.python-prereleases == 'true' }} | ||
update-environment: false | ||
|
||
- run: > | ||
pipx install \ | ||
${{ inputs.python-version != 'default' && format('--python "{0}"', steps.setup-python.outputs.python-path) || '' }} \ | ||
'${{ inputs.poetry-spec }}' | ||
shell: bash | ||
# Enable handling long path names (+260 char) on the Windows platform | ||
# https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation | ||
- run: git config --system core.longpaths true | ||
if: runner.os == 'Windows' | ||
shell: pwsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Poetry Install | ||
description: Run `poetry install` with optional artifact and metadata caching | ||
|
||
inputs: | ||
args: | ||
description: Arguments for `poetry install` | ||
cache: | ||
description: Enable transparent Poetry artifact and metadata caching | ||
default: 'true' | ||
|
||
outputs: | ||
cache-hit: | ||
description: Whether an exact cache hit occured | ||
value: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: printf 'cache-dir=%s\n' "$(poetry config cache-dir)" >> $GITHUB_OUTPUT | ||
id: poetry-config | ||
shell: bash | ||
|
||
# Bust the cache every 24 hours to prevent it from expanding over time. | ||
- run: printf 'date=%s\n' "$(date -I)" >> $GITHUB_OUTPUT | ||
id: get-date | ||
if: inputs.cache == 'true' | ||
shell: bash | ||
|
||
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | ||
id: cache | ||
if: inputs.cache == 'true' | ||
with: | ||
path: | | ||
${{ steps.poetry-config.outputs.cache-dir }}/artifacts | ||
${{ steps.poetry-config.outputs.cache-dir }}/cache | ||
key: poetry-${{ steps.get-date.outputs.date }}-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }} | ||
# The cache is cross-platform, and other platforms are used to seed cache misses. | ||
restore-keys: | | ||
poetry-${{ steps.get-date.outputs.date }}-${{ runner.os }}- | ||
poetry-${{ steps.get-date.outputs.date }}- | ||
enableCrossOsArchive: true | ||
|
||
- run: poetry install ${{ inputs.args }} | ||
shell: bash | ||
|
||
- run: poetry env info | ||
shell: bash | ||
|
||
- run: poetry show | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
# keep dependency updates manual for now | ||
open-pull-requests-limit: 0 | ||
reviewers: | ||
- "python-poetry/triage" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- "area/ci" |
Oops, something went wrong.