File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,21 +49,20 @@ jobs:
4949
5050 - name : Install dependencies
5151 run : |
52- pip install pipenv
53- pipenv requirements --dev > reqs.txt
54- pip install -r reqs.txt
52+ pip install uv
53+ uv sync --group dev
5554 - name : force right version
5655 run : |
5756 .github/change_version.py --set '${{ inputs.version }}'
5857 - name : Build
59- run : pyproject-build
58+ run : uv run pyproject-build
6059 - name : Publish
6160 env :
6261 TWINE_USERNAME : ${{ secrets.twine_username || secrets.PYPI_USERNAME }}
6362 TWINE_PASSWORD : ${{ secrets.twine_password || secrets.PYPI_TOKEN }}
6463 run : |
65- pyproject-build
66- twine upload --repository ${{ inputs.repository }} dist/*
64+ uv run pyproject-build
65+ uv run twine upload --repository ${{ inputs.repository }} dist/*
6766 - name : highlight
6867 # TODO: update package name in summary text
6968 run : |
Original file line number Diff line number Diff line change 2323
2424 - name : Install dependencies
2525 run : |
26- pip install pipenv
27- pipenv requirements --dev > reqs.txt
28- pip install -r reqs.txt
26+ pip install uv
27+ uv sync --group dev
2928
3029 - name : Lint check
3130 id : lint-check
Original file line number Diff line number Diff line change 11## Build
22
3- This project uses a ` Pipfile ` , so set up the virtualenv by running
3+ This project uses ` uv ` , so set up the virtualenv by running
44
55```
6- pipenv install --dev
6+ uv sync --group dev
77```
88
99Use ` make test ` to make sure all tests pass before pushing.
@@ -12,4 +12,4 @@ Use `make lint` to make sure lint check passes before pushing.
1212
1313## Guidelines
1414
15- ...
15+ ...
Original file line number Diff line number Diff line change @@ -4,18 +4,15 @@ FROM python:3.10-alpine AS base
44# --- builder
55FROM base AS builder
66WORKDIR /app
7- WORKDIR /
8-
9- COPY Pipfile.lock .
10- RUN pip install pipenv
11- RUN pipenv requirements > requirements.txt
12- RUN pip install --target=/app -r requirements.txt
7+ RUN pip install uv
8+ # TODO: replace with your package name
9+ COPY example /src/example
10+ COPY pyproject.toml README.md /src/
11+ RUN uv pip install --target=/app /src
1312
1413# --- main
1514FROM base
1615COPY --from=builder /app /app
1716ENV PYTHONPATH=/app
18- # TODO: replace with your package name
19- COPY example /app/example
2017
2118ENTRYPOINT ["python3" , "-m" , "example" ]
Original file line number Diff line number Diff line change 11lint :
2- ruff format
3- ruff check --fix
4- pyproject-pipenv --fix
2+ uv run ruff format
3+ uv run ruff check --fix
54
65lint-check :
7- ruff format --diff
8- ruff check
9- pyproject-pipenv
6+ uv run ruff format --diff
7+ uv run ruff check
108
119test :
1210 if [ -n " $( GITHUB_RUN_ID) " ]; then \
13- pytest --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy; \
11+ uv run pytest --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy; \
1412 else \
15- python -m pytest --cov; \
13+ uv run python -m pytest --cov; \
1614 fi
1715
1816testpub :
1917 rm -fr dist
20- pyproject-build
21- twine upload --repository testpypi dist/*
18+ uv run pyproject-build
19+ uv run twine upload --repository testpypi dist/*
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55* ` pytest ` for tests: ` make test `
66* ` ruff ` for linting/formatting: ` make lint ` (replaces both ` black ` and ` isort ` )
7- * [ pyproject-pipenv ] ( https://github.com/fopina/pyproject-pipenv ) to make sure dependencies in pyproject.toml and Pipfile are in sync
7+ * ` uv ` for dependency and virtualenv management ( ` uv sync --group dev ` )
88* ` .github ` with actions ready to be used
9- * [ test] ( .github/workflows/test.yml ) runs lint checks, unit tests and pyproject-pipenv
9+ * [ test] ( .github/workflows/test.yml ) runs lint checks and unit tests
1010 * [ publish-dev] ( .github/workflows/publish-dev.yml ) publishes feature branches (` dev ` /` dev-* ` ) to:
1111 * [ testpypi] ( https://test.pypi.org ) - more about this on [ Notes] ( #feature-branch-publishing )
1212 * docker image to ghcr.io - remove job if image makes no sense
Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ readme = "README.md"
1313requires-python = " >=3.10"
1414dependencies = []
1515
16+ [dependency-groups ]
17+ dev = [
18+ " build" ,
19+ " pytest" ,
20+ " pytest-cov" ,
21+ " pytest-socket" ,
22+ " ruff" ,
23+ " twine" ,
24+ ]
25+
1626[project .urls ]
1727# TODO: update this
1828Homepage = " https://github.com/fopina/python-package-template"
You can’t perform that action at this time.
0 commit comments