Skip to content

Commit 32efe54

Browse files
committed
chore: migrate to uv package manager
Relates: #628
1 parent a3a2b4f commit 32efe54

File tree

7 files changed

+3433
-4247
lines changed

7 files changed

+3433
-4247
lines changed

.github/workflows/build_and_deploy_docs.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ jobs:
3939
with:
4040
python-version: ${{ env.PYTHON_VERSION }}
4141

42+
- name: Install uv package manager
43+
uses: astral-sh/setup-uv@v5
44+
with:
45+
python-version: ${{ env.PYTHON_VERSION }}
46+
4247
- name: Install Python dependencies
43-
run: |
44-
pipx install --python ${{ env.PYTHON_VERSION }} poetry
45-
make install-dev
48+
run: make install-dev
4649

4750
- name: Build generated API reference
4851
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
# Other Python tools
1714
.ropeproject
1815

CONTRIBUTING.md

Lines changed: 6 additions & 6 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

@@ -138,28 +138,28 @@ Publishing new versions to [PyPI](https://pypi.org/project/crawlee) is automated
138138

139139
3. Update the version number:
140140

141-
- Modify the `version` field under `tool.poetry` in `pyproject.toml`.
141+
- Modify the `version` field under `project` in `pyproject.toml`.
142142

143143
```toml
144-
[tool.poetry]
144+
[project]
145145
name = "crawlee"
146146
version = "x.z.y"
147147
```
148148

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

151151
```shell
152-
poetry build
152+
uv build
153153
```
154154

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

157157
```shell
158-
poetry config pypi-token.pypi YOUR_API_TOKEN
158+
uv config pypi-token.pypi YOUR_API_TOKEN
159159
```
160160

161161
6. Upload the package to PyPI:
162162

163163
```shell
164-
poetry publish
164+
uv publish
165165
```

Makefile

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,47 @@ clean:
77
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
88

99
install-dev:
10-
poetry install --all-extras
11-
poetry run pre-commit install
12-
poetry run playwright install
13-
poetry run python -m browserforge update
10+
uv sync --all-extras
11+
uv run pre-commit install
12+
uv run playwright install
13+
uv run python -m browserforge update
1414

1515
build:
16-
poetry build --no-interaction -vv
16+
uv build --no-cache
1717

1818
# APIFY_PYPI_TOKEN_CRAWLEE is expected to be set in the environment
1919
publish-to-pypi:
20-
poetry config pypi-token.pypi "${APIFY_PYPI_TOKEN_CRAWLEE}"
21-
poetry publish --no-interaction -vv
20+
uv publish --token "${APIFY_PYPI_TOKEN_CRAWLEE}"
2221

2322
lint:
24-
poetry run ruff format --check
25-
poetry run ruff check
23+
uv run ruff format --check
24+
uv run ruff check
2625

2726
type-check:
28-
poetry run mypy
27+
uv run mypy
2928

3029
unit-tests:
31-
poetry run pytest --numprocesses=auto --verbose --cov=src/crawlee tests/unit
30+
uv run pytest --numprocesses=auto --verbose --cov=src/crawlee tests/unit
3231

3332
unit-tests-cov:
34-
poetry run pytest --numprocesses=auto --verbose --cov=src/crawlee --cov-report=html tests/unit
33+
uv run pytest --numprocesses=auto --verbose --cov=src/crawlee --cov-report=html tests/unit
3534

3635
integration-tests:
37-
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) tests/integration
36+
uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) tests/integration
3837

3938
format:
40-
poetry run ruff check --fix
41-
poetry run ruff format
39+
uv run ruff check --fix
40+
uv run ruff format
4241

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

4746
build-api-reference:
48-
cd website && poetry run ./build_api_reference.sh
47+
cd website && uv run ./build_api_reference.sh
4948

5049
build-docs:
51-
cd website && corepack enable && yarn && poetry run yarn build
50+
cd website && corepack enable && yarn && uv run yarn build
5251

5352
run-docs: build-api-reference
54-
cd website && corepack enable && yarn && poetry run yarn start
53+
cd website && corepack enable && yarn && uv run yarn start

0 commit comments

Comments
 (0)