primitive 0.1.73__tar.gz → 0.1.75__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {primitive-0.1.73 → primitive-0.1.75}/PKG-INFO +1 -1
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/__about__.py +1 -1
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/uploader.py +3 -8
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/auth/commands.py +4 -3
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/graphql/sdk.py +3 -1
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/auth.py +23 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/files.py +1 -1
- {primitive-0.1.73 → primitive-0.1.75}/.git-hooks/pre-commit +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/.gitattributes +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/.github/workflows/lint.yml +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/.github/workflows/publish.yml +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/.gitignore +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/.vscode/settings.json +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/LICENSE.txt +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/Makefile +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/README.md +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/linux setup.md +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/pyproject.toml +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/process.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/provision.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/agent/runner.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/auth/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/auth/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/auth/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/auth/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/cli.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/client.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/daemons/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/daemons/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/daemons/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/daemons/launch_agents.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/daemons/launch_service.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/exec/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/exec/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/exec/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/exec/interactive.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/files/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/git/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/git/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/git/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/git/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/git/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/graphql/relay.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/graphql/utility_fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/hardware/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/jobs/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/organizations/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/projects/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/provisioning/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/provisioning/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/provisioning/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/provisioning/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/commands.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/graphql/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/graphql/fragments.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/graphql/mutations.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/reservations/graphql/queries.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/actions.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/cache.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/chunk_size.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/config.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/git.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/memory_size.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/printer.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/shell.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/src/primitive/utils/verible.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/tests/__init__.py +0 -0
- {primitive-0.1.73 → primitive-0.1.75}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: primitive
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.75
|
4
4
|
Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
|
5
5
|
Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
|
6
6
|
Project-URL: Source, https://github.com//primitivecorp/primitive-cli
|
@@ -45,16 +45,11 @@ class Uploader:
|
|
45
45
|
)
|
46
46
|
|
47
47
|
for file in files:
|
48
|
-
|
49
|
-
# path=file,
|
50
|
-
# key_prefix=str(PurePath(file).relative_to(cache.parent).parent)
|
51
|
-
# )
|
52
|
-
# upload_id = result.data["fileUpdate"]["id"]
|
53
|
-
response = self.primitive.files.upload_file_via_api(
|
48
|
+
result = self.primitive.files.upload_file_direct(
|
54
49
|
path=file,
|
55
|
-
key_prefix=str(PurePath(file).relative_to(cache.parent).parent)
|
50
|
+
key_prefix=str(PurePath(file).relative_to(cache.parent).parent),
|
56
51
|
)
|
57
|
-
upload_id =
|
52
|
+
upload_id = result.data["fileUpdate"]["id"]
|
58
53
|
|
59
54
|
if upload_id:
|
60
55
|
file_ids.append(upload_id)
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import os
|
2
|
+
import typing
|
2
3
|
import webbrowser
|
4
|
+
|
3
5
|
import click
|
4
|
-
|
6
|
+
|
5
7
|
from ..utils.config import PRIMITIVE_CREDENTIALS_FILEPATH
|
6
8
|
from ..utils.printer import print_result
|
7
|
-
|
8
|
-
import typing
|
9
|
+
from .actions import Auth
|
9
10
|
|
10
11
|
if typing.TYPE_CHECKING:
|
11
12
|
from ..client import Primitive
|
@@ -1,9 +1,23 @@
|
|
1
1
|
import sys
|
2
2
|
|
3
|
+
import backoff
|
4
|
+
from aiohttp.client_exceptions import ClientConnectorError
|
5
|
+
from gql.transport.exceptions import TransportServerError
|
3
6
|
from loguru import logger
|
4
7
|
|
5
8
|
from ..graphql.sdk import create_session
|
6
9
|
|
10
|
+
MAX_TIME_FOR_BACKOFF = 60 * 15 # 15 minutes
|
11
|
+
|
12
|
+
|
13
|
+
def connection_backoff_handler(details):
|
14
|
+
logger.enable("primitive")
|
15
|
+
logger.error(
|
16
|
+
"Cannot connect to API. Waiting {wait:0.1f} seconds after {tries} tries.".format(
|
17
|
+
**details
|
18
|
+
)
|
19
|
+
)
|
20
|
+
|
7
21
|
|
8
22
|
def create_new_session(primitive):
|
9
23
|
token = primitive.host_config.get("token")
|
@@ -26,6 +40,15 @@ def create_new_session(primitive):
|
|
26
40
|
|
27
41
|
|
28
42
|
def guard(func):
|
43
|
+
@backoff.on_exception(
|
44
|
+
backoff.expo,
|
45
|
+
(
|
46
|
+
ClientConnectorError,
|
47
|
+
TransportServerError,
|
48
|
+
),
|
49
|
+
on_backoff=connection_backoff_handler,
|
50
|
+
max_time=MAX_TIME_FOR_BACKOFF,
|
51
|
+
)
|
29
52
|
def wrapper(self, *args, **kwargs):
|
30
53
|
if self.primitive.session is None:
|
31
54
|
self.primitive.session = create_new_session(self.primitive)
|
@@ -19,7 +19,7 @@ def find_files_for_extension(source: Path, extensions: Tuple[str]) -> List[Path]
|
|
19
19
|
for filename in filenames:
|
20
20
|
if filename.endswith(extensions):
|
21
21
|
matching_files.append(Path(dirpath).joinpath(filename))
|
22
|
-
|
22
|
+
|
23
23
|
logger.debug(
|
24
24
|
f"Found {len(matching_files)} following files that match: {matching_files}"
|
25
25
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|