Skip to content

Commit 9d3343c

Browse files
committed
x
1 parent b00033a commit 9d3343c

10 files changed

Lines changed: 906 additions & 580 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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: |

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
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

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

99
Use `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+
...

Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ FROM python:3.10-alpine AS base
44
# --- builder
55
FROM base AS builder
66
WORKDIR /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
1514
FROM base
1615
COPY --from=builder /app /app
1716
ENV PYTHONPATH=/app
18-
# TODO: replace with your package name
19-
COPY example /app/example
2017

2118
ENTRYPOINT ["python3", "-m", "example"]

Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
lint:
2-
ruff format
3-
ruff check --fix
4-
pyproject-pipenv --fix
2+
uv run ruff format
3+
uv run ruff check --fix
54

65
lint-check:
7-
ruff format --diff
8-
ruff check
9-
pyproject-pipenv
6+
uv run ruff format --diff
7+
uv run ruff check
108

119
test:
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

1816
testpub:
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/*

Pipfile

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

Pipfile.lock

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
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

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ readme = "README.md"
1313
requires-python = ">=3.10"
1414
dependencies = []
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
1828
Homepage = "https://github.com/fopina/python-package-template"

uv.lock

Lines changed: 871 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)