File tree 4 files changed +21
-1
lines changed 4 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
<h1 align =" center " >
2
- <img src =" doc/logo.svg " ><br >
2
+ <img src =" https://raw.githubusercontent.com/nathanjmcdougall/usethis-python/refs/heads/main/ doc/logo.svg" ><br >
3
3
</h1 >
4
4
5
5
# usethis
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ source = "vcs"
70
70
"Releases" = " https://github.com/nathanjmcdougall/usethis-python/releases"
71
71
"Source Archive" = " https://github.com/nathanjmcdougall/usethis-python/archive/{commit_hash}.zip"
72
72
73
+ [tool .hatch .build .hooks .vcs ]
74
+ version-file = " src/usethis/_version.py"
75
+
73
76
[tool .ruff ]
74
77
line-length = 88
75
78
@@ -144,6 +147,7 @@ layers = [
144
147
]
145
148
containers = [ " usethis" ]
146
149
exhaustive = true
150
+ exhaustive_ignores = [ " _version" ]
147
151
148
152
[[tool .importlinter .contracts ]]
149
153
name = " Integrations Modular Design"
Original file line number Diff line number Diff line change
1
+ _version.py
Original file line number Diff line number Diff line change
1
+ import sys
2
+
1
3
import typer
2
4
3
5
import usethis ._interface .badge
10
12
from usethis ._core .readme import add_readme
11
13
from usethis ._tool import PreCommitTool , RuffTool
12
14
15
+ try :
16
+ from usethis ._version import __version__
17
+ except ImportError :
18
+ __version__ = None
19
+
13
20
app = typer .Typer (
14
21
help = (
15
22
"Automate Python package and project setup tasks that are otherwise "
@@ -39,6 +46,14 @@ def readme(
39
46
add_pre_commit_badge ()
40
47
41
48
49
+ @app .command (help = "Display the version of usethis." )
50
+ def version () -> None :
51
+ if __version__ is not None :
52
+ print (__version__ )
53
+ else :
54
+ sys .exit (1 )
55
+
56
+
42
57
app (prog_name = "usethis" )
43
58
44
59
You can’t perform that action at this time.
0 commit comments