sharex-cli 0.0.2__tar.gz → 0.0.4__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.
@@ -2,14 +2,15 @@
2
2
  .idea/
3
3
  *.iml
4
4
  .vscode/
5
+ .*cache*
6
+ node_modules/
7
+ build/
8
+ dist/
9
+ out/
5
10
  .venv/
6
11
  venv/
7
12
  __pycache__/
8
13
  *.egg-info/
9
- build/
10
- dist/
11
- .*cache/
12
- *.log
13
14
  *.pyc
14
15
  .coverage
15
16
  coverage.xml
@@ -17,3 +18,5 @@ coverage.xml
17
18
  /site/
18
19
  /tests/files
19
20
  /tests/fake.json
21
+ *.spec
22
+ win-version.txt
@@ -1,16 +1,17 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: sharex-cli
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: CLI to Upload Files to a ShareX Server using a ShareX Custom Uploader (.sxcu) Configuration File.
5
5
  Project-URL: Changelog, https://github.com/cssnr/sharex-cli/releases
6
6
  Project-URL: Discord, https://discord.gg/wXy6m2X8wY
7
7
  Project-URL: Documentation, https://cssnr.github.io/sharex-cli/
8
+ Project-URL: Download, https://github.com/cssnr/sharex-cli/releases/latest
8
9
  Project-URL: Funding, https://ko-fi.com/cssnr
9
10
  Project-URL: GitHub, https://github.com/cssnr/sharex-cli
10
11
  Project-URL: Homepage, https://cssnr.com/
11
12
  Project-URL: Issues, https://github.com/cssnr/sharex-cli/issues
12
13
  Author: Shane
13
- License: MIT License
14
+ License-Expression: MIT
14
15
  License-File: LICENSE
15
16
  Classifier: Natural Language :: English
16
17
  Classifier: Operating System :: OS Independent
@@ -19,31 +20,34 @@ Classifier: Programming Language :: Python :: 3
19
20
  Classifier: Programming Language :: Python :: 3 :: Only
20
21
  Classifier: Typing :: Typed
21
22
  Requires-Python: >=3.10
23
+ Requires-Dist: click<9,>=8
22
24
  Requires-Dist: jsonpath-ng<2,>=1
23
25
  Requires-Dist: pyperclip<2,>=1
24
26
  Requires-Dist: requests<3,>=2
25
- Requires-Dist: typer>=0.20.0
27
+ Requires-Dist: rich>=13.8.0
28
+ Requires-Dist: typer>=0.27.2
26
29
  Description-Content-Type: text/markdown
27
30
 
28
31
  [![PyPI Version](https://img.shields.io/pypi/v/sharex-cli?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/sharex-cli/)
29
32
  [![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/releases)
30
33
  [![TOML Python Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcssnr%2Fsharex-cli%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&query=%24.project.requires-python&logo=python&logoColor=white&label=python)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
31
- [![PyPI Downloads](https://img.shields.io/pypi/dm/sharex-cli?logo=pypi&logoColor=white)](https://pypistats.org/packages/sharex-cli)
32
- [![Pepy Total Downloads](https://img.shields.io/pepy/dt/sharex-cli?logo=pypi&logoColor=white&label=total)](https://clickpy.clickhouse.com/dashboard/sharex-cli)
34
+ [![GitHub Downloads](https://img.shields.io/github/downloads/cssnr/sharex-cli/total?logo=github&label=downloads)](https://github.com/cssnr/sharex-cli/releases/latest)
35
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/sharex-cli?logo=socialblade&logoColor=white)](https://pypistats.org/packages/sharex-cli)
36
+ [![Pepy Total Downloads](https://img.shields.io/pepy/dt/sharex-cli?logo=rolldown&logoColor=white&label=total)](https://clickpy.clickhouse.com/dashboard/sharex-cli)
33
37
  [![Codecov](https://codecov.io/gh/cssnr/sharex-cli/graph/badge.svg?token=A8NDHZ393X)](https://codecov.io/gh/cssnr/sharex-cli)
34
38
  [![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/sharex-cli/lint.yaml?logo=cachet&label=lint)](https://github.com/cssnr/sharex-cli/actions/workflows/lint.yaml)
35
39
  [![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/sharex-cli/test.yaml?logo=cachet&label=test)](https://github.com/cssnr/sharex-cli/actions/workflows/test.yaml)
36
40
  [![Deployment PyPi](https://img.shields.io/github/deployments/cssnr/sharex-cli/pypi?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/sharex-cli/)
37
41
  [![Deployment Docs](https://img.shields.io/github/deployments/cssnr/sharex-cli/docs?logo=materialformkdocs&logoColor=white&label=docs)](https://cssnr.github.io/sharex-cli/)
38
- [![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/sharex-cli?logo=github&label=updated)](https://github.com/cssnr/sharex-cli/pulse)
39
- [![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/sharex-cli?logo=bookstack&logoColor=white&label=repo%20size)](https://github.com/cssnr/sharex-cli)
40
- [![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/sharex-cli?logo=htmx&logoColor=white)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
41
- [![GitHub Contributors](https://img.shields.io/github/contributors-anon/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/graphs/contributors)
42
- [![GitHub Issues](https://img.shields.io/github/issues/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/issues)
43
- [![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/discussions)
44
- [![GitHub Forks](https://img.shields.io/github/forks/cssnr/sharex-cli?style=flat&logo=github)](https://github.com/cssnr/sharex-cli/forks)
45
- [![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/sharex-cli?style=flat&logo=github)](https://github.com/cssnr/sharex-cli/stargazers)
46
- [![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&label=org%20stars)](https://cssnr.github.io/)
42
+ [![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/sharex-cli?logo=listenhub&label=updated)](https://github.com/cssnr/sharex-cli/pulse)
43
+ [![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/sharex-cli?logo=buffer&label=repo%20size)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
44
+ [![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/sharex-cli?logo=devbox)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
45
+ [![GitHub Contributors](https://img.shields.io/github/contributors-anon/cssnr/sharex-cli?logo=southwestairlines)](https://github.com/cssnr/sharex-cli/graphs/contributors)
46
+ [![GitHub Issues](https://img.shields.io/github/issues/cssnr/sharex-cli?logo=codeforces&logoColor=white)](https://github.com/cssnr/sharex-cli/issues)
47
+ [![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/sharex-cli?logo=theconversation)](https://github.com/cssnr/sharex-cli/discussions)
48
+ [![GitHub Forks](https://img.shields.io/github/forks/cssnr/sharex-cli?style=flat&logo=forgejo&logoColor=white)](https://github.com/cssnr/sharex-cli/forks)
49
+ [![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/sharex-cli?style=flat&logo=gleam&logoColor=white)](https://github.com/cssnr/sharex-cli/stargazers)
50
+ [![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=apachespark&logoColor=white&label=org%20stars)](https://cssnr.github.io/)
47
51
  [![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
48
52
  [![Ko-fi](https://img.shields.io/badge/Ko--fi-72a5f2?logo=kofi&label=support)](https://ko-fi.com/cssnr)
49
53
 
@@ -87,22 +91,31 @@ From PyPI: <https://pypi.org/p/sharex-cli>
87
91
 
88
92
  ```shell
89
93
  pip install sharex-cli
90
- ```
91
-
92
- ```shell
93
94
  uv tool install sharex-cli
94
95
  ```
95
96
 
96
- From GitHub: [https://github.com/cssnr/sharex-cli](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
97
+ From Homebrew: <https://github.com/cssnr/homebrew-tap>
97
98
 
98
99
  ```shell
99
- pip install git+https://github.com/cssnr/sharex-cli.git
100
+ brew install cssnr/tap/sharex-cli
100
101
  ```
101
102
 
103
+ From GitHub: <https://github.com/cssnr/sharex-cli/releases/latest>
104
+
102
105
  ```shell
103
- uv tool install git+https://github.com/cssnr/sharex-cli.git
106
+ curl https://i.jpillora.com/cssnr/sharex-cli! | bash
104
107
  ```
105
108
 
109
+ See [jpillora/installer](https://github.com/jpillora/installer) for more details.
110
+ Alternatively, you can manually download a release for your system.
111
+
112
+ - [Windows Installer](https://github.com/cssnr/sharex-cli/releases/latest/download/windows-installer.exe) _amd64_
113
+ - [Windows x86_64](https://github.com/cssnr/sharex-cli/releases/latest/download/windows-amd64.zip) _amd64_
114
+ - [macOS Apple Intel](https://github.com/cssnr/sharex-cli/releases/latest/download/macos-amd64.zip) _amd64_
115
+ - [macOS Apple Silicon](https://github.com/cssnr/sharex-cli/releases/latest/download/macos-arm64.zip) _arm64_
116
+ - [Linux x86_64](https://github.com/cssnr/sharex-cli/releases/latest/download/linux-amd64.zip) _amd64_
117
+ - [Linux ARM](https://github.com/cssnr/sharex-cli/releases/latest/download/linux-arm64.zip) _arm64_
118
+
106
119
  [![View Install Guide](https://img.shields.io/badge/view_install_guide-blue?style=for-the-badge&logo=googledocs&logoColor=white)](https://cssnr.github.io/sharex-cli/cli/#install)
107
120
 
108
121
  ## Configure<a id="configure"></a>
@@ -1,22 +1,23 @@
1
1
  [![PyPI Version](https://img.shields.io/pypi/v/sharex-cli?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/sharex-cli/)
2
2
  [![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/releases)
3
3
  [![TOML Python Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcssnr%2Fsharex-cli%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&query=%24.project.requires-python&logo=python&logoColor=white&label=python)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
4
- [![PyPI Downloads](https://img.shields.io/pypi/dm/sharex-cli?logo=pypi&logoColor=white)](https://pypistats.org/packages/sharex-cli)
5
- [![Pepy Total Downloads](https://img.shields.io/pepy/dt/sharex-cli?logo=pypi&logoColor=white&label=total)](https://clickpy.clickhouse.com/dashboard/sharex-cli)
4
+ [![GitHub Downloads](https://img.shields.io/github/downloads/cssnr/sharex-cli/total?logo=github&label=downloads)](https://github.com/cssnr/sharex-cli/releases/latest)
5
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/sharex-cli?logo=socialblade&logoColor=white)](https://pypistats.org/packages/sharex-cli)
6
+ [![Pepy Total Downloads](https://img.shields.io/pepy/dt/sharex-cli?logo=rolldown&logoColor=white&label=total)](https://clickpy.clickhouse.com/dashboard/sharex-cli)
6
7
  [![Codecov](https://codecov.io/gh/cssnr/sharex-cli/graph/badge.svg?token=A8NDHZ393X)](https://codecov.io/gh/cssnr/sharex-cli)
7
8
  [![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/sharex-cli/lint.yaml?logo=cachet&label=lint)](https://github.com/cssnr/sharex-cli/actions/workflows/lint.yaml)
8
9
  [![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/sharex-cli/test.yaml?logo=cachet&label=test)](https://github.com/cssnr/sharex-cli/actions/workflows/test.yaml)
9
10
  [![Deployment PyPi](https://img.shields.io/github/deployments/cssnr/sharex-cli/pypi?logo=pypi&logoColor=white&label=pypi)](https://pypi.org/project/sharex-cli/)
10
11
  [![Deployment Docs](https://img.shields.io/github/deployments/cssnr/sharex-cli/docs?logo=materialformkdocs&logoColor=white&label=docs)](https://cssnr.github.io/sharex-cli/)
11
- [![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/sharex-cli?logo=github&label=updated)](https://github.com/cssnr/sharex-cli/pulse)
12
- [![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/sharex-cli?logo=bookstack&logoColor=white&label=repo%20size)](https://github.com/cssnr/sharex-cli)
13
- [![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/sharex-cli?logo=htmx&logoColor=white)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
14
- [![GitHub Contributors](https://img.shields.io/github/contributors-anon/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/graphs/contributors)
15
- [![GitHub Issues](https://img.shields.io/github/issues/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/issues)
16
- [![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/sharex-cli?logo=github)](https://github.com/cssnr/sharex-cli/discussions)
17
- [![GitHub Forks](https://img.shields.io/github/forks/cssnr/sharex-cli?style=flat&logo=github)](https://github.com/cssnr/sharex-cli/forks)
18
- [![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/sharex-cli?style=flat&logo=github)](https://github.com/cssnr/sharex-cli/stargazers)
19
- [![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&label=org%20stars)](https://cssnr.github.io/)
12
+ [![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/sharex-cli?logo=listenhub&label=updated)](https://github.com/cssnr/sharex-cli/pulse)
13
+ [![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/sharex-cli?logo=buffer&label=repo%20size)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
14
+ [![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/sharex-cli?logo=devbox)](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
15
+ [![GitHub Contributors](https://img.shields.io/github/contributors-anon/cssnr/sharex-cli?logo=southwestairlines)](https://github.com/cssnr/sharex-cli/graphs/contributors)
16
+ [![GitHub Issues](https://img.shields.io/github/issues/cssnr/sharex-cli?logo=codeforces&logoColor=white)](https://github.com/cssnr/sharex-cli/issues)
17
+ [![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/sharex-cli?logo=theconversation)](https://github.com/cssnr/sharex-cli/discussions)
18
+ [![GitHub Forks](https://img.shields.io/github/forks/cssnr/sharex-cli?style=flat&logo=forgejo&logoColor=white)](https://github.com/cssnr/sharex-cli/forks)
19
+ [![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/sharex-cli?style=flat&logo=gleam&logoColor=white)](https://github.com/cssnr/sharex-cli/stargazers)
20
+ [![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=apachespark&logoColor=white&label=org%20stars)](https://cssnr.github.io/)
20
21
  [![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
21
22
  [![Ko-fi](https://img.shields.io/badge/Ko--fi-72a5f2?logo=kofi&label=support)](https://ko-fi.com/cssnr)
22
23
 
@@ -60,22 +61,31 @@ From PyPI: <https://pypi.org/p/sharex-cli>
60
61
 
61
62
  ```shell
62
63
  pip install sharex-cli
63
- ```
64
-
65
- ```shell
66
64
  uv tool install sharex-cli
67
65
  ```
68
66
 
69
- From GitHub: [https://github.com/cssnr/sharex-cli](https://github.com/cssnr/sharex-cli?tab=readme-ov-file#readme)
67
+ From Homebrew: <https://github.com/cssnr/homebrew-tap>
70
68
 
71
69
  ```shell
72
- pip install git+https://github.com/cssnr/sharex-cli.git
70
+ brew install cssnr/tap/sharex-cli
73
71
  ```
74
72
 
73
+ From GitHub: <https://github.com/cssnr/sharex-cli/releases/latest>
74
+
75
75
  ```shell
76
- uv tool install git+https://github.com/cssnr/sharex-cli.git
76
+ curl https://i.jpillora.com/cssnr/sharex-cli! | bash
77
77
  ```
78
78
 
79
+ See [jpillora/installer](https://github.com/jpillora/installer) for more details.
80
+ Alternatively, you can manually download a release for your system.
81
+
82
+ - [Windows Installer](https://github.com/cssnr/sharex-cli/releases/latest/download/windows-installer.exe) _amd64_
83
+ - [Windows x86_64](https://github.com/cssnr/sharex-cli/releases/latest/download/windows-amd64.zip) _amd64_
84
+ - [macOS Apple Intel](https://github.com/cssnr/sharex-cli/releases/latest/download/macos-amd64.zip) _amd64_
85
+ - [macOS Apple Silicon](https://github.com/cssnr/sharex-cli/releases/latest/download/macos-arm64.zip) _arm64_
86
+ - [Linux x86_64](https://github.com/cssnr/sharex-cli/releases/latest/download/linux-amd64.zip) _amd64_
87
+ - [Linux ARM](https://github.com/cssnr/sharex-cli/releases/latest/download/linux-arm64.zip) _arm64_
88
+
79
89
  [![View Install Guide](https://img.shields.io/badge/view_install_guide-blue?style=for-the-badge&logo=googledocs&logoColor=white)](https://cssnr.github.io/sharex-cli/cli/#install)
80
90
 
81
91
  ## Configure<a id="configure"></a>
@@ -3,7 +3,7 @@ name = "sharex-cli"
3
3
  description = "CLI to Upload Files to a ShareX Server using a ShareX Custom Uploader (.sxcu) Configuration File."
4
4
  readme = "README.md"
5
5
  requires-python = ">=3.10"
6
- license = { text = "MIT License" }
6
+ license = "MIT"
7
7
  authors = [{ name = "Shane" }]
8
8
  classifiers = [
9
9
  "Natural Language :: English",
@@ -14,10 +14,12 @@ classifiers = [
14
14
  "Typing :: Typed",
15
15
  ]
16
16
  dependencies = [
17
+ "click>=8,<9",
17
18
  "jsonpath-ng>=1,<2",
18
19
  "pyperclip>=1,<2",
19
20
  "requests>=2,<3",
20
- "typer>=0.20.0",
21
+ "rich>=13.8.0",
22
+ "typer>=0.27.2",
21
23
  ]
22
24
  dynamic = ["version"]
23
25
 
@@ -25,6 +27,7 @@ dynamic = ["version"]
25
27
  Changelog = "https://github.com/cssnr/sharex-cli/releases"
26
28
  Discord = "https://discord.gg/wXy6m2X8wY"
27
29
  Documentation = "https://cssnr.github.io/sharex-cli/"
30
+ Download = "https://github.com/cssnr/sharex-cli/releases/latest"
28
31
  Funding = "https://ko-fi.com/cssnr"
29
32
  GitHub = "https://github.com/cssnr/sharex-cli"
30
33
  Homepage = "https://cssnr.com/"
@@ -36,20 +39,23 @@ sharex-cli = "sharex.cli:app"
36
39
 
37
40
  [dependency-groups]
38
41
  dev = [
39
- "bandit>=1.9.2",
40
- "black>=25.12.0",
41
- "coverage>=7.13.0",
42
- "hatch>=1.16.2",
43
- "isort>=7.0.0",
44
- "mypy>=1.19.1",
45
- "pytest>=9.0.2",
46
- "ruff>=0.14.10",
47
- "tombi>=0.7.8",
48
- "ty>=0.0.4",
49
- "typer>=0.20.1",
50
- "types-pyperclip>=1.9.0.20250801",
51
- "types-requests>=2.32.4.20250913",
52
- "validate-pyproject[all]>=0.24.1",
42
+ "bandit>=1.9.4",
43
+ "black>=26.5.1",
44
+ "coverage>=7.16.1",
45
+ "hatch>=1.18.1",
46
+ "isort>=9.0.1",
47
+ "mypy>=2.3.1",
48
+ "pyinstaller>=6.22.3",
49
+ "pyinstaller-versionfile>=3.1.0",
50
+ "pytest>=9.1.1",
51
+ "ruff>=0.16.8",
52
+ "tombi>=1.5.5",
53
+ "toml-run>=0.0.2",
54
+ "ty>=0.0.83",
55
+ "typer>=0.27.2",
56
+ "types-pyperclip>=1.11.0.20260508",
57
+ "types-requests>=2.33.0.20260906",
58
+ "validate-pyproject[all]>=0.26",
53
59
  ]
54
60
 
55
61
  # [build-system]
@@ -64,7 +70,7 @@ build-backend = "hatchling.build"
64
70
  # Bandit
65
71
  # https://bandit.readthedocs.io/en/latest/config.html
66
72
  [tool.bandit]
67
- exclude_dirs = [".venv"]
73
+ exclude_dirs = [".venv", "tests"]
68
74
  skips = ["B105", "B107"]
69
75
 
70
76
  # Black
@@ -76,7 +82,7 @@ extend-exclude = '(\.github)'
76
82
  # Coverage
77
83
  # https://coverage.readthedocs.io/en/latest/
78
84
  [tool.coverage.run]
79
- omit = ["_version.py", "utils.py", "cli.py"]
85
+ omit = ["_version.py", "app.py", "utils.py", "cli.py"]
80
86
  source = ["src"]
81
87
 
82
88
  # Hatchling
@@ -94,7 +100,6 @@ packages = ["src/sharex"]
94
100
  # https://pycqa.github.io/isort/docs/configuration/options.html
95
101
  [tool.isort]
96
102
  profile = "black"
97
- lines_after_imports = 2
98
103
  src_paths = ["src", "test"]
99
104
  skip = [".venv", ".github"]
100
105
 
@@ -117,3 +122,44 @@ extend-exclude = [".github"]
117
122
 
118
123
  [tool.ruff.lint]
119
124
  select = ["E4", "E7", "E9", "F", "B", "Q"]
125
+
126
+ [tool.scripts]
127
+ win-version = "uv run pyivf-make_version --source-format yaml --metadata-source assets/win-version.yaml --outfile win-version.txt"
128
+ pyinstaller = "uv run pyinstaller -n sharex -i docs/favicon.ico src/app.py"
129
+ pathmgr = [
130
+ "mkdir dist || echo dist dir exists",
131
+ "wget https://github.com/Bill-Stewart/PathMgr/releases/download/v2.0.0/PathMgr-2.0.0.zip -O dist/pathmgr.zip",
132
+ "unzip dist/pathmgr.zip -d dist/PathMgr",
133
+ ]
134
+ inno = ["iscc.exe installer.iss"]
135
+ test = ["uv run coverage run -m pytest", "uv run coverage report -m"]
136
+ clean = "rm -rf .cache dist site"
137
+ build = "uv run hatch build"
138
+ predocs = "rm -rf .cache site"
139
+ docs = "zensical serve --open --dev-addr 0.0.0.0:8000"
140
+ docs-build = "zensical build --clean"
141
+ format = [
142
+ "uv run black .",
143
+ "uv run isort -c .",
144
+ "uv run ruff format .",
145
+ "uv run tombi format .",
146
+ "which prettier && prettier --write . || echo missing prettier",
147
+ ]
148
+ lint = [
149
+ "run bandit",
150
+ "run mypy",
151
+ "run ruff",
152
+ "run validate",
153
+ "run yamllint",
154
+ "which prettier && prettier --check . || echo missing prettier",
155
+ "uv run black --check .",
156
+ "uv run isort -c .",
157
+ "uv run tombi lint",
158
+ "uv run ty check -v .",
159
+ "uv lock --check",
160
+ ]
161
+ bandit = "uv run bandit -c pyproject.toml -r ."
162
+ mypy = "uv run mypy ."
163
+ ruff = "uv run ruff check ."
164
+ validate = "uv run validate-pyproject pyproject.toml"
165
+ yamllint = "uv run yamllint -c .github/yamllint.yaml ."
@@ -0,0 +1,4 @@
1
+ from sharex.cli import app
2
+
3
+ if __name__ == "__main__":
4
+ app()
@@ -8,5 +8,4 @@ r"""
8
8
 
9
9
  from .api import get_config, upload_file
10
10
 
11
-
12
11
  __all__ = ["get_config", "upload_file"]
@@ -0,0 +1,2 @@
1
+ # The string "0.0.1" is used in .github/workflows/build.yaml
2
+ __version__ = "0.0.4"
@@ -11,13 +11,12 @@ from jsonpath_ng.ext import parse
11
11
 
12
12
  from ._version import __version__
13
13
 
14
-
15
14
  session = requests.Session()
16
15
 
17
16
  session.headers.update({"user-agent": f"requests/sharex-{__version__}"})
18
17
 
19
18
 
20
- def upload_file(config, file_name: str, file_data: IO) -> str:
19
+ def upload_file(config, file_name: str, file_data: IO, path: Optional[Path] = None) -> str:
21
20
  """Upload a File from an SXCU Config"""
22
21
  url = config["RequestURL"]
23
22
  # print(f"{url=}")
@@ -26,7 +25,7 @@ def upload_file(config, file_name: str, file_data: IO) -> str:
26
25
  headers = config["Headers"]
27
26
  key = config["URL"]
28
27
 
29
- path = Path(file_name)
28
+ # path = Path(file_name)
30
29
  mime_type = get_type(path)
31
30
  # print(f"{mime_type=}")
32
31
 
@@ -71,7 +70,7 @@ def get_config(config_path: Optional[Path] = None, env_var: str = "", create_emp
71
70
  return None
72
71
 
73
72
 
74
- def get_type(file_path: Path) -> str: # NOSONAR
73
+ def get_type(path: Optional[Path] = None) -> str: # NOSONAR
75
74
  """
76
75
  Get MIME type from guess_type or by reading magic headers
77
76
  https://en.wikipedia.org/wiki/List_of_file_signatures
@@ -79,14 +78,17 @@ def get_type(file_path: Path) -> str: # NOSONAR
79
78
  Deprecated since version 3.13: Passing a file path instead of URL is soft deprecated. Use guess_file_type() for this.
80
79
  https://docs.python.org/3/library/mimetypes.html#mimetypes.guess_type
81
80
  """
82
- mime_type, _ = mimetypes.guess_type(file_path, strict=False)
81
+ if not path:
82
+ return "text/plain"
83
+
84
+ mime_type, _ = mimetypes.guess_type(path, strict=False)
83
85
  if mime_type:
84
86
  return mime_type
85
87
 
86
- if not file_path.is_file():
88
+ if not path.is_file():
87
89
  return "text/plain"
88
90
 
89
- with open(file_path, "rb") as file:
91
+ with open(path, "rb") as file:
90
92
  chunk = file.read(512)
91
93
 
92
94
  # print(f"chunk: {type(chunk)} - {chunk[:20]}")
@@ -5,7 +5,7 @@ import sys
5
5
  import tempfile
6
6
  from json import JSONDecodeError
7
7
  from pathlib import Path
8
- from typing import Any, Dict, List, Optional
8
+ from typing import Annotated, Any, Dict, List, Optional, cast
9
9
 
10
10
  import click
11
11
  import pyperclip
@@ -14,13 +14,11 @@ from rich import print
14
14
  from rich.console import Console
15
15
  from rich.panel import Panel
16
16
  from rich.table import Table
17
- from typing_extensions import Annotated
18
17
 
19
18
  from . import __doc__ as package_doc
20
19
  from . import api, utils
21
20
  from ._version import __version__
22
21
 
23
-
24
22
  app = typer.Typer(
25
23
  context_settings={"help_option_names": ["-h", "--help"]},
26
24
  pretty_exceptions_show_locals=False,
@@ -79,7 +77,7 @@ def update_config(config_path: Path, config_files: List[Path]):
79
77
  vprint(f"2 {user_config=}")
80
78
 
81
79
  if not user_config:
82
- res: Optional[str] = click.edit()
80
+ res = cast(Optional[str], click.edit())
83
81
  vprint(f"{res=}")
84
82
  if res:
85
83
  user_config = json.loads(res)
@@ -124,7 +122,7 @@ def archive_dir(config, params: Dict[str, Any], dir_path: Path):
124
122
  f"Uploading File: [green bold]{click.format_filename(final_path.name)}[/green bold] - [yellow bold]{size}"
125
123
  ):
126
124
  with open(final_path, "rb") as f:
127
- url = api.upload_file(config, final_path.name, f)
125
+ url = api.upload_file(config, final_path.name, f, final_path)
128
126
  print(url)
129
127
  copy_text(url)
130
128
  raise typer.Exit()
@@ -209,7 +207,7 @@ def main( # NOSONAR
209
207
  # Process STDIN
210
208
  file_name = _name or f"{utils.gen_rand(8)}.txt"
211
209
  vprint(f"{file_name=}")
212
- content = click.get_text_stream("stdin")
210
+ content = sys.stdin
213
211
  url = api.upload_file(config, file_name, content)
214
212
  print(url)
215
213
  copy_text(url)
@@ -263,7 +261,7 @@ def main( # NOSONAR
263
261
  ):
264
262
  file_name = _name if _name and len(_files) == 1 else file.name
265
263
  with open(file, "rb") as f:
266
- url = api.upload_file(config, file_name, f)
264
+ url = api.upload_file(config, file_name, f, file)
267
265
  print(url)
268
266
  copy_text(url)
269
267
  if _launch and len(_files) == 1 and url:
@@ -1,2 +0,0 @@
1
- # The string "0.0.2" is used in .github/workflows/build.yaml
2
- __version__ = "0.0.2"
File without changes