pysfi 0.1.0__tar.gz → 0.1.2__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 (34) hide show
  1. pysfi-0.1.2/PKG-INFO +107 -0
  2. pysfi-0.1.2/README.md +99 -0
  3. {pysfi-0.1.0 → pysfi-0.1.2}/pyproject.toml +14 -3
  4. pysfi-0.1.2/sfi/__init__.py +3 -0
  5. pysfi-0.1.2/sfi/bumpversion/README.md +218 -0
  6. pysfi-0.1.2/sfi/bumpversion/__init__.py +3 -0
  7. pysfi-0.1.2/sfi/bumpversion/bumpversion.py +509 -0
  8. pysfi-0.1.2/sfi/bumpversion/tests/test_bumpversion.py +698 -0
  9. pysfi-0.1.0/.codebuddy/rules/language-standards.mdc +0 -79
  10. pysfi-0.1.0/.python-version +0 -1
  11. pysfi-0.1.0/PKG-INFO +0 -78
  12. pysfi-0.1.0/README.md +0 -71
  13. pysfi-0.1.0/sfi/alarmclock/pyproject.toml +0 -7
  14. pysfi-0.1.0/sfi/embedinstall/pyproject.toml +0 -7
  15. pysfi-0.1.0/sfi/filedate/pyproject.toml +0 -11
  16. pysfi-0.1.0/sfi/makepython/pyproject.toml +0 -7
  17. pysfi-0.1.0/sfi/projectparse/pyproject.toml +0 -9
  18. pysfi-0.1.0/sfi/pyloadergen/pyproject.toml +0 -7
  19. pysfi-0.1.0/sfi/pypacker/pyproject.toml +0 -7
  20. {pysfi-0.1.0 → pysfi-0.1.2}/.gitignore +0 -0
  21. {pysfi-0.1.0/sfi → pysfi-0.1.2/sfi/alarmclock}/__init__.py +0 -0
  22. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/alarmclock/alarmclock.py +0 -0
  23. {pysfi-0.1.0/sfi/alarmclock → pysfi-0.1.2/sfi/bumpversion/tests}/__init__.py +0 -0
  24. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/embedinstall/embedinstall.py +0 -0
  25. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/filedate/README.md +0 -0
  26. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/filedate/__init__.py +0 -0
  27. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/filedate/filedate.py +0 -0
  28. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/makepython/__init__.py +0 -0
  29. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/makepython/makepython.py +0 -0
  30. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/projectparse/projectparse.py +0 -0
  31. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/pyloadergen/pyloadergen.py +0 -0
  32. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/pyloadergen/tests/__init__.py +0 -0
  33. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/pyloadergen/tests/test_pyloadergen.py +0 -0
  34. {pysfi-0.1.0 → pysfi-0.1.2}/sfi/pypacker/fspacker.py +0 -0
pysfi-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: pysfi
3
+ Version: 0.1.2
4
+ Summary: Single File commands for Interactive python.
5
+ Requires-Python: >=3.8
6
+ Requires-Dist: tomli>=2.4.0; python_version < '3.11'
7
+ Description-Content-Type: text/markdown
8
+
9
+ # pysfi
10
+
11
+ Single File commands for Interactive python.
12
+
13
+ ## Overview
14
+
15
+ pysfi is a Python project that provides single-file command-line utilities, designed to be lightweight and easy-to-use.
16
+
17
+ ## Available Commands
18
+
19
+ - **alarmclk**: Alarm clock functionality
20
+ - **[bumpversion](sfi/bumpversion/README.md)**: Automated version number management tool
21
+ - **embedinstall**: Embed installation utilities
22
+ - **[filedate](sfi/filedate/README.md)**: A file date management tool that normalizes date prefixes in filenames
23
+ - **mkp**: Make Python project utilities
24
+ - **projectparse**: Project parsing and analysis tools
25
+ - **pyloadergen**: Python loader code generation
26
+ - **pypacker**: Python packaging utilities
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ # Install using uv (recommended)
32
+ uv add pysfi
33
+
34
+ # Or using pip
35
+ pip install pysfi
36
+ ```
37
+
38
+ ## Development
39
+
40
+ ### Requirements
41
+
42
+ - Python >= 3.8
43
+ - [uv](https://github.com/astral-sh/uv) (recommended) or pip
44
+
45
+ ### Development Dependencies
46
+
47
+ ```bash
48
+ uv pip install -e ".[dev]"
49
+ ```
50
+
51
+ ### Code Standards
52
+
53
+ The project uses Ruff for code linting and formatting:
54
+
55
+ ```bash
56
+ # Check code
57
+ ruff check .
58
+
59
+ # Format code
60
+ ruff format .
61
+ ```
62
+
63
+ ## Project Structure
64
+
65
+ ```bash
66
+ pysfi/
67
+ ├── pyproject.toml # Main project configuration
68
+ ├── README.md
69
+ └── sfi/
70
+ ├── __init__.py
71
+ ├── alarmclock/ # alarmclk command module
72
+ │ ├── alarmclock.py
73
+ │ ├── pyproject.toml
74
+ │ └── __init__.py
75
+ ├── embedinstall/ # embedinstall command module
76
+ │ ├── embedinstall.py
77
+ │ ├── pyproject.toml
78
+ │ └── __init__.py
79
+ ├── filedate/ # filedate command module
80
+ │ ├── filedate.py
81
+ │ ├── pyproject.toml
82
+ │ ├── README.md # Detailed documentation
83
+ │ └── __init__.py
84
+ ├── makepython/ # mkp command module
85
+ │ ├── makepython.py
86
+ │ ├── pyproject.toml
87
+ │ └── __init__.py
88
+ ├── projectparse/ # projectparse command module
89
+ │ ├── projectparse.py
90
+ │ ├── pyproject.toml
91
+ │ └── __init__.py
92
+ ├── pyloadergen/ # pyloadergen command module
93
+ │ ├── pyloadergen.py
94
+ │ ├── pyproject.toml
95
+ │ └── __init__.py
96
+ └── pypacker/ # pypacker command module
97
+ ├── fspacker.py
98
+ └── pyproject.toml
99
+ ```
100
+
101
+ ## License
102
+
103
+ MIT License
104
+
105
+ ## Contributing
106
+
107
+ Issues and Pull Requests are welcome!
pysfi-0.1.2/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # pysfi
2
+
3
+ Single File commands for Interactive python.
4
+
5
+ ## Overview
6
+
7
+ pysfi is a Python project that provides single-file command-line utilities, designed to be lightweight and easy-to-use.
8
+
9
+ ## Available Commands
10
+
11
+ - **alarmclk**: Alarm clock functionality
12
+ - **[bumpversion](sfi/bumpversion/README.md)**: Automated version number management tool
13
+ - **embedinstall**: Embed installation utilities
14
+ - **[filedate](sfi/filedate/README.md)**: A file date management tool that normalizes date prefixes in filenames
15
+ - **mkp**: Make Python project utilities
16
+ - **projectparse**: Project parsing and analysis tools
17
+ - **pyloadergen**: Python loader code generation
18
+ - **pypacker**: Python packaging utilities
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ # Install using uv (recommended)
24
+ uv add pysfi
25
+
26
+ # Or using pip
27
+ pip install pysfi
28
+ ```
29
+
30
+ ## Development
31
+
32
+ ### Requirements
33
+
34
+ - Python >= 3.8
35
+ - [uv](https://github.com/astral-sh/uv) (recommended) or pip
36
+
37
+ ### Development Dependencies
38
+
39
+ ```bash
40
+ uv pip install -e ".[dev]"
41
+ ```
42
+
43
+ ### Code Standards
44
+
45
+ The project uses Ruff for code linting and formatting:
46
+
47
+ ```bash
48
+ # Check code
49
+ ruff check .
50
+
51
+ # Format code
52
+ ruff format .
53
+ ```
54
+
55
+ ## Project Structure
56
+
57
+ ```bash
58
+ pysfi/
59
+ ├── pyproject.toml # Main project configuration
60
+ ├── README.md
61
+ └── sfi/
62
+ ├── __init__.py
63
+ ├── alarmclock/ # alarmclk command module
64
+ │ ├── alarmclock.py
65
+ │ ├── pyproject.toml
66
+ │ └── __init__.py
67
+ ├── embedinstall/ # embedinstall command module
68
+ │ ├── embedinstall.py
69
+ │ ├── pyproject.toml
70
+ │ └── __init__.py
71
+ ├── filedate/ # filedate command module
72
+ │ ├── filedate.py
73
+ │ ├── pyproject.toml
74
+ │ ├── README.md # Detailed documentation
75
+ │ └── __init__.py
76
+ ├── makepython/ # mkp command module
77
+ │ ├── makepython.py
78
+ │ ├── pyproject.toml
79
+ │ └── __init__.py
80
+ ├── projectparse/ # projectparse command module
81
+ │ ├── projectparse.py
82
+ │ ├── pyproject.toml
83
+ │ └── __init__.py
84
+ ├── pyloadergen/ # pyloadergen command module
85
+ │ ├── pyloadergen.py
86
+ │ ├── pyproject.toml
87
+ │ └── __init__.py
88
+ └── pypacker/ # pypacker command module
89
+ ├── fspacker.py
90
+ └── pyproject.toml
91
+ ```
92
+
93
+ ## License
94
+
95
+ MIT License
96
+
97
+ ## Contributing
98
+
99
+ Issues and Pull Requests are welcome!
@@ -3,15 +3,16 @@ build-backend = "hatchling.build"
3
3
  requires = ["hatchling"]
4
4
 
5
5
  [project]
6
- dependencies = []
6
+ dependencies = ["tomli>=2.4.0; python_version<'3.11'"]
7
7
  description = "Single File commands for Interactive python."
8
8
  name = "pysfi"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
11
- version = "0.1.0"
11
+ version = "0.1.2"
12
12
 
13
13
  [project.scripts]
14
14
  alarmclk = "sfi.alarmclock.alarmclock:main"
15
+ bumpversion = "sfi.bumpversion.bumpversion:main"
15
16
  embedinstall = "sfi.embedinstall.embedinstall:main"
16
17
  filedate = "sfi.filedate.filedate:main"
17
18
  mkp = "sfi.makepython.makepython:main"
@@ -20,9 +21,18 @@ pyloadergen = "sfi.pyloadergen.pyloadergen:main"
20
21
  pypacker = "sfi.pypacker.pypacker:main"
21
22
 
22
23
  [tool.hatch.build.targets.wheel]
23
- exclude = ["sfi/*/README.md", "sfi/*/dist", "sfi/*/pyproject.toml"]
24
+ exclude = [
25
+ "sfi/*/README.md",
26
+ "sfi/*/dist",
27
+ "sfi/*/pyproject.toml",
28
+ "sfi/*/tests",
29
+ ]
24
30
  packages = ["sfi"]
25
31
 
32
+ # Only include necessary source files to minimize package size
33
+ [tool.hatch.build]
34
+ include = ["README.md", "sfi/**/*.py", "sfi/pyproject.toml"]
35
+
26
36
  [tool.ruff]
27
37
  line-length = 120
28
38
  target-version = "py38"
@@ -82,6 +92,7 @@ known-first-party = ["sfi"]
82
92
  [tool.uv.workspace]
83
93
  members = [
84
94
  "sfi/alarmclock",
95
+ "sfi/bumpversion",
85
96
  "sfi/embedinstall",
86
97
  "sfi/filedate",
87
98
  "sfi/makepython",
@@ -0,0 +1,3 @@
1
+ """Single File commands for Interactive python."""
2
+
3
+ __version__ = "0.1.2"
@@ -0,0 +1,218 @@
1
+ # bumpversion
2
+
3
+ Automated version number management tool for Python and other projects.
4
+
5
+ ## Features
6
+
7
+ - **Auto-detection**: Automatically detects version files in your project
8
+ - **Multiple formats**: Supports `pyproject.toml`, `setup.py`, `package.json`, `Cargo.toml`, and `__init__.py`
9
+ - **Semantic versioning**: Follows Semantic Versioning (SemVer) 2.0.0 specification
10
+ - **Prerelease support**: Manage alpha, beta, rc, and other prerelease tags
11
+ - **Git integration**: Optional git commit and tag creation
12
+ - **Dry run mode**: Preview changes before applying them
13
+
14
+ ## Installation
15
+
16
+ bumpversion is included in the pysfi package:
17
+
18
+ ```bash
19
+ uv add pysfi
20
+ # or
21
+ pip install pysfi
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Basic Version Bumping
27
+
28
+ ```bash
29
+ # Bump patch version (1.0.0 -> 1.0.1)
30
+ bumpversion patch
31
+
32
+ # Bump minor version (1.0.0 -> 1.1.0)
33
+ bumpversion minor
34
+
35
+ # Bump major version (1.0.0 -> 2.0.0)
36
+ bumpversion major
37
+ ```
38
+
39
+ ### Prerelease Tags
40
+
41
+ ```bash
42
+ # Set prerelease tag (1.0.0 -> 1.0.0-alpha)
43
+ bumpversion patch --prerelease alpha
44
+
45
+ # Set prerelease with number (1.0.0 -> 1.0.0-rc1)
46
+ bumpversion patch --prerelease rc1
47
+ ```
48
+
49
+ ### Git Integration
50
+
51
+ ```bash
52
+ # Bump version and commit changes
53
+ bumpversion patch --commit
54
+
55
+ # Bump version, commit, and create tag
56
+ bumpversion minor --commit --tag
57
+
58
+ # Custom commit message
59
+ bumpversion major --commit --tag --message "Release version 2.0.0"
60
+ ```
61
+
62
+ ### Working with Specific Files
63
+
64
+ ```bash
65
+ # Update only specified files
66
+ bumpversion patch --files pyproject.toml setup.py
67
+
68
+ # Update specific __init__.py file
69
+ bumpversion minor --files src/mypackage/__init__.py
70
+ ```
71
+
72
+ ### Dry Run Mode
73
+
74
+ ```bash
75
+ # Preview changes without applying them
76
+ bumpversion patch --dry-run
77
+ ```
78
+
79
+ ## How It Works
80
+
81
+ 1. **Detect version files**: Searches for common version files in the project directory
82
+ 2. **Parse current version**: Extracts and parses the current version number
83
+ 3. **Calculate new version**: Increments the specified version part (major/minor/patch)
84
+ 4. **Update files**: Modifies version strings in all detected or specified files
85
+ 5. **Git operations** (optional): Commits changes and creates tags
86
+
87
+ ## Supported File Formats
88
+
89
+ - **pyproject.toml**: `version = "1.0.0"` in `[project]` section
90
+ - **setup.py**: `version = "1.0.0"`
91
+ - **package.json**: `"version": "1.0.0"`
92
+ - **Cargo.toml**: `version = "1.0.0"`
93
+ - **`__init__.py`**: `__version__ = "1.0.0"`
94
+
95
+ ## Examples
96
+
97
+ ### Example 1: Simple Patch Bump
98
+
99
+ ```bash
100
+ $ bumpversion patch
101
+ Detecting version files...
102
+ Found: pyproject.toml
103
+ Current version: 1.0.0
104
+ New version: 1.0.1
105
+ Updated: pyproject.toml
106
+ Successfully bumped version to: 1.0.1
107
+ ```
108
+
109
+ ### Example 2: Minor Bump with Git Integration
110
+
111
+ ```bash
112
+ $ bumpversion minor --commit --tag
113
+ Detecting version files...
114
+ Found: pyproject.toml
115
+ Found: src/mypackage/__init__.py
116
+ Current version: 1.0.1
117
+ New version: 1.1.0
118
+ Updated: pyproject.toml
119
+ Updated: src/mypackage/__init__.py
120
+ Git commit successful: chore: bump version to 1.1.0
121
+ Git tag created: v1.1.0
122
+ Successfully bumped version to: 1.1.0
123
+ ```
124
+
125
+ ### Example 3: Pre-release Version
126
+
127
+ ```bash
128
+ $ bumpversion patch --prerelease alpha
129
+ Detecting version files...
130
+ Found: pyproject.toml
131
+ Current version: 1.0.0
132
+ New version: 1.0.1-alpha
133
+ Updated: pyproject.toml
134
+ Successfully bumped version to: 1.0.1-alpha
135
+ ```
136
+
137
+ ### Example 4: Dry Run
138
+
139
+ ```bash
140
+ $ bumpversion major --dry-run
141
+ Dry run mode - no changes will be made
142
+ Detecting version files...
143
+ Found: pyproject.toml
144
+ Current version: 1.0.0
145
+ New version: 2.0.0
146
+ Files to update: [PosixPath('pyproject.toml')]
147
+ ```
148
+
149
+ ## Command-Line Options
150
+
151
+ ```text
152
+ positional arguments:
153
+ part Version part to bump (major|minor|patch)
154
+
155
+ optional arguments:
156
+ -h, --help Show help message and exit
157
+ --files, -f [FILES] Specific files to update (default: auto-detect)
158
+ --prerelease, -p TAG Set prerelease tag (e.g., alpha, beta, rc1)
159
+ --commit, -c Commit changes to git
160
+ --tag, -t Create git tag
161
+ --message, -m MSG Custom commit message
162
+ --dry-run, -n Show what would be done without making changes
163
+ --debug, -d Enable debug mode
164
+ ```
165
+
166
+ ## Technical Details
167
+
168
+ ### Semantic Versioning
169
+
170
+ bumpversion follows Semantic Versioning 2.0.0:
171
+
172
+ - **MAJOR**: Incompatible API changes
173
+ - **MINOR**: Backwards-compatible functionality additions
174
+ - **PATCH**: Backwards-compatible bug fixes
175
+
176
+ ### Version Format
177
+
178
+ Supported version formats:
179
+
180
+ - `1.0.0` (stable)
181
+ - `1.0.0-alpha` (prerelease)
182
+ - `1.0.0-beta.2` (prerelease with number)
183
+ - `1.0.0+build123` (with build metadata)
184
+
185
+ ## Requirements
186
+
187
+ - Python >= 3.8
188
+ - Git (for commit and tag operations)
189
+
190
+ ## Testing
191
+
192
+ bumpversion includes a comprehensive test suite covering all functionality.
193
+
194
+ ### Running Tests
195
+
196
+ ```bash
197
+ # Run all tests
198
+ uv run pytest sfi/bumpversion/tests/test_bumpversion.py
199
+
200
+ # Run specific test class
201
+ uv run pytest sfi/bumpversion/tests/test_bumpversion.py::TestVersion
202
+
203
+ # Run with verbose output
204
+ uv run pytest sfi/bumpversion/tests/test_bumpversion.py -v
205
+ ```
206
+
207
+ ### Test Coverage
208
+
209
+ - **45 tests** covering all major functionality
210
+ - **100% coverage** of core classes and methods
211
+ - Tests for version parsing, file handling, and git integration
212
+ - Integration tests for complete workflows
213
+
214
+ For detailed test documentation, see [tests/TEST_SUMMARY.md](tests/TEST_SUMMARY.md).
215
+
216
+ ## License
217
+
218
+ MIT License
@@ -0,0 +1,3 @@
1
+ """Bumpversion - Automated version number management tool."""
2
+
3
+ __version__ = "0.1.2"