primitive 0.1.4__tar.gz → 0.1.5__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.
Files changed (42) hide show
  1. {primitive-0.1.4 → primitive-0.1.5}/PKG-INFO +16 -1
  2. {primitive-0.1.4 → primitive-0.1.5}/README.md +15 -0
  3. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/__about__.py +1 -1
  4. primitive-0.1.5/src/primitive/utils/shell.py +33 -0
  5. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/verible.py +7 -3
  6. primitive-0.1.4/src/primitive/utils/shell.py +0 -63
  7. {primitive-0.1.4 → primitive-0.1.5}/.git-hooks/pre-commit +0 -0
  8. {primitive-0.1.4 → primitive-0.1.5}/.gitattributes +0 -0
  9. {primitive-0.1.4 → primitive-0.1.5}/.github/workflows/lint.yml +0 -0
  10. {primitive-0.1.4 → primitive-0.1.5}/.github/workflows/publish.yml +0 -0
  11. {primitive-0.1.4 → primitive-0.1.5}/.gitignore +0 -0
  12. {primitive-0.1.4 → primitive-0.1.5}/.vscode/settings.json +0 -0
  13. {primitive-0.1.4 → primitive-0.1.5}/LICENSE.txt +0 -0
  14. {primitive-0.1.4 → primitive-0.1.5}/Makefile +0 -0
  15. {primitive-0.1.4 → primitive-0.1.5}/linux setup.md +0 -0
  16. {primitive-0.1.4 → primitive-0.1.5}/pyproject.toml +0 -0
  17. {primitive-0.1.4 → primitive-0.1.5}/requirements.txt +0 -0
  18. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/__init__.py +0 -0
  19. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/auth/__init__.py +0 -0
  20. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/auth/actions.py +0 -0
  21. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/auth/commands.py +0 -0
  22. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/cli.py +0 -0
  23. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/client.py +0 -0
  24. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/files/actions.py +0 -0
  25. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/files/commands.py +0 -0
  26. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/graphql/__init__.py +0 -0
  27. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/graphql/sdk.py +0 -0
  28. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/hardware/actions.py +0 -0
  29. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/hardware/commands.py +0 -0
  30. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/lint/actions.py +0 -0
  31. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/lint/commands.py +0 -0
  32. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/projects/__init__.py +0 -0
  33. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/projects/actions.py +0 -0
  34. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/simulations/__init__.py +0 -0
  35. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/simulations/actions.py +0 -0
  36. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/actions.py +0 -0
  37. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/config.py +0 -0
  38. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/files.py +0 -0
  39. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/git.py +0 -0
  40. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/memory_size.py +0 -0
  41. {primitive-0.1.4 → primitive-0.1.5}/src/primitive/utils/printer.py +0 -0
  42. {primitive-0.1.4 → primitive-0.1.5}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: primitive
3
- Version: 0.1.4
3
+ Version: 0.1.5
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
@@ -36,6 +36,7 @@ Description-Content-Type: text/markdown
36
36
  **Table of Contents**
37
37
 
38
38
  - [Installation](#installation)
39
+ - [Configuration](#configuration)
39
40
  - [License](#license)
40
41
 
41
42
  ## Installation
@@ -44,6 +45,20 @@ Description-Content-Type: text/markdown
44
45
  pip install primitive
45
46
  ```
46
47
 
48
+ ## Configuration
49
+
50
+ ### Authenticate
51
+
52
+ ```console
53
+ primitive config
54
+ ```
55
+
56
+ ### Register your Hardware
57
+
58
+ ```console
59
+ primitive hardware register
60
+ ```
61
+
47
62
  ## License
48
63
 
49
64
  `primitive` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -8,6 +8,7 @@
8
8
  **Table of Contents**
9
9
 
10
10
  - [Installation](#installation)
11
+ - [Configuration](#configuration)
11
12
  - [License](#license)
12
13
 
13
14
  ## Installation
@@ -16,6 +17,20 @@
16
17
  pip install primitive
17
18
  ```
18
19
 
20
+ ## Configuration
21
+
22
+ ### Authenticate
23
+
24
+ ```console
25
+ primitive config
26
+ ```
27
+
28
+ ### Register your Hardware
29
+
30
+ ```console
31
+ primitive hardware register
32
+ ```
33
+
19
34
  ## License
20
35
 
21
36
  `primitive` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@steins.studio>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.1.4"
4
+ __version__ = "0.1.5"
@@ -0,0 +1,33 @@
1
+ from pathlib import Path
2
+ import subprocess
3
+
4
+
5
+ def add_path_to_shell(path: Path):
6
+ if not path.exists():
7
+ raise Exception(f"{path} does not exist.")
8
+
9
+ try:
10
+ subprocess.run(["fish_add_path", path], capture_output=True)
11
+ return True
12
+ except FileNotFoundError:
13
+ pass
14
+
15
+ profile_path = None
16
+
17
+ if Path.home().joinpath(".bash_profile").exists():
18
+ profile_path = Path.home().joinpath(".bash_profile")
19
+ elif Path.home().joinpath(".bashrc").exists():
20
+ profile_path = Path.home().joinpath(".bashrc")
21
+ elif Path.home().joinpath(".zshrc").exists():
22
+ profile_path = Path.home().joinpath(".zshrc")
23
+ elif Path.home().joinpath(".profile").exists():
24
+ profile_path = Path.home().joinpath(".profile")
25
+ elif Path.home().joinpath(".bash_login").exists():
26
+ profile_path = Path.home().joinpath(".bash_login")
27
+ else:
28
+ raise Exception(f"Failed to add {path} to PATH")
29
+
30
+ with open(profile_path, "a") as file:
31
+ file.write(f"export PATH={path}:$PATH\n")
32
+
33
+ return True
@@ -18,9 +18,9 @@ def install_verible(system_info: dict) -> bool:
18
18
  url = VERIBLE_MAC_OS_LINK
19
19
  elif system_info.get("os_family") == "Windows":
20
20
  url = VERIBLE_WINDOWS_64_OS_LINK
21
- elif system_info.processor == "x86_64":
21
+ elif system_info.get("processor") == "x86_64":
22
22
  url = VERIBLE_LINUX_X86_64_OS_LINK
23
- elif system_info.processor == "arm":
23
+ elif system_info.get("processor") == "arm":
24
24
  url = VERIBLE_LINUX_X86_64_OS_LINK
25
25
 
26
26
  verible_dir_name = url.split("/")[-1].split(".tar.gz")[0]
@@ -43,7 +43,11 @@ def install_verible(system_info: dict) -> bool:
43
43
  logger.debug("Deleting tar.gz artifact")
44
44
  file_download_path.unlink()
45
45
 
46
- verible_bin = Path.home() / verible_dir_name / "bin"
46
+ unpacked_verible_dir_name = verible_dir_name
47
+ if "linux" in unpacked_verible_dir_name:
48
+ unpacked_verible_dir_name = unpacked_verible_dir_name.split("-linux")[0]
49
+
50
+ verible_bin = Path.home().joinpath(unpacked_verible_dir_name).joinpath("bin")
47
51
 
48
52
  logger.debug("Adding verible to PATH")
49
53
  add_path_to_shell(verible_bin)
@@ -1,63 +0,0 @@
1
- from pathlib import Path
2
- import subprocess
3
-
4
-
5
- def add_path_to_shell(path: Path):
6
- try:
7
- subprocess.run(["fish_add_path", path], capture_output=True)
8
- return True
9
- except FileNotFoundError:
10
- pass
11
-
12
- if Path.home() / ".bash_profile":
13
- subprocess.run(
14
- [
15
- "echo",
16
- f"'export PATH={path}:$PATH'",
17
- ">>",
18
- "~/.bash_profile",
19
- ],
20
- capture_output=True,
21
- )
22
- elif Path.home() / ".bashrc":
23
- subprocess.run(
24
- [
25
- "echo",
26
- f"'export PATH={path}:$PATH'",
27
- ">>",
28
- "~/.bashrc",
29
- ],
30
- capture_output=True,
31
- )
32
- elif Path.home() / ".zshrc":
33
- subprocess.run(
34
- [
35
- "echo",
36
- f"'export PATH={path}:$PATH'",
37
- ">>",
38
- "~/.zshrc",
39
- ],
40
- capture_output=True,
41
- )
42
- elif Path.home() / ".profile":
43
- subprocess.run(
44
- [
45
- "echo",
46
- f"'export PATH={path}:$PATH'",
47
- ">>",
48
- "~/.profile",
49
- ],
50
- capture_output=True,
51
- )
52
- elif Path.home() / ".bash_login":
53
- subprocess.run(
54
- [
55
- "echo",
56
- f"'export PATH={path}:$PATH'",
57
- ">>",
58
- "~/.bash_login",
59
- ],
60
- capture_output=True,
61
- )
62
- else:
63
- raise Exception(f"Failed to add {path} to PATH")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes