-
Notifications
You must be signed in to change notification settings - Fork 22
Python312 compat #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Python312 compat #65
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ac4b289
Switch build backend to poetry-core
Joel-Pearce b192c4c
Replace deprecated inspect.getcallargs with Signature.bind
Joel-Pearce 245c0a5
Feat: Allow passing environment variables in to container
benhowes 466b8dd
Update dependency pins for Python 3.12 and pytest 8 compatibility
greatheights82 9e852ad
Regenerate poetry.lock for updated dependencies
greatheights82 109aca5
Migrate dev-dependencies to modern poetry group syntax
greatheights82 974f6bd
Update changelog for 0.7.0 release
greatheights82 df4233d
Bump mypy to >=1.0 to drop typed-ast dependency
greatheights82 596d6e4
Bump dev dependencies for Python 3.12 compatibility
greatheights82 e4b7890
update readme
greatheights82 e050a49
Fix flake8 linting
5e0c3df
Default LocalStack image to 4.13 and fix session start retries
greatheights82 8041cbe
drop 3.9 support (it's already EOL), update changelog, readme, Specif…
greatheights82 d07ed26
replace Travis with Github actions
greatheights82 8f7651a
remove 3.9 from supported versions
greatheights82 5f4c098
cache .venv and new make commands
greatheights82 5b1845d
restore 3.9 support
greatheights82 99f12de
Update pytest_localstack/constants.py
greatheights82 8bf6929
remove outdated comments, run CI pipeline on PRs to master
greatheights82 548a40b
linting
greatheights82 f4cce07
pin poetry version in ci
greatheights82 8f93237
fix black/isort conflict and lint
greatheights82 fd30bcf
add lower-bound python version to functional tests
greatheights82 296f5ee
Apply suggestion from @greatheights82
greatheights82 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,159 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint & docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| # Pin to the last release that supports Python 3.9 | ||
| version: "2.2.1" | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Cache virtualenv | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-py3.12-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: make install | ||
|
|
||
| - name: Lint | ||
| run: make lint | ||
|
|
||
| - name: Build docs | ||
| run: make docs | ||
|
|
||
| test: | ||
| name: Unit & integration (py${{ matrix.python-version }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| # Pin to the last release that supports Python 3.9 | ||
| version: "2.2.1" | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Cache virtualenv | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: make install | ||
|
|
||
| - name: Unit tests | ||
| run: make test-unit | ||
|
|
||
| - name: Integration tests | ||
| run: make test-integration | ||
|
|
||
| - name: Coverage reports | ||
| if: always() | ||
| run: make coverage-report | ||
|
|
||
| - name: Upload coverage report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-py${{ matrix.python-version }} | ||
| path: | | ||
| coverage.xml | ||
| htmlcov/ | ||
| if-no-files-found: ignore | ||
|
|
||
| functional: | ||
| name: Functional (LocalStack, py${{ matrix.python-version }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Run functional (Docker/LocalStack) tests only on the ends of the | ||
| # supported range; unit/integration cover the full matrix. | ||
| python-version: ["3.9", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| # Pin to the last release that supports Python 3.9 | ||
| version: "2.2.1" | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Cache virtualenv | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: make install | ||
|
|
||
| # Log in to Docker Hub only when credentials are configured, to avoid | ||
| # anonymous pull rate limits when pulling the LocalStack image. | ||
| # The `secrets` context cannot be used in `if:`, so it is surfaced via | ||
| # `env` first and the env var is what the condition checks. | ||
| - name: Log in to Docker Hub | ||
| if: env.DOCKERHUB_USERNAME != '' | ||
| env: | ||
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Functional tests | ||
| run: make test-functional | ||
|
|
||
| - name: Coverage reports | ||
| if: always() | ||
| run: make coverage-report | ||
|
|
||
| - name: Upload coverage report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-functional-py${{ matrix.python-version }} | ||
| path: | | ||
| coverage.xml | ||
| htmlcov/ | ||
| if-no-files-found: ignore | ||
This file contains hidden or 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,88 @@ | ||
| name: Release | ||
|
|
||
| # Publish a new version to PyPI when a version tag is pushed. | ||
| # | ||
| # git tag v0.7.0 | ||
| # git push origin v0.7.0 | ||
| # | ||
| # The tag must match the version in pyproject.toml (the "check-version" step | ||
| # enforces this). PyPI's proxy on JFrog picks the release up automatically, so | ||
| # downstream repos can then depend on the published version instead of a local | ||
| # path. | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Lint & unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install --no-interaction | ||
|
|
||
| - name: Lint | ||
| run: make lint | ||
|
|
||
| # Functional/integration tests need a Docker daemon to run LocalStack and | ||
| # are intentionally left out of the release gate to keep it fast and | ||
| # deterministic. Run them in a separate CI workflow if desired. | ||
| - name: Unit tests | ||
| run: poetry run pytest tests/unit -ra --cov=pytest_localstack | ||
|
|
||
| publish: | ||
| name: Build & publish to PyPI | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
|
|
||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/pytest-localstack | ||
| permissions: | ||
| id-token: write # required for Trusted Publishing (OIDC) | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
|
|
||
| - name: Check tag matches package version | ||
| run: | | ||
| TAG_VERSION="${GITHUB_REF_NAME#v}" | ||
| PKG_VERSION="$(poetry version -s)" | ||
| echo "Tag version: $TAG_VERSION" | ||
| echo "Package version: $PKG_VERSION" | ||
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | ||
| echo "::error::Tag $GITHUB_REF_NAME does not match pyproject version $PKG_VERSION" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build sdist and wheel | ||
| run: poetry build | ||
|
|
||
| - name: Publish to PyPI (Trusted Publishing) | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: dist/ | ||
|
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.