Skip to content

Commit

Permalink
Switch to UV
Browse files Browse the repository at this point in the history
  • Loading branch information
anze3db committed Sep 15, 2024
1 parent 71e5024 commit b094328
Show file tree
Hide file tree
Showing 5 changed files with 887 additions and 207 deletions.
48 changes: 21 additions & 27 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,33 @@ on:

jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.12"]
runs-on: ubuntu-latest
env:
DATABASE_URL: sqlite://
SECRET_KEY: something_very_secret
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install pip-tools && pip-sync requirements.txt
enable-cache: true
version: "latest"
- name: Collect static
run: python manage.py collectstatic --no-input
run: uv run python manage.py collectstatic --no-input
- name: Run Tests
run: pytest
env:
FLAKYTEST_SECRET_TOKEN: ${{ secrets.FLAKYTEST_SECRET_TOKEN }}
deploy:
runs-on: ubuntu-22.04
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
bash projects/surfcamsapi/update.sh
run: uv run pytest
# deploy:
# runs-on: ubuntu-latest
# needs: test
# if: github.ref == 'refs/heads/main'
# steps:
# - name: Deploy
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# bash projects/surfcamsapi/.deploy/update.sh

29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
[project]
name = "surfcamsapi"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"django",
"django-admin-sortable2",
"django-environ",
"django-ninja",
"django-tui",
"gunicorn",
"httpx",
"sentry-sdk",
"stamina",
"uvicorn",
"whitenoise",
]

[tool.uv]
dev-dependencies = [
"djlint",
"flakytest",
"ruff",
"pytest",
"pytest-django",
]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--verbose --reuse-db --durations=3"
Expand Down
17 changes: 0 additions & 17 deletions requirements.in

This file was deleted.

163 changes: 0 additions & 163 deletions requirements.txt

This file was deleted.

Loading

0 comments on commit b094328

Please sign in to comment.