Skip to content

Commit

Permalink
Migrate to uv, Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanC committed Aug 25, 2024
1 parent 9841e43 commit f232827
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 434 deletions.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci

on:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- id: repository
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.event.repository.name }}
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.repository.outputs.lowercase }}:latest
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
repository: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.repository.outputs.lowercase }}
short-description: ${{ github.event.repository.description }}
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml

This file was deleted.

17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
FROM python:3.12.3-slim-bullseye
FROM python:3.12-slim-bookworm

WORKDIR /bluebird

# Install and configure Poetry
# https://github.com/python-poetry/poetry
RUN pip install poetry
RUN poetry config virtualenvs.create false

# Install dependencies
COPY pyproject.toml pyproject.toml
RUN poetry install --no-root

COPY . .

CMD [ "python", "bluebird.py" ]
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
RUN uv sync --frozen

CMD [ "uv", "run", "bluebird.py" ]
366 changes: 0 additions & 366 deletions poetry.lock

This file was deleted.

34 changes: 17 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[tool.poetry]
[project]
name = "bluebird"
version = "1.0.0"
version = "1.1.0"
description = "Monitor users on X and report new posts via Discord."
authors = ["EthanC <[email protected]>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
python-dotenv = "^1.0.1"
loguru = "^0.7.2"
loguru-discord = "^1.2.2"
httpx = "^0.27.0"
discord-webhook = "^1.3.1"

[tool.poetry.group.dev.dependencies]
ruff = "^0.4.4"
requires-python = ">=3.12"
dependencies = [
"python-dotenv>=1.0.1",
"loguru>=0.7.2",
"loguru-discord>=1.3.1",
"httpx>=0.27.0",
"discord-webhook>=1.3.1",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = [
"ruff>=0.6.2",
]

[tool.ruff.lint]
select = ["I"]
Loading

0 comments on commit f232827

Please sign in to comment.