diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json new file mode 100644 index 00000000..698886db --- /dev/null +++ b/.github/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.7.1" +} diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml new file mode 100644 index 00000000..de870006 --- /dev/null +++ b/.github/actions/setup-env/action.yml @@ -0,0 +1,20 @@ +name: setup-env +description: set up the python environment + +inputs: + python-version: + description: "The python version to install and use" + default: "3.12" # we default to latest supported + required: false + +runs: + using: composite + steps: + - name: Setup Poetry + run: pipx install poetry + shell: bash + - name: Setup python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + cache: poetry diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 00000000..1bd96f93 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,10 @@ +{ + "release-type": "python", + "bootstrap-sha": "28e3a471c32c1036dd5e37df13cdde3b1ba91000", + "packages": { + ".": { + "package-name": "testcontainers" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} diff --git a/.github/workflows/attention-label.yml.disabled b/.github/workflows/attention-label.yml.disabled deleted file mode 100644 index 97d38444..00000000 --- a/.github/workflows/attention-label.yml.disabled +++ /dev/null @@ -1,30 +0,0 @@ -name: Automatically add or remove labels -on: - issue_comment: - types: - - created -jobs: - show-metadata: - runs-on: ubuntu-latest - steps: - # Use environment variable to print the metadata (cf. https://github.com/actions/runner/issues/1656#issuecomment-1030077729). - - name: Show metadata - run: echo $JSON - env: - JSON: ${{ toJson(github.event) }} - add-label: - if: ${{ github.event.comment.user.login != 'tillahoffmann' }} - runs-on: ubuntu-latest - steps: - - name: Add label - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: '👀 requires attention' - remove-label: - if: ${{ github.event.comment.user.login == 'tillahoffmann' }} - runs-on: ubuntu-latest - steps: - - name: Remove label - uses: actions-ecosystem/action-remove-labels@v1 - with: - labels: '👀 requires attention' diff --git a/.github/workflows/ci-community.yml b/.github/workflows/ci-community.yml index 92e58e51..b5b1c65f 100644 --- a/.github/workflows/ci-community.yml +++ b/.github/workflows/ci-community.yml @@ -61,13 +61,10 @@ jobs: gh run watch ${{ github.run_id }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Poetry - run: pipx install poetry - - name: Setup python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python + uses: ./.github/actions/setup-env with: python-version: ${{ matrix.python-version }} - cache: poetry - name: Install Python dependencies run: poetry install -E ${{ matrix.module }} - name: Run tests diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index c9661986..65bb2388 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -11,19 +11,17 @@ on: jobs: test: strategy: + fail-fast: false matrix: os: [ ubuntu ] - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v4 - - name: Setup Poetry - run: pipx install poetry - - name: Setup python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Set up Python + uses: ./.github/actions/setup-env with: python-version: ${{ matrix.python-version }} - cache: poetry - name: Install Python dependencies run: poetry install --all-extras - name: Run twine check diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 6261002b..0a9f4e26 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -9,17 +9,14 @@ on: branches: [main] jobs: - all: + python: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Poetry - run: pipx install poetry - - name: Setup python 3.9 - uses: actions/setup-python@v5 + - name: Setup Env + uses: ./.github/actions/setup-env with: - python-version: 3.9 - cache: poetry + python-version: "3.9" # the pre-commit is hooked in as 3.9 - name: Install Python dependencies run: poetry install - name: Install pre-commit diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 75f71e21..1dfb6c71 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,14 +10,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Setup Poetry - run: pipx install poetry - - name: Setup python - uses: actions/setup-python@v5 + - uses: actions/checkout@v4 + - name: Set up Python + uses: ./.github/actions/setup-env with: python-version: "3.11" - cache: poetry - name: Install Python dependencies run: poetry install --all-extras - name: Build documentation diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 00000000..b99c3074 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,19 @@ +name: lint-pr + +on: + pull_request: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + validate: + name: validate-pull-request-title + runs-on: ubuntu-latest + steps: + - name: validate pull request title + uses: kontrolplane/pull-request-title-validator@ab2b54babb5337246f4b55cf8e0a1ecb0575e46d #v1 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..a5a9821a --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,35 @@ +name: Release Please + +on: + push: + branches: [ main ] + +jobs: + release: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.track-release.outputs.release_created }} + steps: + - uses: google-github-actions/release-please-action@v4 + id: track-release + with: + manifest-file: .github/.release-please-manifest.json + config-file: .github/release-please-config.json + publish: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + needs: + - release + if: ${{ needs.release.outputs.release_created }} + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: ./.github/actions/setup-env + - name: build package + run: poetry build + # this action uploads packages from the `dist/` directory, which poetry has built in the previous step + # usable once we set up trusted publishing, see https://docs.pypi.org/trusted-publishers/using-a-publisher/ + - name: push package + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/requirements.yml.disabled b/.github/workflows/requirements.yml.disabled deleted file mode 100644 index 72c41f30..00000000 --- a/.github/workflows/requirements.yml.disabled +++ /dev/null @@ -1,43 +0,0 @@ -name: testcontainers requirements -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - requirements: - strategy: - fail-fast: false - matrix: - runtime: - - machine: ubuntu-latest - python-version: "3.7" - - machine: ubuntu-latest - python-version: "3.8" - - machine: ubuntu-latest - python-version: "3.9" - - machine: ubuntu-latest - python-version: "3.10" - - machine: ubuntu-latest - python-version: "3.11" - - machine: windows-latest - python-version: "3.10" - - machine: macos-latest - python-version: "3.10" - runs-on: ${{ matrix.runtime.machine }} - steps: - - uses: actions/checkout@v3 - - name: Setup python ${{ matrix.runtime.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.runtime.python-version }} - - name: Update pip and install pip-tools - run: pip install --upgrade pip pip-tools - - name: Build requirements - run: pip-compile --resolver=backtracking -v --upgrade -o requirements.txt - - name: Store requirements as artifact - uses: actions/upload-artifact@v3 - with: - name: requirements-${{ matrix.runtime.machine }}-${{ matrix.runtime.python-version }}.txt - path: requirements.txt diff --git a/.github/workflows/triage-label.yml.disabled b/.github/workflows/triage-label.yml.disabled deleted file mode 100644 index a5ecf38a..00000000 --- a/.github/workflows/triage-label.yml.disabled +++ /dev/null @@ -1,12 +0,0 @@ -on: - issues: - types: - - opened -jobs: - add-label: - runs-on: ubuntu-latest - steps: - - name: Add label - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: '🔀 requires triage' diff --git a/poetry.lock b/poetry.lock index 41eda34b..5cf56c8c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3003,5 +3003,5 @@ selenium = ["selenium"] [metadata] lock-version = "2.0" -python-versions = ">=3.9,<3.12" -content-hash = "89891a5aeea49686e42fd95780d6aa703a1a13d8483a1a965aa32603b39f3a3d" +python-versions = ">=3.9,<4.0" +content-hash = "0316bbdbb2824f6086c32cb9ed00a23507896bf48494a38d086e281faf1f8189" diff --git a/pyproject.toml b/pyproject.toml index b825d8eb..2059926c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ packages = [ "Issue Tracker" = "https://github.com/testcontainers/testcontainers-python/issues" [tool.poetry.dependencies] -python = ">=3.9,<3.12" +python = ">=3.9,<4.0" docker = "*" # ">=4.0" urllib3 = "*" # "<2.0" wrapt = "*" # "^1.16.0"