Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
poetry-version: '2.1.4'

- name: Setup a local virtual environment
run: |
poetry env use ${{ steps.setup-python.outputs.python-path }}
poetry run python --version
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
enable-cache: true

- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
id: cache
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || (echo "Cache is broken, skip it" && rm -rf .venv)
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}

- name: Install dependencies
run: poetry install -E crypto
run: uv sync --extra crypto --extra dev
- name: Generate rest sync code and tests
run: poetry run unasync
run: uv run unasync
- name: Test with pytest
run: poetry run pytest --verbose --tb=short --reruns 3
run: uv run pytest --verbose --tb=short --reruns 3
24 changes: 6 additions & 18 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,19 @@ jobs:
with:
python-version: '3.9'

- name: Setup poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
poetry-version: '2.1.4'

- name: Setup a local virtual environment
run: |
poetry env use ${{ steps.setup-python.outputs.python-path }}
poetry run python --version
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
enable-cache: true

- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
id: cache
with:
path: ./.venv
key: venv-${{ runner.os }}-3.9-${{ hashFiles('poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || (echo "Cache is broken, skip it." && rm -rf .venv)
key: venv-${{ runner.os }}-3.9-${{ hashFiles('uv.lock') }}

- name: Install dependencies
run: poetry install
run: uv sync --extra dev
- name: Lint with flake8
run: poetry run flake8
run: uv run flake8
28 changes: 8 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,24 @@ jobs:
with:
python-version: 3.12

- name: Setup poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
poetry-version: '1.8.5'

- name: Setup a local virtual environment
run: |
poetry env use ${{ steps.setup-python.outputs.python-path }}
poetry run python --version
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
enable-cache: true

- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
id: cache
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || (echo "Cache is broken, skip it" && rm -rf .venv)
key: venv-${{ runner.os }}-3.12-${{ hashFiles('uv.lock') }}

- name: Install dependencies
run: poetry install -E crypto
run: uv sync --extra crypto --extra dev
- name: Generate rest sync code and tests
run: poetry run unasync
run: uv run unasync
- name: Build a binary wheel and a source tarball
run: poetry build
run: uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -144,4 +132,4 @@ jobs:
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

### Initialising

ably-python uses [Poetry](https://python-poetry.org/) for packaging and dependency management. Please refer to the [Poetry documentation](https://python-poetry.org/docs/#installation) for up to date instructions on how to install Poetry.
ably-python uses [uv](https://docs.astral.sh/uv/) for packaging and dependency management. Please refer to the [uv documentation](https://docs.astral.sh/uv/getting-started/installation/) for up to date instructions on how to install uv.

Perform the following operations after cloning the repository contents:

```shell
git submodule init
git submodule update
# Install the crypto extra if you wish to be able to run all of the tests
poetry install -E crypto
uv sync --extra crypto
```

### Running the test suite

```shell
poetry run pytest
uv run pytest
```

## Release Process
Expand Down
Loading
Loading