Skip to content

Commit bbed40a

Browse files
committed
Updated Hy, moved to uv and setuptools from poetry
Hy is now at 1.0.0. Also moved to uv for things like environment and dependency management. Moved the build-system to setuptools. External scripts still works (with script-files). Adding other non-python files took some coaxing, but was also doable.
1 parent 960670e commit bbed40a

10 files changed

+277
-300
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ TODO
1515
setup.py.base
1616

1717
restclient
18+
19+
/*.egg-info/
20+
/.venv/

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
graft ghdl
2+
global-exclude *.py[cod] *.swp __pycache__/*
3+
prune *.egg-info

ghdl/__init__.hy

-3
This file was deleted.

ghdl/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__version__ = "0.4.8"
2+
3+
from ghdl.main import main, set_dry, set_single

ghdl/main.hy

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
(run-filter asset-filter)))
3939

4040

41-
(defn/a add-remote-metadata [record client]
41+
(defn :async add-remote-metadata [record client]
4242
(setv record.url None)
4343

4444
(setv remote-metadata
@@ -76,18 +76,18 @@
7676
(and it (!= repo it))))
7777

7878

79-
(defn/a fetch-remote-local-metadata [records]
79+
(defn :async fetch-remote-local-metadata [records]
8080
(setv limits (httpx.Limits :max_connections 10))
81-
(with/a [client (httpx.AsyncClient :base_url "https://api.github.com/repos/"
82-
:limits limits
83-
:follow_redirects True)]
81+
(with [:async client (httpx.AsyncClient :base_url "https://api.github.com/repos/"
82+
:limits limits
83+
:follow_redirects True)]
8484
(await
8585
(asyncio.gather
8686
#*(gfor record records (fetch-remote-local-metadata-1 record client))
8787
:return_exceptions True))))
8888

8989

90-
(defn/a fetch-remote-local-metadata-1 [record client]
90+
(defn :async fetch-remote-local-metadata-1 [record client]
9191
(when (check-single record.repo) (return))
9292
(when (and record.pin (not (= (platform.machine) record.pin))) (return))
9393

ghdl/remote.hy

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(import json re dateutil.parser collections [namedtuple])
22

3-
(require hyrule [-> assoc])
3+
(import hyrule [assoc])
4+
(require hyrule [->])
45

56

67
(defclass NoMatchingReleaseException [Exception])
@@ -29,7 +30,7 @@
2930
(raise NoMatchingReleaseException))
3031

3132

32-
(defn/a get-remote [record client [token None]]
33+
(defn :async get-remote [record client [token None]]
3334
(setv headers {"Accept" "application/vnd.github.v3+json"})
3435
(setv api (get-api record))
3536
(when token (assoc headers "Authorization" f"token {token}"))
@@ -49,5 +50,5 @@
4950
urls))
5051

5152

52-
(defn/a metadata [record client [token None]]
53+
(defn :async metadata [record client [token None]]
5354
(get-metadata (await (get-remote record client token))))

poetry.lock

-262
This file was deleted.

pyproject.toml

+27-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
1-
[tool.poetry]
1+
[project]
22
name = "ghdl"
3-
version = "0.4.6"
43
description = "Binary Manager for Github Releases"
5-
authors = ["Imran Khan <[email protected]>"]
6-
license = "AGPL-3.0-or-later"
4+
authors = [{name = "Imran Khan", email = "[email protected]"}]
5+
license = {file = "LICENSE"}
6+
requires-python = ">=3.8,<3.13"
7+
dynamic = ["version"]
8+
dependencies = [
9+
"xtract ==0.1a3",
10+
"xdg >=4.0.1",
11+
"python-dateutil >=2.8.1",
12+
"docopt >=0.6.2",
13+
"python-magic >=0.4.25",
14+
"hyrule >=0.7.0",
15+
"hy >=1.0.0",
16+
"httpx >=0.27.0"
17+
]
718

8-
[tool.poetry.scripts]
9-
ghdl = { reference = "bin/ghdl", type = "file" }
10-
delete = { reference = "bin/ghdl-delete-repo", type = "file" }
19+
[tool.setuptools]
20+
script-files = ["bin/ghdl", "bin/ghdl-delete-repo"]
21+
include-package-data = true
1122

12-
[tool.poetry.dependencies]
13-
python = ">=3.8,<3.13"
14-
xtract = { version = "0.1a3", allow-prereleases = true }
15-
xdg = "^4.0.1"
16-
python-dateutil = "^2.8.1"
17-
docopt = "^0.6.2"
18-
python-magic = "^0.4.25"
19-
hyrule = "^0.5.0"
20-
hy = "^0.28.0"
21-
httpx = "^0.27.0"
23+
[tool.setuptools.dynamic]
24+
version = {attr = "ghdl.__version__"}
2225

23-
[tool.poetry.dev-dependencies]
26+
[tool.uv]
27+
prerelease = "if-necessary-or-explicit"
28+
python-downloads = "never"
29+
python-preference = "system"
30+
dev-dependencies = []
2431

2532
[build-system]
26-
requires = ["poetry>=0.12"]
27-
build-backend = "poetry.core.masonry.api"
33+
requires = ["setuptools"]
34+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)