hezor-common 0.1.0__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.
@@ -0,0 +1,43 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ .venv/
26
+ venv/
27
+ ENV/
28
+ env/
29
+
30
+ # IDE
31
+ .vscode/
32
+ .idea/
33
+ *.swp
34
+ *.swo
35
+ *~
36
+
37
+ # Testing
38
+ .pytest_cache/
39
+ .coverage
40
+ htmlcov/
41
+
42
+ # Distribution
43
+ *.whl
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Silo QIAN
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ recursive-include src/hezor_common *.py py.typed
@@ -0,0 +1,40 @@
1
+ .PHONY: help install build publish publish-test clean test
2
+
3
+ help:
4
+ @echo "Hezor Common - Build & Publish Commands"
5
+ @echo ""
6
+ @echo "Usage:"
7
+ @echo " make install - Install dependencies using uv"
8
+ @echo " make build - Build the package"
9
+ @echo " make publish-test - Publish to TestPyPI"
10
+ @echo " make publish - Publish to PyPI (production)"
11
+ @echo " make clean - Clean build artifacts"
12
+ @echo " make test - Run tests (if any)"
13
+ @echo ""
14
+
15
+ install:
16
+ @echo "๐Ÿ“ฆ Installing dependencies..."
17
+ uv sync
18
+
19
+ build:
20
+ @echo "๐Ÿ”จ Building package..."
21
+ @./scripts/build.sh
22
+
23
+ publish-test:
24
+ @echo "๐Ÿš€ Publishing to TestPyPI..."
25
+ @./scripts/publish.sh --test
26
+
27
+ publish:
28
+ @echo "๐Ÿš€ Publishing to PyPI..."
29
+ @./scripts/publish.sh
30
+
31
+ clean:
32
+ @echo "๐Ÿงน Cleaning build artifacts..."
33
+ @rm -rf dist/ build/ *.egg-info
34
+ @find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
35
+ @find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
36
+ @echo "โœ… Clean complete"
37
+
38
+ test:
39
+ @echo "๐Ÿงช Running tests..."
40
+ @uv run pytest
@@ -0,0 +1,147 @@
1
+ Metadata-Version: 2.4
2
+ Name: hezor-common
3
+ Version: 0.1.0
4
+ Summary: Common utilities for Hezor projects
5
+ Project-URL: Homepage, https://github.com/lennon/hezor_common
6
+ Project-URL: Repository, https://github.com/lennon/hezor_common
7
+ Project-URL: Issues, https://github.com/lennon/hezor_common/issues
8
+ Author-email: Silo QIAN <qtisan@hotmail.com>
9
+ License-File: LICENSE
10
+ Keywords: common,hezor,utilities
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+
20
+ # Hezor Common
21
+
22
+ Common utilities for Hezor projects.
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install hezor-common
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ from hezor_common import hello
34
+
35
+ print(hello())
36
+ ```
37
+
38
+ ## Development
39
+
40
+ ### Setup
41
+
42
+ ```bash
43
+ # Install uv if not already installed
44
+ curl -LsSf https://astral.sh/uv/install.sh | sh
45
+
46
+ # Create virtual environment and install dependencies
47
+ uv sync
48
+ ```
49
+
50
+ ### Quick Commands (using Makefile)
51
+
52
+ ```bash
53
+ # Show all available commands
54
+ make help
55
+
56
+ # Install dependencies
57
+ make install
58
+
59
+ # Build the package
60
+ make build
61
+
62
+ # Publish to TestPyPI (recommended for testing)
63
+ make publish-test
64
+
65
+ # Publish to PyPI (production)
66
+ make publish
67
+
68
+ # Clean build artifacts
69
+ make clean
70
+ ```
71
+
72
+ ### Manual Build and Publish
73
+
74
+ #### Building
75
+
76
+ ```bash
77
+ # Build the package
78
+ uv build
79
+
80
+ # Or use the build script
81
+ ./scripts/build.sh
82
+ ```
83
+
84
+ #### Publishing to PyPI
85
+
86
+ Before publishing, you need to:
87
+
88
+ 1. **Register on PyPI/TestPyPI**:
89
+ - TestPyPI: https://test.pypi.org/account/register/
90
+ - PyPI: https://pypi.org/account/register/
91
+
92
+ 2. **Configure credentials** (recommended - using API tokens):
93
+ ```bash
94
+ # Create ~/.pypirc file
95
+ cat > ~/.pypirc << EOF
96
+ [distutils]
97
+ index-servers =
98
+ pypi
99
+ testpypi
100
+
101
+ [pypi]
102
+ username = __token__
103
+ password = pypi-your-api-token-here
104
+
105
+ [testpypi]
106
+ username = __token__
107
+ password = pypi-your-test-api-token-here
108
+ EOF
109
+
110
+ chmod 600 ~/.pypirc
111
+ ```
112
+
113
+ 3. **Publish**:
114
+ ```bash
115
+ # Publish to TestPyPI first (recommended)
116
+ ./scripts/publish.sh --test
117
+ # Or: make publish-test
118
+
119
+ # After testing, publish to PyPI
120
+ ./scripts/publish.sh
121
+ # Or: make publish
122
+ ```
123
+
124
+ ### Project Structure
125
+
126
+ ```
127
+ hezor_common/
128
+ โ”œโ”€โ”€ src/
129
+ โ”‚ โ””โ”€โ”€ hezor_common/
130
+ โ”‚ โ”œโ”€โ”€ __init__.py
131
+ โ”‚ โ””โ”€โ”€ py.typed
132
+ โ”œโ”€โ”€ scripts/
133
+ โ”‚ โ”œโ”€โ”€ build.sh
134
+ โ”‚ โ”œโ”€โ”€ publish.sh
135
+ โ”‚ โ””โ”€โ”€ build-and-publish.sh
136
+ โ”œโ”€โ”€ pyproject.toml
137
+ โ”œโ”€โ”€ README.md
138
+ โ”œโ”€โ”€ LICENSE
139
+ โ”œโ”€โ”€ MANIFEST.in
140
+ โ”œโ”€โ”€ Makefile
141
+ โ””โ”€โ”€ .gitignore
142
+ ```
143
+
144
+ ## License
145
+
146
+ MIT License - see LICENSE file for details.
147
+
@@ -0,0 +1,128 @@
1
+ # Hezor Common
2
+
3
+ Common utilities for Hezor projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install hezor-common
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ from hezor_common import hello
15
+
16
+ print(hello())
17
+ ```
18
+
19
+ ## Development
20
+
21
+ ### Setup
22
+
23
+ ```bash
24
+ # Install uv if not already installed
25
+ curl -LsSf https://astral.sh/uv/install.sh | sh
26
+
27
+ # Create virtual environment and install dependencies
28
+ uv sync
29
+ ```
30
+
31
+ ### Quick Commands (using Makefile)
32
+
33
+ ```bash
34
+ # Show all available commands
35
+ make help
36
+
37
+ # Install dependencies
38
+ make install
39
+
40
+ # Build the package
41
+ make build
42
+
43
+ # Publish to TestPyPI (recommended for testing)
44
+ make publish-test
45
+
46
+ # Publish to PyPI (production)
47
+ make publish
48
+
49
+ # Clean build artifacts
50
+ make clean
51
+ ```
52
+
53
+ ### Manual Build and Publish
54
+
55
+ #### Building
56
+
57
+ ```bash
58
+ # Build the package
59
+ uv build
60
+
61
+ # Or use the build script
62
+ ./scripts/build.sh
63
+ ```
64
+
65
+ #### Publishing to PyPI
66
+
67
+ Before publishing, you need to:
68
+
69
+ 1. **Register on PyPI/TestPyPI**:
70
+ - TestPyPI: https://test.pypi.org/account/register/
71
+ - PyPI: https://pypi.org/account/register/
72
+
73
+ 2. **Configure credentials** (recommended - using API tokens):
74
+ ```bash
75
+ # Create ~/.pypirc file
76
+ cat > ~/.pypirc << EOF
77
+ [distutils]
78
+ index-servers =
79
+ pypi
80
+ testpypi
81
+
82
+ [pypi]
83
+ username = __token__
84
+ password = pypi-your-api-token-here
85
+
86
+ [testpypi]
87
+ username = __token__
88
+ password = pypi-your-test-api-token-here
89
+ EOF
90
+
91
+ chmod 600 ~/.pypirc
92
+ ```
93
+
94
+ 3. **Publish**:
95
+ ```bash
96
+ # Publish to TestPyPI first (recommended)
97
+ ./scripts/publish.sh --test
98
+ # Or: make publish-test
99
+
100
+ # After testing, publish to PyPI
101
+ ./scripts/publish.sh
102
+ # Or: make publish
103
+ ```
104
+
105
+ ### Project Structure
106
+
107
+ ```
108
+ hezor_common/
109
+ โ”œโ”€โ”€ src/
110
+ โ”‚ โ””โ”€โ”€ hezor_common/
111
+ โ”‚ โ”œโ”€โ”€ __init__.py
112
+ โ”‚ โ””โ”€โ”€ py.typed
113
+ โ”œโ”€โ”€ scripts/
114
+ โ”‚ โ”œโ”€โ”€ build.sh
115
+ โ”‚ โ”œโ”€โ”€ publish.sh
116
+ โ”‚ โ””โ”€โ”€ build-and-publish.sh
117
+ โ”œโ”€โ”€ pyproject.toml
118
+ โ”œโ”€โ”€ README.md
119
+ โ”œโ”€โ”€ LICENSE
120
+ โ”œโ”€โ”€ MANIFEST.in
121
+ โ”œโ”€โ”€ Makefile
122
+ โ””โ”€โ”€ .gitignore
123
+ ```
124
+
125
+ ## License
126
+
127
+ MIT License - see LICENSE file for details.
128
+
@@ -0,0 +1,29 @@
1
+ [project]
2
+ name = "hezor-common"
3
+ version = "0.1.0"
4
+ description = "Common utilities for Hezor projects"
5
+ readme = "README.md"
6
+ authors = [{ name = "Silo QIAN", email = "qtisan@hotmail.com" }]
7
+ requires-python = ">=3.12"
8
+ dependencies = []
9
+ classifiers = [
10
+ "Development Status :: 3 - Alpha",
11
+ "Intended Audience :: Developers",
12
+ "License :: OSI Approved :: MIT License",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.12",
15
+ "Programming Language :: Python :: 3.13",
16
+ ]
17
+ keywords = ["hezor", "common", "utilities"]
18
+
19
+ [project.urls]
20
+ Homepage = "https://github.com/lennon/hezor_common"
21
+ Repository = "https://github.com/lennon/hezor_common"
22
+ Issues = "https://github.com/lennon/hezor_common/issues"
23
+
24
+ [build-system]
25
+ requires = ["hatchling"]
26
+ build-backend = "hatchling.build"
27
+
28
+ [tool.hatch.build.targets.wheel]
29
+ packages = ["src/hezor_common"]
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+ # Complete build and publish script for hezor-common package
3
+
4
+ set -e
5
+
6
+ echo "๐Ÿ”„ Building and publishing hezor-common..."
7
+ echo ""
8
+
9
+ # Build
10
+ ./scripts/build.sh
11
+
12
+ echo ""
13
+ echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"
14
+ echo ""
15
+
16
+ # Publish to TestPyPI by default for safety
17
+ ./scripts/publish.sh --test
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+ # Build script for hezor-common package
3
+
4
+ set -e
5
+
6
+ echo "๐Ÿ”จ Building hezor-common package..."
7
+
8
+ # Clean previous builds
9
+ if [ -d "dist" ]; then
10
+ echo "๐Ÿงน Cleaning previous builds..."
11
+ rm -rf dist/
12
+ fi
13
+
14
+ if [ -d "build" ]; then
15
+ rm -rf build/
16
+ fi
17
+
18
+ # Find and remove egg-info directories
19
+ find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
20
+
21
+ # Build the package
22
+ echo "๐Ÿ“ฆ Building package..."
23
+ uv build
24
+
25
+ echo "โœ… Build completed successfully!"
26
+ echo ""
27
+ echo "๐Ÿ“‹ Built packages:"
28
+ ls -lh dist/
29
+
30
+ echo ""
31
+ echo "๐Ÿ’ก To publish to PyPI:"
32
+ echo " ./scripts/publish.sh"
33
+ echo ""
34
+ echo "๐Ÿ’ก To publish to TestPyPI:"
35
+ echo " ./scripts/publish.sh --test"
@@ -0,0 +1,70 @@
1
+ #!/bin/bash
2
+ # Publish script for hezor-common package
3
+
4
+ set -e
5
+
6
+ TEST_PYPI=false
7
+
8
+ # Parse arguments
9
+ while [[ $# -gt 0 ]]; do
10
+ case $1 in
11
+ --test)
12
+ TEST_PYPI=true
13
+ shift
14
+ ;;
15
+ *)
16
+ echo "Unknown option: $1"
17
+ echo "Usage: $0 [--test]"
18
+ exit 1
19
+ ;;
20
+ esac
21
+ done
22
+
23
+ # Check if dist directory exists
24
+ if [ ! -d "dist" ] || [ -z "$(ls -A dist)" ]; then
25
+ echo "โŒ No build found. Please run ./scripts/build.sh first"
26
+ exit 1
27
+ fi
28
+
29
+ # Install twine if not available
30
+ if ! uv pip list | grep -q twine; then
31
+ echo "๐Ÿ“ฆ Installing twine..."
32
+ uv pip install twine
33
+ fi
34
+
35
+ # Publish
36
+ if [ "$TEST_PYPI" = true ]; then
37
+ echo "๐Ÿš€ Publishing to TestPyPI..."
38
+ echo ""
39
+ echo "๐Ÿ“ You will need TestPyPI credentials."
40
+ echo " Sign up at: https://test.pypi.org/account/register/"
41
+ echo ""
42
+ uv run twine upload --repository testpypi dist/*
43
+ echo ""
44
+ echo "โœ… Published to TestPyPI!"
45
+ echo "๐Ÿ”— View at: https://test.pypi.org/project/hezor-common/"
46
+ echo ""
47
+ echo "๐Ÿ’ก To install from TestPyPI:"
48
+ echo " pip install --index-url https://test.pypi.org/simple/ hezor-common"
49
+ else
50
+ echo "๐Ÿš€ Publishing to PyPI..."
51
+ echo ""
52
+ echo "๐Ÿ“ You will need PyPI credentials."
53
+ echo " Sign up at: https://pypi.org/account/register/"
54
+ echo ""
55
+ echo "โš ๏ธ This will publish to the REAL PyPI!"
56
+ read -p "Are you sure you want to continue? (y/N) " -n 1 -r
57
+ echo
58
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
59
+ echo "โŒ Cancelled"
60
+ exit 1
61
+ fi
62
+
63
+ uv run twine upload dist/*
64
+ echo ""
65
+ echo "โœ… Published to PyPI!"
66
+ echo "๐Ÿ”— View at: https://pypi.org/project/hezor-common/"
67
+ echo ""
68
+ echo "๐Ÿ’ก To install:"
69
+ echo " pip install hezor-common"
70
+ fi
@@ -0,0 +1,11 @@
1
+ """Hezor Common - Common utilities for Hezor projects."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ def hello() -> str:
6
+ """Return a greeting message."""
7
+ return "Hello from hezor-common!"
8
+
9
+
10
+ __all__ = ["hello", "__version__"]
11
+
File without changes