mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 11:33:25 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3c31f02f3 | ||
|
|
eb46b3c7ed | ||
|
|
cf250c4089 | ||
|
|
d19fb730d2 | ||
|
|
60302e18d3 | ||
|
|
db39c02e30 | ||
|
|
f7270e7afc |
+1
-1
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
- **GitHub Actions CI** (`ci.yml`): runs tests + mypy on Python 3.12 for every push to `main` and all PRs
|
- **GitHub Actions CI** (`ci.yml`): runs tests + mypy on Python 3.12 for every push to `main` and all PRs
|
||||||
- **GitHub Actions Release** (`release.yml`): triggered by `v*.*.*` tags — runs tests, builds wheel + tarball, publishes packages as GitHub Release assets (`moma-X.Y.Z.whl`, `moma-latest.whl`, etc.)
|
- **GitHub Actions Release** (`release.yml`): triggered by `v*.*.*` tags — runs tests, builds wheel + tarball, publishes packages as GitHub Release assets (`moma-X.Y.Z-py3-none-any.whl`, `moma-X.Y.Z.tar.gz`, `moma-latest.tar.gz`)
|
||||||
- **TMDB credentials in Settings**: `tmdb_api_key` and `tmdb_access_token` are now stored in `~/.config/moma/config.json` and editable via the Settings screen (`p`)
|
- **TMDB credentials in Settings**: `tmdb_api_key` and `tmdb_access_token` are now stored in `~/.config/moma/config.json` and editable via the Settings screen (`p`)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
+16
-10
@@ -24,19 +24,25 @@ powershell -c "irm https://astral.sh/uv/install.sh | iex"
|
|||||||
|
|
||||||
#### Install moma
|
#### Install moma
|
||||||
```bash
|
```bash
|
||||||
# Always-latest stable URL (recommended)
|
# Always-latest (recommended, no version to update)
|
||||||
uv tool install https://github.com/shadoll/moma/releases/latest/download/moma-latest.whl
|
uv tool install https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz
|
||||||
|
|
||||||
# Specific version
|
# Specific version
|
||||||
uv tool install https://github.com/shadoll/moma/releases/download/v0.8.11/moma-0.8.11.whl
|
uv tool install https://github.com/shadoll/moma/releases/download/v0.9.3/moma-0.9.3-py3-none-any.whl
|
||||||
|
|
||||||
# From a locally downloaded wheel
|
|
||||||
uv tool install moma-latest.whl
|
|
||||||
|
|
||||||
# From PyPI (when published)
|
# From PyPI (when published)
|
||||||
uv tool install moma
|
uv tool install moma
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Reinstall / Upgrade moma
|
||||||
|
```bash
|
||||||
|
# Reinstall (same URL — force overwrite)
|
||||||
|
uv tool install --force https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz
|
||||||
|
|
||||||
|
# Upgrade to a newer specific version
|
||||||
|
uv tool install --force https://github.com/shadoll/moma/releases/download/v0.9.3/moma-0.9.3-py3-none-any.whl
|
||||||
|
```
|
||||||
|
|
||||||
#### Usage
|
#### Usage
|
||||||
```bash
|
```bash
|
||||||
moma # Scan current directory
|
moma # Scan current directory
|
||||||
@@ -46,11 +52,11 @@ moma /path/to/directory # Scan specific directory
|
|||||||
### Method 2: pip Install from Wheel
|
### Method 2: pip Install from Wheel
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Always-latest stable URL
|
# Always-latest (recommended, no version to update)
|
||||||
pip install https://github.com/shadoll/moma/releases/latest/download/moma-latest.whl
|
pip install https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz
|
||||||
|
|
||||||
# From a locally downloaded wheel
|
# Specific version
|
||||||
pip install moma-latest.whl
|
pip install https://github.com/shadoll/moma/releases/download/v0.9.3/moma-0.9.3-py3-none-any.whl
|
||||||
```
|
```
|
||||||
|
|
||||||
### Method 3: Development Installation
|
### Method 3: Development Installation
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
# Bump patch version in pyproject.toml and INSTALL.md
|
||||||
|
bump:
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import re
|
||||||
|
with open('pyproject.toml', 'r') as f:
|
||||||
|
content = f.read()
|
||||||
|
m = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
|
||||||
|
if m:
|
||||||
|
old = m.group(1) + '.' + m.group(2) + '.' + m.group(3)
|
||||||
|
major, minor, patch = map(int, m.groups())
|
||||||
|
new = f'{major}.{minor}.{patch + 1}'
|
||||||
|
with open('pyproject.toml', 'w') as f:
|
||||||
|
f.write(content.replace(m.group(0), f'version = "{new}"'))
|
||||||
|
with open('INSTALL.md', 'r') as f:
|
||||||
|
install = f.read()
|
||||||
|
with open('INSTALL.md', 'w') as f:
|
||||||
|
f.write(install.replace(old, new))
|
||||||
|
print(f'Version bumped to {new}')
|
||||||
|
else:
|
||||||
|
print('Version not found')
|
||||||
|
|
||||||
|
# Bump version, sync dependencies, and build package
|
||||||
|
release: bump
|
||||||
|
uv sync
|
||||||
|
uv build
|
||||||
|
@echo "Release process completed successfully!"
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
test:
|
||||||
|
uv run pytest
|
||||||
|
|
||||||
|
# Tag the current version from pyproject.toml and push to origin
|
||||||
|
git-release:
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def read_version():
|
||||||
|
with open('pyproject.toml', 'r') as f:
|
||||||
|
content = f.read()
|
||||||
|
m = re.search(r'version = "(\d+\.\d+\.\d+)"', content)
|
||||||
|
return m.group(1) if m else None
|
||||||
|
|
||||||
|
def tag_exists(tag):
|
||||||
|
local = subprocess.run(['git', 'tag', '-l', tag], capture_output=True, text=True)
|
||||||
|
if local.stdout.strip():
|
||||||
|
return True
|
||||||
|
remote = subprocess.run(['git', 'ls-remote', '--tags', 'origin', f'refs/tags/{tag}'], capture_output=True, text=True)
|
||||||
|
return bool(remote.stdout.strip())
|
||||||
|
|
||||||
|
def do_bump():
|
||||||
|
with open('pyproject.toml', 'r') as f:
|
||||||
|
content = f.read()
|
||||||
|
m = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
|
||||||
|
if not m:
|
||||||
|
print('Version not found in pyproject.toml')
|
||||||
|
sys.exit(1)
|
||||||
|
old = m.group(0).split('"')[1]
|
||||||
|
major, minor, patch = map(int, m.groups())
|
||||||
|
new = f'{major}.{minor}.{patch + 1}'
|
||||||
|
with open('pyproject.toml', 'w') as f:
|
||||||
|
f.write(content.replace(m.group(0), f'version = "{new}"'))
|
||||||
|
with open('INSTALL.md', 'r') as f:
|
||||||
|
install = f.read()
|
||||||
|
with open('INSTALL.md', 'w') as f:
|
||||||
|
f.write(install.replace(old, new))
|
||||||
|
print(f'Version bumped to {new}')
|
||||||
|
return new
|
||||||
|
|
||||||
|
version = read_version()
|
||||||
|
if not version:
|
||||||
|
print('Could not read version from pyproject.toml')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
tag = f'v{version}'
|
||||||
|
|
||||||
|
if tag_exists(tag):
|
||||||
|
print(f'Tag {tag} already exists.')
|
||||||
|
print(' [c] Cancel')
|
||||||
|
print(' [b] Bump version and continue')
|
||||||
|
print(' [r] Replace tag (delete and re-create)')
|
||||||
|
choice = input('Your choice (c/b/r): ').strip().lower()
|
||||||
|
if choice == 'c' or choice == '':
|
||||||
|
print('Cancelled.')
|
||||||
|
sys.exit(0)
|
||||||
|
elif choice == 'b':
|
||||||
|
version = do_bump()
|
||||||
|
tag = f'v{version}'
|
||||||
|
elif choice == 'r':
|
||||||
|
print(f'Deleting tag {tag} locally and on origin...')
|
||||||
|
subprocess.run(['git', 'tag', '-d', tag])
|
||||||
|
subprocess.run(['git', 'push', 'origin', f':refs/tags/{tag}'])
|
||||||
|
else:
|
||||||
|
print('Unknown choice, cancelling.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print(f'Creating tag {tag}...')
|
||||||
|
subprocess.run(['git', 'tag', tag], check=True)
|
||||||
|
print(f'Pushing tag {tag} to origin...')
|
||||||
|
subprocess.run(['git', 'push', 'origin', tag], check=True)
|
||||||
|
print(f'Done! Tag {tag} pushed.')
|
||||||
|
|
||||||
|
# Run the application
|
||||||
|
run *ARGS:
|
||||||
|
uv run moma {{ARGS}}
|
||||||
+10
-4
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "moma"
|
name = "moma"
|
||||||
version = "0.9.0"
|
version = "0.9.3"
|
||||||
description = "Terminal-based media file renamer and metadata viewer"
|
description = "Terminal-based media file renamer and metadata viewer"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
@@ -22,9 +22,15 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
moma = "main:main"
|
moma = "src.main:main"
|
||||||
bump-version = "bump:main"
|
|
||||||
release = "release:main"
|
[build-system]
|
||||||
|
requires = ["setuptools>=61"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
where = ["."]
|
||||||
|
include = ["src*"]
|
||||||
|
|
||||||
[tool.uv]
|
[tool.uv]
|
||||||
package = true
|
package = true
|
||||||
|
|||||||
@@ -4,12 +4,19 @@ def main():
|
|||||||
content = f.read()
|
content = f.read()
|
||||||
match = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
|
match = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
|
||||||
if match:
|
if match:
|
||||||
|
old_version = match.group(1) + '.' + match.group(2) + '.' + match.group(3)
|
||||||
major, minor, patch = map(int, match.groups())
|
major, minor, patch = map(int, match.groups())
|
||||||
patch += 1
|
patch += 1
|
||||||
new_version = f'{major}.{minor}.{patch}'
|
new_version = f'{major}.{minor}.{patch}'
|
||||||
content = content.replace(match.group(0), f'version = "{new_version}"')
|
content = content.replace(match.group(0), f'version = "{new_version}"')
|
||||||
with open('pyproject.toml', 'w') as f:
|
with open('pyproject.toml', 'w') as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
# Update version references in INSTALL.md
|
||||||
|
with open('INSTALL.md', 'r') as f:
|
||||||
|
install = f.read()
|
||||||
|
install = install.replace(old_version, new_version)
|
||||||
|
with open('INSTALL.md', 'w') as f:
|
||||||
|
f.write(install)
|
||||||
print(f'Version bumped to {new_version}')
|
print(f'Version bumped to {new_version}')
|
||||||
else:
|
else:
|
||||||
print('Version not found')
|
print('Version not found')
|
||||||
@@ -11,14 +11,8 @@ class RenameConfirmScreen(Screen):
|
|||||||
#confirm_content {
|
#confirm_content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
# Button {
|
|
||||||
# background: $surface;
|
|
||||||
# border: solid $surface;
|
|
||||||
}
|
|
||||||
Button:focus {
|
Button:focus {
|
||||||
background: $primary;
|
background: $primary;
|
||||||
# color: $text-primary;
|
|
||||||
# border: solid $primary;
|
|
||||||
}
|
}
|
||||||
#buttons {
|
#buttons {
|
||||||
align: center middle;
|
align: center middle;
|
||||||
|
|||||||
Reference in New Issue
Block a user