ghdl 0.4.3__py3-none-any.whl → 0.4.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ghdl/__init__.hy +1 -1
- ghdl/config.hy +2 -0
- ghdl/main.hy +12 -9
- ghdl/remote.hy +26 -14
- ghdl/schema.hy +0 -1
- {ghdl-0.4.3.dist-info → ghdl-0.4.5.dist-info}/METADATA +2 -2
- ghdl-0.4.5.dist-info/RECORD +15 -0
- ghdl-0.4.3.dist-info/RECORD +0 -15
- {ghdl-0.4.3.data → ghdl-0.4.5.data}/scripts/ghdl +0 -0
- {ghdl-0.4.3.data → ghdl-0.4.5.data}/scripts/ghdl-delete-repo +0 -0
- {ghdl-0.4.3.dist-info → ghdl-0.4.5.dist-info}/LICENSE +0 -0
- {ghdl-0.4.3.dist-info → ghdl-0.4.5.dist-info}/WHEEL +0 -0
- {ghdl-0.4.3.dist-info → ghdl-0.4.5.dist-info}/entry_points.txt +0 -0
ghdl/__init__.hy
CHANGED
ghdl/config.hy
CHANGED
ghdl/main.hy
CHANGED
|
@@ -39,15 +39,17 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
(defn/a add-remote-metadata [record client]
|
|
42
|
-
(setv
|
|
43
|
-
(await (remote.metadata record.repo record.pre-release? client Config.token)))
|
|
42
|
+
(setv record.url None)
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
(setv remote-metadata
|
|
45
|
+
(try
|
|
46
|
+
(await (remote.metadata record client Config.token))
|
|
47
|
+
(except [e []]
|
|
48
|
+
(print f"Failed to fetch remote data from Github API for {record.repo}")
|
|
49
|
+
(print (traceback.format_exc))
|
|
50
|
+
(setv record.toUpdate? False)
|
|
51
|
+
(.append Config.failures #(record.repo "Network"))
|
|
52
|
+
(return))))
|
|
51
53
|
|
|
52
54
|
(setv record.tag remote-metadata.tag)
|
|
53
55
|
(setv record.timestamp remote-metadata.timestamp)
|
|
@@ -56,7 +58,6 @@
|
|
|
56
58
|
(if (not dl-url)
|
|
57
59
|
(do
|
|
58
60
|
(setv record.toUpdate? False)
|
|
59
|
-
(setv record.url "N/A")
|
|
60
61
|
(.append Config.failures #(record.repo "No Matching URL"))
|
|
61
62
|
(return))
|
|
62
63
|
(setv record.url dl-url)))
|
|
@@ -109,6 +110,8 @@
|
|
|
109
110
|
|
|
110
111
|
|
|
111
112
|
(defn process [record]
|
|
113
|
+
(unless record.toUpdate? (return))
|
|
114
|
+
|
|
112
115
|
(with [(utils.Tempdir)]
|
|
113
116
|
(setv filename (-> record.url (.split "/") (get -1)))
|
|
114
117
|
(utils.download_file record.url filename)
|
ghdl/remote.hy
CHANGED
|
@@ -1,27 +1,43 @@
|
|
|
1
|
-
(import json dateutil.parser collections [namedtuple])
|
|
1
|
+
(import json re dateutil.parser collections [namedtuple])
|
|
2
2
|
|
|
3
3
|
(require hyrule [-> assoc])
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
(defclass NoMatchingReleaseException [Exception])
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
(setv Remote (namedtuple "Record" '("tag" "timestamp" "url_data")))
|
|
7
10
|
|
|
8
11
|
|
|
9
|
-
(defn get-api [
|
|
10
|
-
(if pre-release?
|
|
11
|
-
f"{repo}/releases"
|
|
12
|
-
f"{repo}/releases/latest"))
|
|
12
|
+
(defn get-api [record]
|
|
13
|
+
(if (or record.pre-release? record.release-filter)
|
|
14
|
+
f"{record.repo}/releases"
|
|
15
|
+
f"{record.repo}/releases/latest"))
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
(defn to-unix [timestring]
|
|
16
19
|
(-> timestring (dateutil.parser.parse) (.strftime "%s") (int)))
|
|
17
20
|
|
|
18
21
|
|
|
19
|
-
(defn
|
|
22
|
+
(defn find-matching-release [resp release-filter]
|
|
23
|
+
(for [release resp]
|
|
24
|
+
(setv name (get release "name"))
|
|
25
|
+
(setv pattern (re.compile release-filter))
|
|
26
|
+
(when (bool (re.search pattern name))
|
|
27
|
+
(return release)))
|
|
28
|
+
(print f"No matching release found for: {release-filter}")
|
|
29
|
+
(raise NoMatchingReleaseException))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
(defn/a get-remote [record client [token None]]
|
|
20
33
|
(setv headers {"Accept" "application/vnd.github.v3+json"})
|
|
21
|
-
(setv api (get-api
|
|
34
|
+
(setv api (get-api record))
|
|
22
35
|
(when token (assoc headers "Authorization" f"token {token}"))
|
|
23
36
|
(setv resp (.json (await (client.get api :headers headers))))
|
|
24
|
-
(
|
|
37
|
+
(cond
|
|
38
|
+
record.pre-release? (get resp 0)
|
|
39
|
+
record.release-filter (find-matching-release resp record.release-filter)
|
|
40
|
+
True resp))
|
|
25
41
|
|
|
26
42
|
|
|
27
43
|
(defn get-metadata [resp]
|
|
@@ -33,9 +49,5 @@
|
|
|
33
49
|
urls))
|
|
34
50
|
|
|
35
51
|
|
|
36
|
-
(defn/a metadata [
|
|
37
|
-
(
|
|
38
|
-
(get-metadata (await (get-remote repo pre-release? client token)))
|
|
39
|
-
(except []
|
|
40
|
-
(print f"Error fetching metadata from Github API for {repo}")
|
|
41
|
-
None)))
|
|
52
|
+
(defn/a metadata [record client [token None]]
|
|
53
|
+
(get-metadata (await (get-remote record client token))))
|
ghdl/schema.hy
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ghdl/__init__.hy,sha256=7mGs5XU5_1xLXP6zvIhyb22zkkfwWrWfr3-BV73bRt8,73
|
|
2
|
+
ghdl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
ghdl/config.hy,sha256=KeBgBXwoSmkQdDUmjSFcvfdxPdjac40HhDu7DvTfMBg,1568
|
|
4
|
+
ghdl/local.hy,sha256=1StKPJ-l3mo6QdtaYfwL9FvZK97MdYIHrRRSF6S06OU,1687
|
|
5
|
+
ghdl/main.hy,sha256=pRXjafNHX1k0e5lOuqPDdOMgnsta9MgUPcBH7vuAaKc,4603
|
|
6
|
+
ghdl/remote.hy,sha256=P2bFoPSzqUtItNN6nySo18Noh6PuOPNBfBkFBwPH-rA,1542
|
|
7
|
+
ghdl/schema.hy,sha256=sXKjpaBVzBAPAx8Ko3RbCJB2GGbE5pilx-E3gVHtFMY,708
|
|
8
|
+
ghdl/utils.hy,sha256=DZpjuemTpuyex-2ShLRyNxMzMKPM0jia9CCnqMdizfA,1604
|
|
9
|
+
ghdl-0.4.5.data/scripts/ghdl,sha256=KET7_ExHWZlIZZFaLSvdcpU1elvBsB0onEoxDIrDOew,613
|
|
10
|
+
ghdl-0.4.5.data/scripts/ghdl-delete-repo,sha256=b2X42MFFmvvJ6ldLAHyrcCkI5LB40Tuefbc3FMAtu54,92
|
|
11
|
+
ghdl-0.4.5.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
12
|
+
ghdl-0.4.5.dist-info/METADATA,sha256=JmBDbSjnc7rkZiy6hKN-yBhoTYbbYLsMdPEJK4blQ00,858
|
|
13
|
+
ghdl-0.4.5.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
14
|
+
ghdl-0.4.5.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
ghdl-0.4.5.dist-info/RECORD,,
|
ghdl-0.4.3.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
ghdl/__init__.hy,sha256=u7iXOSN0Q0cw0kPnzbnRBOlrhnFgpB9jVSdDkSqKOVk,73
|
|
2
|
-
ghdl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
ghdl/config.hy,sha256=akTdvN_kxIG-wVTU4LuTbY-MvlMJVONkFvUmZyZxWW8,1502
|
|
4
|
-
ghdl/local.hy,sha256=1StKPJ-l3mo6QdtaYfwL9FvZK97MdYIHrRRSF6S06OU,1687
|
|
5
|
-
ghdl/main.hy,sha256=U24572W-hYgb52G_uxx3o7tw0euCPpAAiGVjgsgeP3E,4468
|
|
6
|
-
ghdl/remote.hy,sha256=8wZ6_2ePBy43rYzZjFFl9u2eHl4m9hIzB1up3apvGjA,1185
|
|
7
|
-
ghdl/schema.hy,sha256=SMmnASwBx3aNWVSJmQMFm-HUu_Yo9nI4If-v6gT2uGc,752
|
|
8
|
-
ghdl/utils.hy,sha256=DZpjuemTpuyex-2ShLRyNxMzMKPM0jia9CCnqMdizfA,1604
|
|
9
|
-
ghdl-0.4.3.data/scripts/ghdl,sha256=KET7_ExHWZlIZZFaLSvdcpU1elvBsB0onEoxDIrDOew,613
|
|
10
|
-
ghdl-0.4.3.data/scripts/ghdl-delete-repo,sha256=b2X42MFFmvvJ6ldLAHyrcCkI5LB40Tuefbc3FMAtu54,92
|
|
11
|
-
ghdl-0.4.3.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
12
|
-
ghdl-0.4.3.dist-info/METADATA,sha256=2jJl0ccbhSAllD3ha3Kl8kWxJB1DYa2kmo4UvHchPA8,867
|
|
13
|
-
ghdl-0.4.3.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
14
|
-
ghdl-0.4.3.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
ghdl-0.4.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|