Skip to content

Commit 40ce170

Browse files
committed
chore: migrate to uv package manager
1 parent b9a0cfd commit 40ce170

File tree

7 files changed

+3059
-3919
lines changed

7 files changed

+3059
-3919
lines changed

.github/workflows/build_and_deploy_docs.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ jobs:
5454
with:
5555
python-version: ${{ env.PYTHON_VERSION }}
5656

57+
- name: Install uv package manager
58+
uses: astral-sh/setup-uv@v5
59+
with:
60+
python-version: ${{ env.PYTHON_VERSION }}
61+
5762
- name: Install Python dependencies
58-
run: |
59-
pipx install --python ${{ env.PYTHON_VERSION }} poetry
60-
make install-dev
63+
run: make install-dev
6164

6265
- name: Build generated API reference
6366
run: make build-api-reference

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ __pycache__
1010
.envrc
1111
.python-version
1212

13-
# Poetry
14-
poetry.toml
15-
1613
# Mise
1714
mise.toml
1815
.mise.toml

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Here you'll find a contributing guide to get started with development.
66

77
For local development, it is required to have Python 3.9 (or a later version) installed.
88

9-
We use [Poetry](https://python-poetry.org/) for project management. Install it and set up your IDE accordingly.
9+
We use [uv](https://docs.astral.sh/uv/) for project management. Install it and set up your IDE accordingly.
1010

1111
## Dependencies
1212

@@ -134,33 +134,33 @@ Publishing new versions to [PyPI](https://pypi.org/project/apify) is automated t
134134

135135
### Publishing to PyPI manually
136136

137-
1. **Do not do this unless absolutely necessary.** In all conceivable scenarios, you should use the `release` workflow instead.
137+
1. **Do not do this unless absolutely necessary.** In all conceivable scenarios, you should use the `run_release` workflow instead.
138138
2. **Make sure you know what you're doing.**
139139

140140
3. Update the version number:
141141

142-
- Modify the `version` field under `tool.poetry` in `pyproject.toml`.
142+
- Modify the `version` field under `project` in `pyproject.toml`.
143143

144144
```toml
145-
[tool.poetry]
146-
name = "apify"
145+
[project]
146+
name = "crawlee"
147147
version = "x.z.y"
148148
```
149149

150150
4. Generate the distribution archives for the package:
151151

152152
```shell
153-
poetry build
153+
uv build
154154
```
155155

156156
5. Set up the PyPI API token for authentication:
157157

158158
```shell
159-
poetry config pypi-token.pypi YOUR_API_TOKEN
159+
uv config pypi-token.pypi YOUR_API_TOKEN
160160
```
161161

162162
6. Upload the package to PyPI:
163163

164164
```shell
165-
poetry publish
165+
uv publish
166166
```

Makefile

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \
2-
integration-tests format check-code build-api-reference build-docs run-docs
1+
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov integration-tests format check-code build-api-reference run-docs
32

43
# This is default for local testing, but GitHub workflows override it to a higher value in CI
54
INTEGRATION_TESTS_CONCURRENCY = 1
@@ -8,46 +7,45 @@ clean:
87
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
98

109
install-dev:
11-
poetry install --all-extras
12-
poetry run pre-commit install
10+
uv sync --all-extras
11+
uv run pre-commit install
1312

1413
build:
15-
poetry build --no-interaction -vv
14+
uv build --no-cache
1615

1716
# APIFY_PYPI_TOKEN_CRAWLEE is expected to be set in the environment
1817
publish-to-pypi:
19-
poetry config pypi-token.pypi "${APIFY_PYPI_TOKEN_CRAWLEE}"
20-
poetry publish --no-interaction -vv
18+
uv publish --token "${APIFY_PYPI_TOKEN_CRAWLEE}"
2119

2220
lint:
23-
poetry run ruff format --check
24-
poetry run ruff check
21+
uv run ruff format --check
22+
uv run ruff check
2523

2624
type-check:
27-
poetry run mypy
25+
uv run mypy
2826

2927
unit-tests:
30-
poetry run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit
28+
uv run pytest --numprocesses=auto --verbose --cov=src/crawlee tests/unit
3129

3230
unit-tests-cov:
33-
poetry run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=html tests/unit
31+
uv run pytest --numprocesses=auto --verbose --cov=src/crawlee --cov-report=html tests/unit
3432

3533
integration-tests:
36-
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration
34+
uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) tests/integration
3735

3836
format:
39-
poetry run ruff check --fix
40-
poetry run ruff format
37+
uv run ruff check --fix
38+
uv run ruff format
4139

4240
# The check-code target runs a series of checks equivalent to those performed by pre-commit hooks
4341
# and the run_checks.yaml GitHub Actions workflow.
4442
check-code: lint type-check unit-tests
4543

4644
build-api-reference:
47-
cd website && poetry run ./build_api_reference.sh
45+
cd website && uv run ./build_api_reference.sh
4846

4947
build-docs:
50-
cd website && poetry run npm clean-install && poetry run npm run build
48+
cd website && corepack enable && yarn && uv run yarn build
5149

5250
run-docs: build-api-reference
53-
cd website && poetry run npm clean-install && poetry run npm run start
51+
cd website && corepack enable && yarn && uv run yarn start

0 commit comments

Comments
 (0)