Skip to content

Commit

Permalink
Start using uv for python setup
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Oct 28, 2024
1 parent 7b87d51 commit 09248de
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ jobs:
sudo apt-get install libev-dev
opam pin add forester git+https://git.sr.ht/~jonsterling/ocaml-forester#56de06afe952d752c1a13fdcd8bb56c5fef9956f --yes
opam install forester --yes
- name: Install Python
uses: actions/setup-python@v5
- name: Setup Python via uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.11"
enable-cache: true
- name: Install Homebrew
run: |
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand Down
7 changes: 5 additions & 2 deletions fize.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11,<3.12"
# dependencies = []
# ///
import sys
import re

Expand Down
16 changes: 16 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,21 @@ lazyvim PROJ="forest": sync-lazyvim
#!/usr/bin/env bash
cd ~/projects/{{PROJ}} && nvim --cmd 'set runtimepath+=~/.config/lazyvim/' -u ~/.config/lazyvim/lazyvim-init.lua .
# https://github.com/astral-sh/uv

[unix]
prep-uv:
curl -LsSf https://astral.sh/uv/install.sh | sh


[windows]
prep-uv:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

prep-py:
uv python install 3.11
uv venv --python 3.11


# act:
# ./act.sh
7 changes: 5 additions & 2 deletions split_bib.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env python3
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11,<3.12"
# dependencies = ["bibtexparser"]
# ///
import json
import os
import pathlib
import shutil
import subprocess
import sys
from pathlib import Path
# pip install bibtexparser
import bibtexparser
from bibtexparser.bwriter import BibTexWriter, SortingStrategy
import re
Expand Down

0 comments on commit 09248de

Please sign in to comment.