Skip to content

Commit 76a5b87

Browse files
committed
move to uv
1 parent 21ba956 commit 76a5b87

File tree

9 files changed

+2075
-3211
lines changed

9 files changed

+2075
-3211
lines changed

.github/workflows/build-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- python-version: 3.14
1616
pyspark-version: 3
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v1
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
- name: Install Poetry
24-
run: pip install poetry
23+
- name: Set up uv
24+
uses: astral-sh/setup-uv@v5
2525
- name: Install Tests
2626
run: make install-all-pyspark${{ matrix.pyspark-version }}
2727
- name: Run Tests

.github/workflows/publish-to-pypi.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,29 @@ jobs:
88
publish-to-pypi:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- name: Set up Python
13-
uses: actions/setup-python@v1
13+
uses: actions/setup-python@v5
1414
with:
1515
python-version: '3.x'
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install poetry
16+
- name: Set up uv
17+
uses: astral-sh/setup-uv@v5
2018
- name: Build and publish
2119
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
20+
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
21+
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2422
run: |
25-
poetry build
26-
poetry publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
23+
uv build
24+
uv publish
2725
deploy-docs:
2826
runs-on: ubuntu-latest
2927
needs:
3028
- publish-to-pypi
3129
steps:
32-
- uses: actions/checkout@v2
33-
- uses: actions/setup-python@v2
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-python@v5
3432
with:
3533
python-version: 3.x
36-
- run: pip install poetry && make install && make install-docs && pip list
37-
- run: poetry run mkdocs gh-deploy --force
34+
- uses: astral-sh/setup-uv@v5
35+
- run: make install && make install-docs
36+
- run: uv run --group docs mkdocs gh-deploy --force

Makefile

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ clean-test: ## remove test and coverage artifacts
3535
test: ## run tests (and coverage if configured in setup.cfg) with the default Python
3636
@echo -----------------------------------------------------------------
3737
@echo RUNNING TESTS...
38-
poetry run pytest -v --cov=sparkdantic
38+
uv run --group test --extra pyspark pytest -v --cov=sparkdantic
3939
@echo ✅ Tests have passed! Nice work!
4040
@echo -----------------------------------------------------------------
4141

@@ -45,50 +45,47 @@ coverage: ## check code coverage quickly with the default Python
4545
coverage report > COVERAGE.txt
4646

4747
test-ci:
48-
poetry run pytest --cov=sparkdantic --cov-report=json
48+
uv run --group test --extra pyspark pytest --cov=sparkdantic --cov-report=json
4949

5050

5151
dist: clean ## builds source and wheel package
52-
poetry build
52+
uv build
5353
ls -l dist
5454

5555

5656
install: clean ## install the package to the active Python's site-packages via pip
57-
poetry install
57+
uv sync
5858

5959

6060
install-e: clean ## install via pip in editable mode this see https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
61-
pip install -e .
61+
uv pip install -e .
6262

6363
test-cov: test ## run tests locally and output coverage file
64-
poetry run coverage report > COVERAGE.txt
64+
uv run --group test --extra pyspark coverage report > COVERAGE.txt
6565

6666
commit-cov:
6767
git add COVERAGE.txt --force
6868

6969
install-docs:
70-
poetry install --only docs
70+
uv sync --group docs
7171

7272
install-tests:
73-
poetry install --only test
73+
uv sync --group test --extra pyspark
7474

7575
install-all-pyspark3:
76-
poetry install --with dev,test,docs
77-
poetry run pip install pyspark==3.5.5
76+
uv sync --group dev --group test --group docs --extra pyspark
77+
uv run --group dev --group test --group docs --extra pyspark pip install pyspark==3.5.5
7878

7979
install-all-pyspark4:
80-
poetry install --with dev,test,docs
81-
poetry run pip install pyspark==4.1.1
80+
uv sync --group dev --group test --group docs --extra pyspark
81+
uv run --group dev --group test --group docs --extra pyspark pip install pyspark==4.1.1
8282

8383
install-dev-local: ## install all the stuff you need to develop locally
84-
pip install --upgrade pip
85-
pip install wheel
86-
pip install -e .
87-
poetry install --with dev,test,docs -E pyspark
84+
uv sync --group dev --group test --group docs --extra pyspark
8885
pre-commit install
8986

9087
publish: dist ## publish the package to PyPI
91-
poetry publish
88+
uv publish
9289

9390
run-infra:
9491
docker-compose -f docker/dev/docker-compose.yaml up --remove-orphans -d
@@ -97,4 +94,4 @@ stop-infra:
9794
docker-compose -f docker/dev/docker-compose.yaml down
9895

9996
docs: ## generate Sphinx HTML documentation, including API docs
100-
poetry run mkdocs build
97+
uv run --group docs mkdocs build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ json_spark_schema = create_json_spark_schema(EmployeeModel)
176176
## Contributing
177177
Contributions welcome! If you would like to add a new feature / fix a bug feel free to raise a PR and tag me (`mitchelllisle`) as
178178
a reviewer. Please setup your environment locally to ensure all styling and development flow is as close to the standards set in
179-
this project as possible. To do this, the main thing you'll need is `poetry`. You should also run `make install-dev-local` which
179+
this project as possible. To do this, the main thing you'll need is `uv`. You should also run `make install-dev-local` which
180180
will install the `pre-commit-hooks` as well as install the project locally. PRs won't be accepted without sufficient tests and
181181
we will be strict on maintaining a 100% test coverage.
182182

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ StructType([
6464
## Contributing
6565
Contributions welcome! If you would like to add a new feature / fix a bug feel free to raise a PR and tag me (`mitchelllisle`) as
6666
a reviewer. Please setup your environment locally to ensure all styling and development flow is as close to the standards set in
67-
this project as possible. To do this, the main thing you'll need is `poetry`. You should also run `make install-dev-local` which
67+
this project as possible. To do this, the main thing you'll need is `uv`. You should also run `make install-dev-local` which
6868
will install the `pre-commit-hooks` as well as install the project locally. PRs won't be accepted without sufficient tests and
6969
we will be strict on maintaining a 100% test coverage.
7070

0 commit comments

Comments
 (0)