Skip to content

Commit 0eef952

Browse files
committed
use uv
1 parent d3e2c33 commit 0eef952

File tree

7 files changed

+1290
-52
lines changed

7 files changed

+1290
-52
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,33 @@ jobs:
3737
uses: actions/setup-python@v5
3838
with:
3939
python-version: ${{ env.PYTHON_VERSION }}
40-
cache: pip
41-
cache-dependency-path: |
42-
requirements.txt
40+
# cache: pip
41+
# cache-dependency-path: |
42+
# requirements.txt
4343

4444
- name: Debug
4545
run: |
4646
env | sort -f
4747
ls -lart
4848
49-
- name: Get pip cache dir
50-
run: |
51-
os_version=$(cat /etc/os-release | grep -i "version=" | cut -c9- | tr -d '"' | tr ' ' '_')
52-
github_workflow_full_path="${GITHUB_WORKFLOW_REF%@*}"
53-
python_full_version=$(python -c 'import platform; print(platform.python_version())')
54-
node_major_version=$(node --version | cut -d'.' -f1 | tr -d 'v')
55-
echo "os_version=$os_version" >> $GITHUB_ENV
56-
echo "github_workflow_full_path=$github_workflow_full_path" >> $GITHUB_ENV
57-
echo "python_full_version=$python_full_version" >> $GITHUB_ENV
58-
echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
59-
60-
- name: cache pip
61-
uses: actions/cache@v4
62-
with:
63-
path: |
64-
${{ env.pythonLocation }}
65-
.cache/plugin/git-committers/
66-
key: ${{ env.github_workflow_full_path}}-${{ env.os_version }}-${{ env.python_full_version }}-${{ env.node_major_version}}-${{ hashFiles('requirements.txt') }}
49+
# - name: Get pip cache dir
50+
# run: |
51+
# os_version=$(cat /etc/os-release | grep -i "version=" | cut -c9- | tr -d '"' | tr ' ' '_')
52+
# github_workflow_full_path="${GITHUB_WORKFLOW_REF%@*}"
53+
# python_full_version=$(python -c 'import platform; print(platform.python_version())')
54+
# node_major_version=$(node --version | cut -d'.' -f1 | tr -d 'v')
55+
# echo "os_version=$os_version" >> $GITHUB_ENV
56+
# echo "github_workflow_full_path=$github_workflow_full_path" >> $GITHUB_ENV
57+
# echo "python_full_version=$python_full_version" >> $GITHUB_ENV
58+
# echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
59+
60+
# - name: cache pip
61+
# uses: actions/cache@v4
62+
# with:
63+
# path: |
64+
# ${{ env.pythonLocation }}
65+
# .cache/plugin/git-committers/
66+
# key: ${{ env.github_workflow_full_path}}-${{ env.os_version }}-${{ env.python_full_version }}-${{ env.node_major_version}}-${{ hashFiles('requirements.txt') }}
6767

6868
# - name: Set up build cache
6969
# uses: actions/cache/restore@v3
@@ -73,9 +73,24 @@ jobs:
7373
# restore-keys: |
7474
# mkdocs-material-
7575

76-
- name: Install dependencies
76+
- name: Install os dependencies
7777
run: sudo apt-get install pngquant
7878

79+
- name: Install uv
80+
uses: astral-sh/setup-uv@v6
81+
with:
82+
enable-cache: true
83+
activate-environment: true
84+
cache-dependency-glob: |
85+
pyproject.toml
86+
87+
# run: uv sync --frozen --all-extras --dev --verbose
88+
# - name: Install Requirements
89+
# run: |
90+
# uv sync --frozen --no-dev --verbose
91+
# uv pip show mkdocs
92+
# working-directory: ${{ github.workspace }}
93+
7994
- name: Install Python dependencies
8095
run: |
8196
make ci-install
@@ -97,9 +112,9 @@ jobs:
97112
98113
- name: Build documentation
99114
run: |
100-
mkdocs --version
115+
uv run mkdocs --version
101116
# https://github.com/facelessuser/pymdown-extensions/issues/2240#issuecomment-1819117598
102-
python -m mkdocs build -s
117+
uv run python -m mkdocs build -s
103118
cp ads.txt ./site/
104119
env:
105120
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GH_TOKEN_FOR_GIT_COMMITTERS }}

.github/workflows/sync-to-gitee.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0
31-
- run: |
32-
remote_repo="https://${{ vars.GITEE_USERNAME }}:${{ secrets.GITEE_PAT }}@gitee.com/${{ env.GITEE_REPOSITORY }}.git"
33-
git remote add gitee "${remote_repo}"
34-
branch=$(git branch --show-current)
35-
git push gitee $branch -f
31+
# - run: |
32+
# remote_repo="https://${{ vars.GITEE_USERNAME }}:${{ secrets.GITEE_PAT }}@gitee.com/${{ env.GITEE_REPOSITORY }}.git"
33+
# git remote add gitee "${remote_repo}"
34+
# branch=$(git branch --show-current)
35+
# git push gitee $branch -f

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ endif
1414

1515
install:
1616
@echo "${BOLD}${YELLOW}install:${NORMAL}"
17-
pipx install uv
18-
pipx upgrade uv
17+
pipx install uv --force
1918
@if [ ! -d "$(VENV_DIR)" ]; then \
20-
python3.12 -m venv $(VENV_DIR); \
19+
# python3.12 -m venv $(VENV_DIR); \
20+
uv init --no-package; \
2121
fi
22-
@. $(VENV_DIR)/bin/activate; \
23-
uv pip install -r requirements.txt
22+
# @. $(VENV_DIR)/bin/activate; \
23+
uv sync --frozen --verbose
2424

2525
build:
2626
@echo "${BOLD}${YELLOW}mkdocs build:${NORMAL}"
@@ -36,8 +36,6 @@ update-venv:
3636
uv pip install -Ur requirements.txt
3737

3838
ci-install:
39-
${PYTHON} -m pip install -U pip
40-
${PYTHON} -m pip install -U uv
41-
UV_SYSTEM_PYTHON=true uv pip install -Ur requirements.txt
42-
echo -e "\nInstalled packages:"
43-
uv pip list
39+
@echo "${BOLD}${YELLOW}ci-install:${NORMAL}"
40+
uv sync --frozen --verbose
41+
uv pip show mkdocs

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "copdips-github-io"
3+
version = "0.1.0"
4+
description = "My blog: https://copdips.com/"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"csv2md>=1.4.0",
9+
"mkdocs>=1.6.1",
10+
"mkdocs-material[git,imaging,recommended]>=9.6.15",
11+
"mkdocs-material-extensions>=1.3.1",
12+
"mkdocstrings>=0.29.1",
13+
"mkdocstrings-python>=1.16.12",
14+
"mkdocs-video>=1.5.0",
15+
"mkdocs-glightbox>=0.4.0",
16+
"mkdocs-rss-plugin>=1.17.3",
17+
"mkdocs-minify-html-plugin>=0.3.1",
18+
]
19+
20+
[dependency-groups]
21+
dev = [
22+
"ipdb>=0.13.13",
23+
"mypy>=1.17.0",
24+
"pyright>=1.1.403",
25+
"ruff>=0.12.4",
26+
"ty>=0.0.1a15",
27+
]

requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)