Skip to content
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

ci: switch from poetry to uv #43

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ tasks:
then: >
cd /builds/worker/checkouts/src &&
ln -s /builds/worker/artifacts artifacts &&
pip3 install -r requirements/base.txt &&
~/.local/bin/taskgraph action-callback
else: >
cd /builds/worker/checkouts/src &&
Expand Down
2,302 changes: 0 additions & 2,302 deletions poetry.lock

This file was deleted.

74 changes: 40 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
[tool.poetry]
[project]
name = "simple-github"
version = "1.0.0"
description = "A simple Github client that only provides auth and access to the REST and GraphQL APIs."
authors = ["Mozilla Release Engineering <[email protected]>"]
version = "1.0.0"
authors = [
{ name = "Mozilla Release Engineering", email = "[email protected]"}
]
license = "MPL-2.0"
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
]
requires-python = ">=3.8"
dependencies = [
"aiohttp[speedups]~=3.8",
"gql[aiohttp,requests]~=3.4",
"pyjwt[crypto]~=2.8",
"requests~=2.31",
]

[tool.poetry.dependencies]
python = "^3.8"
gql = {extras = ["aiohttp", "requests"], version = "^3.4.1"}
requests = "^2.31.0"
aiohttp = {extras = ["speedups"], version = "^3.8.6"}
pyjwt = {extras = ["crypto"], version = "^2.8.0"}

[tool.poetry.group.test.dependencies]
coverage = "^7.3.2"
pytest = "^7.4.2"
pytest-mock = "^3.11.1"
responses = "^0.23.3"
tox = "^4.11.3"
aioresponses = "^0.7.4"
pytest-asyncio = "^0.21.1"
pytest-aioresponses = "^0.2.0"
pytest-responses = "^0.5.1"

[tool.poetry.group.docs.dependencies]
sphinx = "<7"
sphinx-autobuild = "^2021.3.14"
sphinx-book-theme = "^1.0.1"


[tool.poetry.group.taskgraph.dependencies]
taskcluster-taskgraph = "^7.0.0"

[tool.poetry.group.type.dependencies]
pyright = "^1.1.336"
[tool.uv]
dev-dependencies = [
"aioresponses~=0.7",
"coverage~=7.3",
"pytest~=7.4",
"pytest-aioresponses~=0.2",
"pytest-asyncio~=0.21",
"pytest-mock~=3.11",
"pytest-responses~=0.5",
"pyright~=1.1",
"responses~=0.23",
"sphinx<7",
"sphinx-autobuild",
"sphinx-book-theme~=1.0",
"tox~=4.11",
]

[tool.black]
line-length = 88
Expand Down Expand Up @@ -69,5 +75,5 @@ include = ["src/simple_github"]
reportUnknownParameterType = "error"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
24 changes: 8 additions & 16 deletions taskcluster/docker/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
FROM python:3.9
LABEL maintainer="Mozilla Release Engineering <[email protected]>"

VOLUME /builds/worker/checkouts
VOLUME /builds/worker/.cache

# Add worker user
RUN mkdir /builds && \
RUN mkdir -p /builds && \
useradd -d /builds/worker -s /bin/bash -m worker && \
mkdir -p /builds/worker/artifacts

Expand All @@ -19,21 +22,10 @@ ENV SHELL=/bin/bash \
HOME=/builds/worker \
PATH=/builds/worker/.local/bin:$PATH

VOLUME /builds/worker/checkouts
VOLUME /builds/worker/.cache

# pyenv
# %ARG PYENV_VERSIONS
ENV PYENV_ROOT=/builds/worker/.pyenv \
PATH=/builds/worker/.pyenv/bin:/builds/worker/.pyenv/shims:$PATH
# %include taskcluster/scripts/pyenv-setup
ADD topsrcdir/taskcluster/scripts/pyenv-setup /builds/worker/pyenv-setup
RUN /builds/worker/pyenv-setup "$PYENV_VERSIONS"

# %include taskcluster/scripts/poetry-setup
ADD topsrcdir/taskcluster/scripts/poetry-setup /builds/worker/poetry-setup
RUN /builds/worker/poetry-setup

# uv
COPY --from=ghcr.io/astral-sh/uv:0.4.9 /uv /bin/uv
# %ARG PYTHON_VERSIONS
RUN uv python install $PYTHON_VERSIONS
RUN chown -R worker:worker /builds/worker

# Set a default command useful for debugging
Expand Down
3 changes: 1 addition & 2 deletions taskcluster/kinds/codecov/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ tasks:
using: run-task
cwd: '{checkout}'
command: >-
poetry install --only test &&
poetry run python taskcluster/scripts/codecov-upload.py
uv run python taskcluster/scripts/codecov-upload.py
2 changes: 1 addition & 1 deletion taskcluster/kinds/docker-image/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ tasks:
fetch: {}
python:
args:
PYENV_VERSIONS: "3.11,3.10,3.9,3.8"
PYTHON_VERSIONS: "3.11 3.10 3.9 3.8"
6 changes: 2 additions & 4 deletions taskcluster/kinds/test/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ tasks:
TOX_PARALLEL_NO_SPINNER: "1"
run:
command: >-
poetry install --only test &&
poetry run tox --parallel
uv run tox --parallel

type-check:
description: "Run pyright type checking against code base"
worker:
max-run-time: 300
run:
command: >-
poetry install --only main --only type &&
poetry run pyright
uv run pyright
8 changes: 0 additions & 8 deletions taskcluster/scripts/poetry-setup

This file was deleted.

26 changes: 0 additions & 26 deletions taskcluster/scripts/pyenv-setup

This file was deleted.

19 changes: 8 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@
envlist = clean,py{38,39,310,311,312},report

[testenv]
allowlist_externals = poetry
allowlist_externals = uv
parallel_show_output = true
depends =
py{38,39,310,311,312}: clean
report: py{38,39,310,311,312}
commands =
poetry install --with test
poetry run python --version
poetry run coverage run --context={envname} -p -m pytest -vv {posargs}
uv run python --version
uv run coverage run --context={envname} -p -m pytest -vv {posargs}

[testenv:report]
allowlist_externals = poetry
allowlist_externals = uv
passenv = COVERAGE_REPORT_COMMAND
parallel_show_output = true
commands =
poetry install --only test
poetry run coverage combine
poetry run {env:COVERAGE_REPORT_COMMAND:coverage report}
uv run coverage combine
uv run {env:COVERAGE_REPORT_COMMAND:coverage report}

[testenv:clean]
allowlist_externals = poetry
allowlist_externals = uv
commands =
poetry install --only test
poetry run coverage erase
uv run coverage erase
Loading
Loading