micropython-branch-manager 1.0.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.
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/a/1/9/5/3/a19537d3cf37c122db841d6fe4cd322bc10d1a558bb00d146b85cb9a +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/a/1/9/5/3/a19537d3cf37c122db841d6fe4cd322bc10d1a558bb00d146b85cb9a.body +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/a/d/e/e/f/adeef5b9611702687bbddade5f7c0af65110caf98ba1a0070c9d116e +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/a/d/e/e/f/adeef5b9611702687bbddade5f7c0af65110caf98ba1a0070c9d116e.body +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/c/f/1/5/2/cf15267d3214bcebfb45f9129289da1bc680548558df960836a4dd28 +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/c/f/1/5/2/cf15267d3214bcebfb45f9129289da1bc680548558df960836a4dd28.body +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/d/4/8/2/b/d482b9a98a05fe6bde057de4d9ca6873d02b38378b2f695e530470f7 +0 -0
- micropython_branch_manager-1.0.0/.cache/pip/http-v2/d/4/8/2/b/d482b9a98a05fe6bde057de4d9ca6873d02b38378b2f695e530470f7.body +361 -0
- micropython_branch_manager-1.0.0/.cache/pip/selfcheck/fe300af6f7d708c14827daac3afc81fbb8306b73de8dd6e3f1f8ea3b +1 -0
- micropython_branch_manager-1.0.0/.gitignore +25 -0
- micropython_branch_manager-1.0.0/.gitlab-ci.yml +58 -0
- micropython_branch_manager-1.0.0/.pre-commit-config.yaml +25 -0
- micropython_branch_manager-1.0.0/.python-version +1 -0
- micropython_branch_manager-1.0.0/CLAUDE.md +163 -0
- micropython_branch_manager-1.0.0/LICENSE +21 -0
- micropython_branch_manager-1.0.0/PKG-INFO +389 -0
- micropython_branch_manager-1.0.0/README.md +378 -0
- micropython_branch_manager-1.0.0/docs/gitlab_mr_example.png +0 -0
- micropython_branch_manager-1.0.0/pyproject.toml +53 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/__init__.py +5 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/__main__.py +6 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/_version.py +34 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/branch_sync.py +85 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/cli.py +189 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/config.py +64 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/exceptions.py +59 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/git.py +246 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/github.py +105 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/pr.py +191 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/rebase.py +405 -0
- micropython_branch_manager-1.0.0/src/micropython_branch_manager/update_branch.py +122 -0
- micropython_branch_manager-1.0.0/tests/conftest.py +142 -0
- micropython_branch_manager-1.0.0/tests/test_branch_sync.py +131 -0
- micropython_branch_manager-1.0.0/tests/test_config.py +110 -0
- micropython_branch_manager-1.0.0/tests/test_exceptions.py +54 -0
- micropython_branch_manager-1.0.0/tests/test_git.py +264 -0
- micropython_branch_manager-1.0.0/tests/test_github.py +99 -0
- micropython_branch_manager-1.0.0/tests/test_integration.py +110 -0
- micropython_branch_manager-1.0.0/tests/test_update_branch.py +115 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: uv
|
|
3
|
+
Version: 0.9.17
|
|
4
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Topic :: Software Development :: Testing
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
+
License-File: LICENSE-APACHE
|
|
23
|
+
License-File: LICENSE-MIT
|
|
24
|
+
Summary: An extremely fast Python package and project manager, written in Rust.
|
|
25
|
+
Keywords: uv,requirements,packaging
|
|
26
|
+
Home-Page: https://pypi.org/project/uv/
|
|
27
|
+
Author-email: "Astral Software Inc." <hey@astral.sh>
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
30
|
+
Project-URL: Repository, https://github.com/astral-sh/uv
|
|
31
|
+
Project-URL: Documentation, https://docs.astral.sh/uv
|
|
32
|
+
Project-URL: Changelog, https://github.com/astral-sh/uv/blob/main/CHANGELOG.md
|
|
33
|
+
Project-URL: Releases, https://github.com/astral-sh/uv/releases
|
|
34
|
+
Project-URL: Discord, https://discord.gg/astral-sh
|
|
35
|
+
|
|
36
|
+
# uv
|
|
37
|
+
|
|
38
|
+
[](https://github.com/astral-sh/uv)
|
|
39
|
+
[](https://pypi.python.org/pypi/uv)
|
|
40
|
+
[](https://pypi.python.org/pypi/uv)
|
|
41
|
+
[](https://pypi.python.org/pypi/uv)
|
|
42
|
+
[](https://github.com/astral-sh/uv/actions)
|
|
43
|
+
[](https://discord.gg/astral-sh)
|
|
44
|
+
|
|
45
|
+
An extremely fast Python package and project manager, written in Rust.
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<img alt="Shows a bar chart with benchmark results." src="https://github.com/astral-sh/uv/assets/1309177/629e59c0-9c6e-4013-9ad4-adb2bcf5080d">
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<i>Installing <a href="https://trio.readthedocs.io/">Trio</a>'s dependencies with a warm cache.</i>
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
## Highlights
|
|
56
|
+
|
|
57
|
+
- 🚀 A single tool to replace `pip`, `pip-tools`, `pipx`, `poetry`, `pyenv`, `twine`, `virtualenv`,
|
|
58
|
+
and more.
|
|
59
|
+
- ⚡️ [10-100x faster](https://github.com/astral-sh/uv/blob/main/BENCHMARKS.md) than `pip`.
|
|
60
|
+
- 🗂️ Provides [comprehensive project management](https://github.com/astral-sh/uv/blob/0.9.17/README.md#projects), with a
|
|
61
|
+
[universal lockfile](https://docs.astral.sh/uv/concepts/projects/layout#the-lockfile).
|
|
62
|
+
- ❇️ [Runs scripts](https://github.com/astral-sh/uv/blob/0.9.17/README.md#scripts), with support for
|
|
63
|
+
[inline dependency metadata](https://docs.astral.sh/uv/guides/scripts#declaring-script-dependencies).
|
|
64
|
+
- 🐍 [Installs and manages](https://github.com/astral-sh/uv/blob/0.9.17/README.md#python-versions) Python versions.
|
|
65
|
+
- 🛠️ [Runs and installs](https://github.com/astral-sh/uv/blob/0.9.17/README.md#tools) tools published as Python packages.
|
|
66
|
+
- 🔩 Includes a [pip-compatible interface](https://github.com/astral-sh/uv/blob/0.9.17/README.md#the-pip-interface) for a performance boost with a
|
|
67
|
+
familiar CLI.
|
|
68
|
+
- 🏢 Supports Cargo-style [workspaces](https://docs.astral.sh/uv/concepts/projects/workspaces) for
|
|
69
|
+
scalable projects.
|
|
70
|
+
- 💾 Disk-space efficient, with a [global cache](https://docs.astral.sh/uv/concepts/cache) for
|
|
71
|
+
dependency deduplication.
|
|
72
|
+
- ⏬ Installable without Rust or Python via `curl` or `pip`.
|
|
73
|
+
- 🖥️ Supports macOS, Linux, and Windows.
|
|
74
|
+
|
|
75
|
+
uv is backed by [Astral](https://astral.sh), the creators of
|
|
76
|
+
[Ruff](https://github.com/astral-sh/ruff).
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
Install uv with our standalone installers:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# On macOS and Linux.
|
|
84
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# On Windows.
|
|
89
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or, from [PyPI](https://pypi.org/project/uv/):
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# With pip.
|
|
96
|
+
pip install uv
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Or pipx.
|
|
101
|
+
pipx install uv
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If installed via the standalone installer, uv can update itself to the latest version:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
uv self update
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See the [installation documentation](https://docs.astral.sh/uv/getting-started/installation/) for
|
|
111
|
+
details and alternative installation methods.
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
uv's documentation is available at [docs.astral.sh/uv](https://docs.astral.sh/uv).
|
|
116
|
+
|
|
117
|
+
Additionally, the command line reference documentation can be viewed with `uv help`.
|
|
118
|
+
|
|
119
|
+
## Features
|
|
120
|
+
|
|
121
|
+
### Projects
|
|
122
|
+
|
|
123
|
+
uv manages project dependencies and environments, with support for lockfiles, workspaces, and more,
|
|
124
|
+
similar to `rye` or `poetry`:
|
|
125
|
+
|
|
126
|
+
```console
|
|
127
|
+
$ uv init example
|
|
128
|
+
Initialized project `example` at `/home/user/example`
|
|
129
|
+
|
|
130
|
+
$ cd example
|
|
131
|
+
|
|
132
|
+
$ uv add ruff
|
|
133
|
+
Creating virtual environment at: .venv
|
|
134
|
+
Resolved 2 packages in 170ms
|
|
135
|
+
Built example @ file:///home/user/example
|
|
136
|
+
Prepared 2 packages in 627ms
|
|
137
|
+
Installed 2 packages in 1ms
|
|
138
|
+
+ example==0.1.0 (from file:///home/user/example)
|
|
139
|
+
+ ruff==0.5.0
|
|
140
|
+
|
|
141
|
+
$ uv run ruff check
|
|
142
|
+
All checks passed!
|
|
143
|
+
|
|
144
|
+
$ uv lock
|
|
145
|
+
Resolved 2 packages in 0.33ms
|
|
146
|
+
|
|
147
|
+
$ uv sync
|
|
148
|
+
Resolved 2 packages in 0.70ms
|
|
149
|
+
Audited 1 package in 0.02ms
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See the [project documentation](https://docs.astral.sh/uv/guides/projects/) to get started.
|
|
153
|
+
|
|
154
|
+
uv also supports building and publishing projects, even if they're not managed with uv. See the
|
|
155
|
+
[publish guide](https://docs.astral.sh/uv/guides/publish/) to learn more.
|
|
156
|
+
|
|
157
|
+
### Scripts
|
|
158
|
+
|
|
159
|
+
uv manages dependencies and environments for single-file scripts.
|
|
160
|
+
|
|
161
|
+
Create a new script and add inline metadata declaring its dependencies:
|
|
162
|
+
|
|
163
|
+
```console
|
|
164
|
+
$ echo 'import requests; print(requests.get("https://astral.sh"))' > example.py
|
|
165
|
+
|
|
166
|
+
$ uv add --script example.py requests
|
|
167
|
+
Updated `example.py`
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Then, run the script in an isolated virtual environment:
|
|
171
|
+
|
|
172
|
+
```console
|
|
173
|
+
$ uv run example.py
|
|
174
|
+
Reading inline script metadata from: example.py
|
|
175
|
+
Installed 5 packages in 12ms
|
|
176
|
+
<Response [200]>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
See the [scripts documentation](https://docs.astral.sh/uv/guides/scripts/) to get started.
|
|
180
|
+
|
|
181
|
+
### Tools
|
|
182
|
+
|
|
183
|
+
uv executes and installs command-line tools provided by Python packages, similar to `pipx`.
|
|
184
|
+
|
|
185
|
+
Run a tool in an ephemeral environment using `uvx` (an alias for `uv tool run`):
|
|
186
|
+
|
|
187
|
+
```console
|
|
188
|
+
$ uvx pycowsay 'hello world!'
|
|
189
|
+
Resolved 1 package in 167ms
|
|
190
|
+
Installed 1 package in 9ms
|
|
191
|
+
+ pycowsay==0.0.0.2
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
------------
|
|
195
|
+
< hello world! >
|
|
196
|
+
------------
|
|
197
|
+
\ ^__^
|
|
198
|
+
\ (oo)\_______
|
|
199
|
+
(__)\ )\/\
|
|
200
|
+
||----w |
|
|
201
|
+
|| ||
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Install a tool with `uv tool install`:
|
|
205
|
+
|
|
206
|
+
```console
|
|
207
|
+
$ uv tool install ruff
|
|
208
|
+
Resolved 1 package in 6ms
|
|
209
|
+
Installed 1 package in 2ms
|
|
210
|
+
+ ruff==0.5.0
|
|
211
|
+
Installed 1 executable: ruff
|
|
212
|
+
|
|
213
|
+
$ ruff --version
|
|
214
|
+
ruff 0.5.0
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
See the [tools documentation](https://docs.astral.sh/uv/guides/tools/) to get started.
|
|
218
|
+
|
|
219
|
+
### Python versions
|
|
220
|
+
|
|
221
|
+
uv installs Python and allows quickly switching between versions.
|
|
222
|
+
|
|
223
|
+
Install multiple Python versions:
|
|
224
|
+
|
|
225
|
+
```console
|
|
226
|
+
$ uv python install 3.10 3.11 3.12
|
|
227
|
+
Searching for Python versions matching: Python 3.10
|
|
228
|
+
Searching for Python versions matching: Python 3.11
|
|
229
|
+
Searching for Python versions matching: Python 3.12
|
|
230
|
+
Installed 3 versions in 3.42s
|
|
231
|
+
+ cpython-3.10.14-macos-aarch64-none
|
|
232
|
+
+ cpython-3.11.9-macos-aarch64-none
|
|
233
|
+
+ cpython-3.12.4-macos-aarch64-none
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Download Python versions as needed:
|
|
237
|
+
|
|
238
|
+
```console
|
|
239
|
+
$ uv venv --python 3.12.0
|
|
240
|
+
Using Python 3.12.0
|
|
241
|
+
Creating virtual environment at: .venv
|
|
242
|
+
Activate with: source .venv/bin/activate
|
|
243
|
+
|
|
244
|
+
$ uv run --python pypy@3.8 -- python --version
|
|
245
|
+
Python 3.8.16 (a9dbdca6fc3286b0addd2240f11d97d8e8de187a, Dec 29 2022, 11:45:30)
|
|
246
|
+
[PyPy 7.3.11 with GCC Apple LLVM 13.1.6 (clang-1316.0.21.2.5)] on darwin
|
|
247
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
248
|
+
>>>>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Use a specific Python version in the current directory:
|
|
252
|
+
|
|
253
|
+
```console
|
|
254
|
+
$ uv python pin 3.11
|
|
255
|
+
Pinned `.python-version` to `3.11`
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
See the [Python installation documentation](https://docs.astral.sh/uv/guides/install-python/) to get
|
|
259
|
+
started.
|
|
260
|
+
|
|
261
|
+
### The pip interface
|
|
262
|
+
|
|
263
|
+
uv provides a drop-in replacement for common `pip`, `pip-tools`, and `virtualenv` commands.
|
|
264
|
+
|
|
265
|
+
uv extends their interfaces with advanced features, such as dependency version overrides,
|
|
266
|
+
platform-independent resolutions, reproducible resolutions, alternative resolution strategies, and
|
|
267
|
+
more.
|
|
268
|
+
|
|
269
|
+
Migrate to uv without changing your existing workflows — and experience a 10-100x speedup — with the
|
|
270
|
+
`uv pip` interface.
|
|
271
|
+
|
|
272
|
+
Compile requirements into a platform-independent requirements file:
|
|
273
|
+
|
|
274
|
+
```console
|
|
275
|
+
$ uv pip compile docs/requirements.in \
|
|
276
|
+
--universal \
|
|
277
|
+
--output-file docs/requirements.txt
|
|
278
|
+
Resolved 43 packages in 12ms
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Create a virtual environment:
|
|
282
|
+
|
|
283
|
+
```console
|
|
284
|
+
$ uv venv
|
|
285
|
+
Using Python 3.12.3
|
|
286
|
+
Creating virtual environment at: .venv
|
|
287
|
+
Activate with: source .venv/bin/activate
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Install the locked requirements:
|
|
291
|
+
|
|
292
|
+
```console
|
|
293
|
+
$ uv pip sync docs/requirements.txt
|
|
294
|
+
Resolved 43 packages in 11ms
|
|
295
|
+
Installed 43 packages in 208ms
|
|
296
|
+
+ babel==2.15.0
|
|
297
|
+
+ black==24.4.2
|
|
298
|
+
+ certifi==2024.7.4
|
|
299
|
+
...
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
See the [pip interface documentation](https://docs.astral.sh/uv/pip/index/) to get started.
|
|
303
|
+
|
|
304
|
+
## Platform support
|
|
305
|
+
|
|
306
|
+
See uv's [platform support](https://docs.astral.sh/uv/reference/platforms/) document.
|
|
307
|
+
|
|
308
|
+
## Versioning policy
|
|
309
|
+
|
|
310
|
+
See uv's [versioning policy](https://docs.astral.sh/uv/reference/versioning/) document.
|
|
311
|
+
|
|
312
|
+
## Contributing
|
|
313
|
+
|
|
314
|
+
We are passionate about supporting contributors of all levels of experience and would love to see
|
|
315
|
+
you get involved in the project. See the
|
|
316
|
+
[contributing guide](https://github.com/astral-sh/uv/blob/main/CONTRIBUTING.md) to get started.
|
|
317
|
+
|
|
318
|
+
## FAQ
|
|
319
|
+
|
|
320
|
+
#### How do you pronounce uv?
|
|
321
|
+
|
|
322
|
+
It's pronounced as "you - vee" ([`/juː viː/`](https://en.wikipedia.org/wiki/Help:IPA/English#Key))
|
|
323
|
+
|
|
324
|
+
#### How should I stylize uv?
|
|
325
|
+
|
|
326
|
+
Just "uv", please. See the [style guide](https://github.com/astral-sh/uv/blob/0.9.17/STYLE.md#styling-uv) for details.
|
|
327
|
+
|
|
328
|
+
## Acknowledgements
|
|
329
|
+
|
|
330
|
+
uv's dependency resolver uses [PubGrub](https://github.com/pubgrub-rs/pubgrub) under the hood. We're
|
|
331
|
+
grateful to the PubGrub maintainers, especially [Jacob Finkelman](https://github.com/Eh2406), for
|
|
332
|
+
their support.
|
|
333
|
+
|
|
334
|
+
uv's Git implementation is based on [Cargo](https://github.com/rust-lang/cargo).
|
|
335
|
+
|
|
336
|
+
Some of uv's optimizations are inspired by the great work we've seen in [pnpm](https://pnpm.io/),
|
|
337
|
+
[Orogene](https://github.com/orogene/orogene), and [Bun](https://github.com/oven-sh/bun). We've also
|
|
338
|
+
learned a lot from Nathaniel J. Smith's [Posy](https://github.com/njsmith/posy) and adapted its
|
|
339
|
+
[trampoline](https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline)
|
|
340
|
+
for Windows support.
|
|
341
|
+
|
|
342
|
+
## License
|
|
343
|
+
|
|
344
|
+
uv is licensed under either of
|
|
345
|
+
|
|
346
|
+
- Apache License, Version 2.0, ([LICENSE-APACHE](https://github.com/astral-sh/uv/blob/0.9.17/LICENSE-APACHE) or
|
|
347
|
+
<https://www.apache.org/licenses/LICENSE-2.0>)
|
|
348
|
+
- MIT license ([LICENSE-MIT](https://github.com/astral-sh/uv/blob/0.9.17/LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
|
|
349
|
+
|
|
350
|
+
at your option.
|
|
351
|
+
|
|
352
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in uv
|
|
353
|
+
by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any
|
|
354
|
+
additional terms or conditions.
|
|
355
|
+
|
|
356
|
+
<div align="center">
|
|
357
|
+
<a target="_blank" href="https://astral.sh" style="background:none">
|
|
358
|
+
<img src="https://raw.githubusercontent.com/astral-sh/uv/main/assets/svg/Astral.svg" alt="Made by Astral">
|
|
359
|
+
</a>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"key":"/usr/local","last_check":"2025-12-11T00:12:10.256978+00:00","pypi_version":"25.3"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv
|
|
11
|
+
|
|
12
|
+
# Testing
|
|
13
|
+
.coverage
|
|
14
|
+
coverage.xml
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.vscode/
|
|
19
|
+
.idea/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
|
|
23
|
+
# uv
|
|
24
|
+
uv.lock
|
|
25
|
+
src/micropython_branch_manager/_version.py
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
image: python:3.11-slim
|
|
2
|
+
|
|
3
|
+
variables:
|
|
4
|
+
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
5
|
+
GIT_DEPTH: 0 # Fetch full git history including tags for hatch-vcs
|
|
6
|
+
|
|
7
|
+
cache:
|
|
8
|
+
paths:
|
|
9
|
+
- .cache/pip
|
|
10
|
+
- .venv
|
|
11
|
+
|
|
12
|
+
stages:
|
|
13
|
+
- lint
|
|
14
|
+
- test
|
|
15
|
+
- build
|
|
16
|
+
- deploy
|
|
17
|
+
|
|
18
|
+
before_script:
|
|
19
|
+
- apt-get update -qq && apt-get install -y -qq git # Required for hatch-vcs
|
|
20
|
+
- pip install uv
|
|
21
|
+
- git fetch --tags # Ensure tags are available for hatch-vcs
|
|
22
|
+
- uv sync
|
|
23
|
+
|
|
24
|
+
lint:
|
|
25
|
+
stage: lint
|
|
26
|
+
script:
|
|
27
|
+
- uv run ruff check .
|
|
28
|
+
- uv run ruff format --check .
|
|
29
|
+
- uv run mypy src/micropython_branch_manager
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
stage: test
|
|
33
|
+
script:
|
|
34
|
+
- uv run pytest tests/ -v --cov=micropython_branch_manager --cov-report=xml --cov-report=term
|
|
35
|
+
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/'
|
|
36
|
+
artifacts:
|
|
37
|
+
reports:
|
|
38
|
+
coverage_report:
|
|
39
|
+
coverage_format: cobertura
|
|
40
|
+
path: coverage.xml
|
|
41
|
+
|
|
42
|
+
build:
|
|
43
|
+
stage: build
|
|
44
|
+
script:
|
|
45
|
+
- uv build
|
|
46
|
+
artifacts:
|
|
47
|
+
paths:
|
|
48
|
+
- dist/*.whl
|
|
49
|
+
- dist/*.tar.gz
|
|
50
|
+
|
|
51
|
+
deploy:
|
|
52
|
+
stage: deploy
|
|
53
|
+
dependencies:
|
|
54
|
+
- build
|
|
55
|
+
only:
|
|
56
|
+
- tags
|
|
57
|
+
script:
|
|
58
|
+
- uv publish --username "$PYPI_USER" --password "$PYPI_PASS"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.8.2
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
+
rev: v1.13.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: mypy
|
|
13
|
+
additional_dependencies: [pydantic>=2.0, cyclopts>=3.0]
|
|
14
|
+
args: [--strict]
|
|
15
|
+
exclude: ^tests/
|
|
16
|
+
|
|
17
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
18
|
+
rev: v5.0.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: trailing-whitespace
|
|
21
|
+
- id: end-of-file-fixer
|
|
22
|
+
- id: check-yaml
|
|
23
|
+
- id: check-json
|
|
24
|
+
- id: check-toml
|
|
25
|
+
- id: check-merge-conflict
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`micropython-branch-manager` (alias: `mbm`) is a Python CLI tool that automates maintaining a MicroPython fork with multiple feature branches integrated on top of upstream. It manages rebasing integration branches with preserved merge commits, adding PRs, tracking branch metadata in JSON config, and generating GitLab MR URLs.
|
|
8
|
+
|
|
9
|
+
## Development Commands
|
|
10
|
+
|
|
11
|
+
### Setup
|
|
12
|
+
```bash
|
|
13
|
+
uv sync
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Running the tool locally
|
|
17
|
+
```bash
|
|
18
|
+
uv run mbm --help
|
|
19
|
+
uv run mbm init --integration-branch main
|
|
20
|
+
uv run mbm rebase upstream/master
|
|
21
|
+
uv run mbm add-pr 12345
|
|
22
|
+
uv run mbm sync
|
|
23
|
+
uv run mbm config
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Testing
|
|
27
|
+
```bash
|
|
28
|
+
# Run all tests with coverage
|
|
29
|
+
uv run pytest tests/ -v --cov=micropython_branch_manager --cov-report=xml --cov-report=term
|
|
30
|
+
|
|
31
|
+
# Run specific test file
|
|
32
|
+
uv run pytest tests/test_specific.py -v
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Linting and Type Checking
|
|
36
|
+
```bash
|
|
37
|
+
# Run all lint/type checks and formatting (recommended)
|
|
38
|
+
uv run pre-commit run --all-files
|
|
39
|
+
|
|
40
|
+
# Run ruff linter
|
|
41
|
+
uv run ruff check .
|
|
42
|
+
|
|
43
|
+
# Auto-fix ruff issues
|
|
44
|
+
uv run ruff check . --fix
|
|
45
|
+
|
|
46
|
+
# Format code
|
|
47
|
+
uv run ruff format .
|
|
48
|
+
|
|
49
|
+
# Type check with mypy
|
|
50
|
+
uv run mypy src/micropython_branch_manager
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Pre-commit Hooks
|
|
54
|
+
```bash
|
|
55
|
+
# Install hooks
|
|
56
|
+
uv run pre-commit install
|
|
57
|
+
|
|
58
|
+
# Run on all files
|
|
59
|
+
uv run pre-commit run --all-files
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Building
|
|
63
|
+
```bash
|
|
64
|
+
# Build wheel and sdist
|
|
65
|
+
uv build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Architecture
|
|
69
|
+
|
|
70
|
+
### Core Workflow Model
|
|
71
|
+
|
|
72
|
+
The tool operates on a MicroPython submodule directory containing a JSON config file (`.micropython-branches.json`). The workflow assumes:
|
|
73
|
+
|
|
74
|
+
1. **Integration branch** - A branch (typically `main`) that contains merge commits of multiple feature branches on top of upstream
|
|
75
|
+
2. **Feature branches** - Individual branches from upstream PRs or local development, tracked in GitHub forks
|
|
76
|
+
3. **Update branches** - Temporary branches created during rebase operations for GitLab MR creation
|
|
77
|
+
4. **Branch metadata** - Stored in JSON config with remote, PR URL, PR number, and title
|
|
78
|
+
|
|
79
|
+
### Module Responsibilities
|
|
80
|
+
|
|
81
|
+
- **cli.py** - Command-line interface using cyclopts. Entry point for all commands.
|
|
82
|
+
- **config.py** - Pydantic models for JSON configuration (`MicroPythonConfig`, `BranchConfig`). Handles load/save operations.
|
|
83
|
+
- **git.py** - Git operations wrapper (`GitRepo` class). Executes git commands and detects conflict states.
|
|
84
|
+
- **branch_sync.py** - Branch detection and synchronization. Extracts branch names from merge commit messages using regex pattern `Merge branch '([^']+)'`.
|
|
85
|
+
- **rebase.py** - Orchestrates full rebase workflow via `RebaseManager`. Includes branch validation, PR info lookup, rebase execution, divergence checks, and push operations.
|
|
86
|
+
- **pr.py** - PR addition workflow via `PRManager`. Fetches PR from upstream, merges into update branch, updates config, optionally commits to parent repo.
|
|
87
|
+
- **github.py** - GitHub API wrapper using `gh` CLI for PR metadata lookup.
|
|
88
|
+
- **update_branch.py** - Update branch creation and GitLab MR URL generation.
|
|
89
|
+
- **exceptions.py** - Custom exceptions for git conflicts, divergence, and errors.
|
|
90
|
+
|
|
91
|
+
### Git Operations Flow
|
|
92
|
+
|
|
93
|
+
**Rebase workflow:**
|
|
94
|
+
1. Load config and ensure remotes exist
|
|
95
|
+
2. Fetch from remotes (unless `--local`)
|
|
96
|
+
3. Extract branches from merge commits between target and integration branch
|
|
97
|
+
4. Validate detected branches against JSON config
|
|
98
|
+
5. Create update branch from integration branch
|
|
99
|
+
6. Rebase with `--rebase-merges --update-refs` to preserve merge structure
|
|
100
|
+
7. Check for remote divergence before force-pushing
|
|
101
|
+
8. Push feature branches to their configured remotes (GitHub forks)
|
|
102
|
+
9. Push update branch to GitLab for MR creation
|
|
103
|
+
10. Generate GitLab MR URL
|
|
104
|
+
|
|
105
|
+
**PR addition workflow:**
|
|
106
|
+
1. Parse PR identifier (number, URL, or branch name)
|
|
107
|
+
2. Fetch PR metadata using `gh` CLI
|
|
108
|
+
3. Create update branch from integration branch
|
|
109
|
+
4. Fetch PR branch from upstream: `git fetch upstream pull/{number}/head:{branch}`
|
|
110
|
+
5. Merge PR branch with merge commit
|
|
111
|
+
6. Update JSON config with new branch entry
|
|
112
|
+
7. Optionally commit submodule and config changes to parent repo
|
|
113
|
+
8. Generate GitLab MR URL
|
|
114
|
+
|
|
115
|
+
### Push Strategy
|
|
116
|
+
|
|
117
|
+
- **Feature branches** - Pushed to their respective GitHub forks (remote specified in config for that branch)
|
|
118
|
+
- **Integration/update branches** - Pushed to GitLab (remote typically "origin")
|
|
119
|
+
- Update branch is used for creating merge requests back to integration branch
|
|
120
|
+
|
|
121
|
+
### Error Handling
|
|
122
|
+
|
|
123
|
+
The tool uses custom exceptions with structured error data:
|
|
124
|
+
|
|
125
|
+
- `RebaseConflictError` - Raised when rebase encounters conflicts. Includes list of conflicting files and instructions for manual resolution.
|
|
126
|
+
- `MergeConflictError` - Raised when PR merge encounters conflicts. Similar structure to rebase conflicts.
|
|
127
|
+
- `RemoteDivergenceError` - Raised when remote branch has commits not in local branch. Includes commit counts and suggests options (fetch, force-push, abort).
|
|
128
|
+
- `WorkingTreeDirtyError` - Raised when working tree has uncommitted changes.
|
|
129
|
+
|
|
130
|
+
Conflict detection uses `git status --porcelain` to identify files with conflict markers (`UU`, `AA`, `DD` prefixes).
|
|
131
|
+
|
|
132
|
+
## Configuration File
|
|
133
|
+
|
|
134
|
+
`.micropython-branches.json` structure:
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"integration_branch": "main",
|
|
138
|
+
"remotes": {
|
|
139
|
+
"upstream": "https://github.com/micropython/micropython.git",
|
|
140
|
+
"origin": "git@github.com:username/micropython.git"
|
|
141
|
+
},
|
|
142
|
+
"branches": [
|
|
143
|
+
{
|
|
144
|
+
"name": "feature-branch-1",
|
|
145
|
+
"remote": "origin",
|
|
146
|
+
"pr_url": "https://github.com/micropython/micropython/pull/12345",
|
|
147
|
+
"pr_number": 12345,
|
|
148
|
+
"title": "Add feature X"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"gh_author": "username"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Dependencies
|
|
156
|
+
|
|
157
|
+
- **pydantic** - Config models with validation
|
|
158
|
+
- **cyclopts** - CLI framework
|
|
159
|
+
- **GitHub CLI (`gh`)** - PR metadata lookup (optional, warnings issued if not found)
|
|
160
|
+
|
|
161
|
+
## Testing Notes
|
|
162
|
+
|
|
163
|
+
Test files should be placed in `tests/` directory. The project uses pytest with coverage reporting configured in `pyproject.toml`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Andrew Leech
|
|
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.
|