Skip to content

Commit

Permalink
Migrate to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvadm committed Oct 28, 2024
1 parent 635034c commit 67e8071
Show file tree
Hide file tree
Showing 5 changed files with 952 additions and 33 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ Candidates are links to users who have not yet explicitly added their `name` and

## Development

Local development requires a basic Python environment with [poetry](https://python-poetry.org/docs//) installed.
Local development requires a basic Python environment with [uv](https://docs.astral.sh/uv/) installed.

```bash
$ poetry install --with=dev
$ poetry run build
$ poetry run serve
$ uv sync --extra=dev
$ uv run build
$ uv run serve
```

Other commands are accessible via:

```bash
$ poetry run cli
$ uv run cli
```

Netlify build requires an updated `requirements.txt` file, if dependencies have changed, run:

```bash
$ poetry export --without-hashes --without dev -f requirements.txt -o requirements.txt
$ uv pip compile pyproject.toml -o requirements.txt
```
34 changes: 14 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
[tool.poetry]
[project]
name = "namehackclub"
version = "1.0.0"
description = "An exclusive club of geeks that own the domain hack to their name."
authors = ["Yuval Adam <[email protected]>"]
readme = "README.md"
packages = [
{ include = "cli" }
requires-python = ">=3.8"
dependencies = [
"click>=8.1.7",
"jinja2>=3.1.4",
"unidecode>=1.3.8",
"ymlstash>=1.2.1",
]

[tool.poetry.dependencies]
python = "^3.8"
jinja2 = "^3.1.4"
ymlstash = "^1.2.0"
click = "^8.1.7"
unidecode = "^1.3.8"

[tool.poetry.group.dev.dependencies]
aiohttp = "^3.9.5"
requests = "^2.31.0"
[dependency-groups]
dev = [
"aiohttp>=3.10.10",
"requests>=2.32.3",
]

[tool.poetry.scripts]
[project.scripts]
cli = "cli:cli"
build = "cli.build:build"
serve = "cli.serve:serve"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
serve = "cli.serve:serve"
21 changes: 14 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
click==8.1.7 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0"
unidecode==1.3.8 ; python_version >= "3.8" and python_version < "4.0"
ymlstash==1.2.0 ; python_version >= "3.8" and python_version < "4.0"
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.txt
click==8.1.7
# via namehackclub (pyproject.toml)
jinja2==3.1.4
# via namehackclub (pyproject.toml)
markupsafe==2.1.5
# via jinja2
pyyaml==6.0.1
# via ymlstash
unidecode==1.3.8
# via namehackclub (pyproject.toml)
ymlstash==1.2.1
# via namehackclub (pyproject.toml)
Loading

0 comments on commit 67e8071

Please sign in to comment.