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
8 changes: 3 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ARG VARIANT="3"
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}

ARG NODE_VERSION="24"
ARG POETRY_VERSION="1.8.2"
ARG POETRY_SRC="https://install.python-poetry.org"
ARG UV_VERSION="0.8.17"
ARG UV_SRC="https://astral.sh/uv"

# https://github.com/microsoft/vscode-dev-containers/blob/main/containers/go/.devcontainer/base.Dockerfile
ENV USERNAME=vscode
Expand All @@ -25,9 +25,7 @@ RUN apt-get update -y \
USER vscode
WORKDIR /home/vscode

RUN curl -fsSL -o install-poetry.py "${POETRY_SRC}" \
&& python install-poetry.py --version $POETRY_VERSION \
&& rm install-poetry.py
RUN curl -fsSL "${UV_SRC}/${UV_VERSION}/install.sh" | sh

RUN mkdir -p .config/git \
&& echo ".vscode/*" >> .config/git/ignore \
Expand Down
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"dockerfile": "Dockerfile",
"args": {
"NODE_VERSION": "24",
"POETRY_VERSION": "1.8.2",
"UV_VERSION": "0.8.17",
"VARIANT": "3.12"
}
},
"remoteEnv": {
"POETRY_VIRTUALENVS_IN_PROJECT": "true",
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
},
"extensions": [
Expand All @@ -19,6 +18,6 @@
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode"
],
"postCreateCommand": "poetry install && npm install",
"postCreateCommand": "uv sync && npm install",
"remoteUser": "vscode"
}
40 changes: 5 additions & 35 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ inputs:
description: The Python version.
required: false
default: '3.12'
poetry_version:
description: The Poetry version.
required: false
default: '1.8.2'
just_version:
description: The just version.
required: false
Expand All @@ -23,46 +19,20 @@ inputs:
runs:
using: composite
steps:
- name: Setup Poetry cache on Linux
uses: actions/cache@v4
if: runner.os == 'Linux'
with:
key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }}
path: |
~/.local/bin
~/.local/share/pypoetry
- name: Setup Poetry cache on macOS
uses: actions/cache@v4
if: runner.os == 'macOS'
with:
key: poetry-${{ inputs.poetry_version }}-${{ inputs.python_version }}-${{ runner.os }}-${{ runner.arch }}
path: |
~/.local/bin
~/.local/share/pypoetry
~/Library/Application Support/pypoetry
- name: Setup just
uses: extractions/setup-just@v4
with:
just-version: ${{ inputs.just_version }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Setup Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ inputs.poetry_version }}
- name: Setup Python with cache
uses: actions/setup-python@v5
if: inputs.install_dependencies == 'true'
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
cache: poetry
python-version: ${{ inputs.python_version }}
enable-cache: true
- name: Check lockfile
if: inputs.install_dependencies == 'true'
shell: bash
run: poetry check --lock
run: uv lock --check
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: poetry install --sync
run: uv sync
5 changes: 2 additions & 3 deletions .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
name: ${{ inputs.artifact_name }}
path: dist/
- name: Publish
run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD
run: uv publish --check-url https://pypi.org/simple/
env:
USERNAME: __token__
PASSWORD: ${{ secrets.registry_token }}
UV_PUBLISH_TOKEN: ${{ secrets.registry_token }}
6 changes: 3 additions & 3 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
uses: ./.github/actions/setup-node
with:
install_dependencies: 'false'
- name: Normalize poetry.lock
run: poetry lock --no-update
- name: Normalize uv.lock
run: uv lock
- name: Normalize package-lock.json
run: npm install
- name: Install dependencies
run: poetry install --sync
run: uv sync
- name: Generate code
run: npm run generate
- name: Commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: ./.github/actions/setup
- name: Cut ${{ github.event.inputs.version }} version
run: |
poetry version "${{ github.event.inputs.version }}"
uv version "${{ github.event.inputs.version }}"
just version
- name: Record prerelease channel
env:
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# uv
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# https://docs.astral.sh/uv/concepts/projects/sync/#checking-the-lockfile
#uv.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Quickstart

$ git clone https://github.com/seamapi/python.git
$ cd python
$ poetry install
$ uv sync

Run each command below in a separate terminal window:

Expand All @@ -521,19 +521,19 @@ Clone the project with
Requirements
~~~~~~~~~~~~

You will need `Python 3`_ and Poetry_ and Node.js_ with npm_ and just_.
You will need `Python 3`_ and uv_ and Node.js_ with npm_ and just_.

Install the development dependencies with

::

$ poetry install
$ uv sync
$ npm install

.. _just: https://just.systems/
.. _Node.js: https://nodejs.org/
.. _npm: https://www.npmjs.com/
.. _Poetry: https://poetry.eustace.io/
.. _uv: https://docs.astral.sh/uv/
.. _Python 3: https://www.python.org/

Tests
Expand Down Expand Up @@ -561,7 +561,7 @@ Run tests on changes with
Publishing
~~~~~~~~~~

New versions are created with `poetry version`_.
New versions are created with `uv version`_.

Automatic
^^^^^^^^^
Expand All @@ -576,15 +576,15 @@ Manual
^^^^^^

Publish a new version by triggering a `version workflow_dispatch on GitHub Actions`_.
The ``version`` input will be passed as the first argument to `poetry version`_.
The ``version`` input will be passed as the first argument to `uv version`_.

This may be done on the web or using the `GitHub CLI`_ with

::

$ gh workflow run version.yml --raw-field version=<version>

.. _Poetry version: https://python-poetry.org/docs/cli/#version
.. _uv version: https://docs.astral.sh/uv/reference/cli/#uv-version
.. _GitHub CLI: https://cli.github.com/
.. _version workflow_dispatch on GitHub Actions: https://github.com/seamapi/python/actions?query=workflow%3Aversion

Expand Down
22 changes: 11 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ default: build

@build:
rm -rf dist
poetry build
uv build

@format:
poetry run black .
uv run black .

@lint:
poetry run pylint ./seam ./test
poetry run black --check .
poetry run rstcheck README.rst
poetry run mypy seam/resources --disable-error-code=arg-type --disable-error-code=import-not-found
uv run pylint ./seam ./test
uv run black --check .
uv run rstcheck README.rst
uv run mypy seam/resources --disable-error-code=arg-type --disable-error-code=import-not-found

@test:
poetry run pytest --cov=./seam
uv run pytest --cov=./seam

@watch:
poetry run ptw
uv run ptw

@version:
git add pyproject.toml
git commit -m "$(poetry version -s)"
git tag --sign "v$(poetry version -s)" -m "$(poetry version -s)"
git add pyproject.toml uv.lock
git commit -m "$(uv version --short)"
git tag --sign "v$(uv version --short)" -m "$(uv version --short)"
git push --follow-tags
Loading
Loading