-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
References pypa#262
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
This module contains code for the "info" subcommand | ||
""" | ||
|
||
|
||
def get_version(ini_path): | ||
# type: (str) -> str | ||
""" | ||
This will return the package version as a string. | ||
:param ini_path: The filename of the main config-file | ||
(flit.ini/pyproject.toml) | ||
""" | ||
from . import inifile | ||
from .common import Module, make_metadata | ||
ini_info = inifile.read_pkg_ini(ini_path) | ||
module = Module(ini_info['module'], ini_path.parent) | ||
metadata = make_metadata(module, ini_info) | ||
output = metadata.version | ||
return output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters