File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ The "installation":
1818
1919* Add the ` _version.py ` to the root of your library (next to the ` __init__.py ` ).
2020* Set the project name and ` __version__ ` string.
21- * In your ` __init__.py ` , use ` from _version import __version__, version_info ` .
21+ * In your ` __init__.py ` , use ` from . _version import __version__, version_info ` .
2222* In ` pyproject.toml ` use ` dynamic = ["version"] ` .
2323* The Flit build tool will now detect your project version. Other tools may
2424 need an extra line, e.g. ` [tool.hatch.version] ` ` path = "lib_name/_version.py" ` .
Original file line number Diff line number Diff line change 11"""
2- _version.py v1.2
2+ _version.py v1.3
33
44Simple version string management, using a hard-coded version string
55for simplicity and compatibility, while adding git info at runtime.
3030logger = logging .getLogger (project_name )
3131
3232# Get whether this is a repo. If so, repo_dir is the path, otherwise None.
33+ # .git is a dir in a normal repo and a file when in a submodule.
3334repo_dir = Path (__file__ ).parents [1 ]
34- repo_dir = repo_dir if repo_dir .joinpath (".git" ).is_dir () else None
35+ repo_dir = repo_dir if repo_dir .joinpath (".git" ).exists () else None
3536
3637
3738def get_version ():
You can’t perform that action at this time.
0 commit comments