-
Notifications
You must be signed in to change notification settings - Fork 0
chore: CI improvements #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e46bdf2
f2d56d3
8534a7f
08dba58
e03a6cf
2f4b384
b450223
f569857
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| ".": "0.3.1", | ||
| "otdf-python-proto": "0.3.1" | ||
| ".": "0.3.2", | ||
| "otdf-python-proto": "0.3.2" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |||||
| and other OpenTDF services. | ||||||
| """ | ||||||
|
|
||||||
| __version__ = "0.3.1" | ||||||
| __version__ = "0.3.2" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding the version number here can lead to it becoming out of sync with the version in
Suggested change
|
||||||
|
|
||||||
| # Import submodules to make them available | ||||||
| from . import authorization | ||||||
|
|
||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |||||||||
|
|
||||||||||
|
|
||||||||||
| # Version - get from project metadata | ||||||||||
| __version__ = "0.3.0" | ||||||||||
| __version__ = "0.3.2" | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding the version number here can lead to it becoming out of sync with the version in
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To avoid manually updating the version string in multiple places, you can read it dynamically from the package metadata using You'll need to add
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| # Set up logging | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,20 @@ def test_cli_version(): | |
| ) | ||
| assert result.returncode == 0 | ||
| assert "OpenTDF Python SDK" in result.stdout | ||
| assert "0.3.0" in result.stdout | ||
|
|
||
| with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as f: | ||
| # Use tomli for Python < 3.11, tomllib for 3.11+ | ||
| if sys.version_info < (3, 11): | ||
| import tomli | ||
|
|
||
| pyproject = tomli.load(f) | ||
| else: | ||
| import tomllib | ||
|
|
||
| pyproject = tomllib.load(f) | ||
| expected_version = pyproject["project"]["version"] | ||
|
|
||
| assert expected_version in result.stdout | ||
|
Comment on lines
+39
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a great improvement to make the test more robust! To further improve readability and adhere to best practices (like PEP 8, which recommends imports at the top of the file), you can move the conditional import logic to the top of the file and simplify the TOML loading. At the top of import sys
from pathlib import Path
if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllibThen you can simplify this part of the test. with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as f:
pyproject = tomllib.load(f)
expected_version = pyproject["project"]["version"]
assert expected_version in result.stdout |
||
|
|
||
|
|
||
| def test_cli_encrypt_help(): | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.