-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add packages and content packages #313
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1d9bec0
fix: raise AttributeError instead of returning None on __getattr__.
tdstein 7778028
feat: add packages attribute to content
tdstein 436c8b9
--wip-- [skip ci]
tdstein a4bc536
--wip-- [skip ci]
tdstein 0e8e34a
feat: adds packages
tdstein 09fdb06
fix makefile
tdstein f91e357
fix jobs test
tdstein b892026
fix jobs test
tdstein 3895d72
remove cache, fix packages implementation, enable packages api in int…
tdstein 2af9e39
add overload definitions for fetch
tdstein 0941576
Merge branch 'main' into tdstein/304-content-packages
schloerke 4b0bed2
fix linting errors
tdstein 0c9f372
apply pr feedback
tdstein 9d9d948
adds type: ignore for now
tdstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ jobs: | |
matrix: | ||
CONNECT_VERSION: | ||
- preview | ||
- 2024.09.0 | ||
- 2024.08.0 | ||
- 2024.06.0 | ||
- 2024.05.0 | ||
|
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from packaging import version | ||
from packaging.version import parse | ||
|
||
from posit import connect | ||
|
||
client = connect.Client() | ||
client_version = client.version | ||
assert client_version is not None | ||
CONNECT_VERSION = version.parse(client_version) | ||
version = client.version | ||
assert version | ||
CONNECT_VERSION = parse(version) |
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,41 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
from packaging import version | ||
|
||
from posit import connect | ||
|
||
from . import CONNECT_VERSION | ||
|
||
|
||
@pytest.mark.skipif( | ||
CONNECT_VERSION < version.parse("2024.10.0-dev"), | ||
reason="Packages API unavailable", | ||
) | ||
class TestPackages: | ||
@classmethod | ||
def setup_class(cls): | ||
cls.client = connect.Client() | ||
cls.content = cls.client.content.create(name=cls.__name__) | ||
path = Path("../../../resources/connect/bundles/example-flask-minimal/bundle.tar.gz") | ||
path = (Path(__file__).parent / path).resolve() | ||
bundle = cls.content.bundles.create(str(path)) | ||
task = bundle.deploy() | ||
task.wait_for() | ||
|
||
@classmethod | ||
def teardown_class(cls): | ||
cls.content.delete() | ||
|
||
def test(self): | ||
assert self.client.packages | ||
assert self.content.packages | ||
|
||
def test_find_by(self): | ||
package = self.client.packages.find_by(name="flask") | ||
assert package | ||
assert package["name"] == "flask" | ||
|
||
package = self.content.packages.find_by(name="flask") | ||
assert package | ||
assert package["name"] == "flask" |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will bump this to 2024.11.0 after the release.