-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move version into nethsm/__init__.py To make it possible to use `pip install .`, we have to change `__init__.py` so that it is possible to determine the version with static analysis. See this issue for more context: #33 * ci: Add clean-install job This patch adds a clean-install job to the CI that makes sure that installing the package with pip and using it works, i. e. we did not forget to specify a required dependency. * Add missing certifi dependency This patch adds certifi as a required dependency. Previously, we did not notice it was missing as it was installed together with flit in the CI and development setup. Fixes: #33
- Loading branch information
1 parent
1bc938a
commit bd090a7
Showing
7 changed files
with
49 additions
and
13 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
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,26 @@ | ||
import ast | ||
|
||
filename = "nethsm/__init__.py" | ||
with open(filename) as f: | ||
data = f.read() | ||
module = ast.parse(data, filename) | ||
assert isinstance(module, ast.Module) | ||
|
||
values = [] | ||
for stmt in module.body: | ||
if not isinstance(stmt, ast.Assign): | ||
continue | ||
|
||
is_version = False | ||
for target in stmt.targets: | ||
if isinstance(target, ast.Name): | ||
if target.id == "__version__": | ||
is_version = True | ||
if not is_version: | ||
continue | ||
|
||
assert isinstance(stmt.value, ast.Constant) | ||
values.append(stmt.value) | ||
|
||
assert len(values) == 1 | ||
print(values[0].value) |
This file was deleted.
Oops, something went wrong.
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