mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
Planned first release
This commit is contained in:
parent
36b887c964
commit
6fc859b766
7 changed files with 304 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,3 +16,4 @@ test_determinism.py
|
||||||
test.py
|
test.py
|
||||||
deterministic_test.py
|
deterministic_test.py
|
||||||
build.ps1
|
build.ps1
|
||||||
|
*.bat
|
49
DECK_LIST_DISPLAY_FEATURE.md
Normal file
49
DECK_LIST_DISPLAY_FEATURE.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Test: Deck List Display Feature
|
||||||
|
|
||||||
|
This demonstrates the new feature added for v1.0.0 that automatically displays the completed deck list at the end of the build process.
|
||||||
|
|
||||||
|
## What's New
|
||||||
|
|
||||||
|
When a deck build completes successfully, the application will now:
|
||||||
|
|
||||||
|
1. **Export both CSV and TXT files** (as before)
|
||||||
|
2. **Automatically display the TXT contents** in a formatted box
|
||||||
|
3. **Show a user-friendly message** indicating the list is ready for copy/paste
|
||||||
|
4. **Display the file path** where the deck was saved
|
||||||
|
|
||||||
|
## Example Output
|
||||||
|
|
||||||
|
```
|
||||||
|
============================================================
|
||||||
|
DECK LIST - Atraxa_Superfriends_20250821.txt
|
||||||
|
Ready for copy/paste to Moxfield, EDHREC, or other deck builders
|
||||||
|
============================================================
|
||||||
|
1 Atraxa, Praetors' Voice
|
||||||
|
1 Jace, the Mind Sculptor
|
||||||
|
1 Elspeth, Knight-Errant
|
||||||
|
1 Vraska the Unseen
|
||||||
|
1 Sol Ring
|
||||||
|
1 Command Tower
|
||||||
|
1 Breeding Pool
|
||||||
|
... (rest of deck)
|
||||||
|
============================================================
|
||||||
|
Deck list also saved to: deck_files/Atraxa_Superfriends_20250821.txt
|
||||||
|
============================================================
|
||||||
|
```
|
||||||
|
|
||||||
|
## Benefits
|
||||||
|
|
||||||
|
- **No more hunting for files**: Users see their deck immediately
|
||||||
|
- **Quick upload to online platforms**: Perfect format for Moxfield, EDHREC, etc.
|
||||||
|
- **Still saves to file**: Original file-based workflow unchanged
|
||||||
|
- **Clean formatting**: Easy to read and copy
|
||||||
|
|
||||||
|
## Technical Details
|
||||||
|
|
||||||
|
- Uses the existing `export_decklist_text()` method
|
||||||
|
- Adds new `_display_txt_contents()` method for pretty printing
|
||||||
|
- Only displays on successful deck completion
|
||||||
|
- Handles file errors gracefully with fallback messages
|
||||||
|
- Preserves all existing functionality
|
||||||
|
|
||||||
|
This feature addresses the common user workflow of wanting to immediately share or upload their completed deck lists without navigating the file system.
|
101
GITHUB_RELEASE_CHECKLIST.md
Normal file
101
GITHUB_RELEASE_CHECKLIST.md
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
# GitHub Release Checklist
|
||||||
|
|
||||||
|
## Pre-Release Preparation
|
||||||
|
|
||||||
|
### 1. Version Management
|
||||||
|
- [ ] Update version in `pyproject.toml` (currently 1.0.0)
|
||||||
|
- [ ] Update version in `__init__.py` if applicable
|
||||||
|
- [ ] Update any hardcoded version references
|
||||||
|
|
||||||
|
### 2. Documentation Updates
|
||||||
|
- [ ] Update README.md with latest features
|
||||||
|
- [ ] Update DOCKER.md if needed
|
||||||
|
- [ ] Create/update CHANGELOG.md
|
||||||
|
- [ ] Verify all documentation is current
|
||||||
|
|
||||||
|
### 3. Code Quality
|
||||||
|
- [ ] Run tests: `python -m pytest`
|
||||||
|
- [ ] Check type hints: `mypy code/`
|
||||||
|
- [ ] Lint code if configured
|
||||||
|
- [ ] Verify Docker builds: `docker build -t mtg-deckbuilder .`
|
||||||
|
|
||||||
|
### 4. Final Testing
|
||||||
|
- [ ] Test Docker container functionality
|
||||||
|
- [ ] Test from fresh clone
|
||||||
|
- [ ] Verify all major features work
|
||||||
|
- [ ] Check file persistence in Docker
|
||||||
|
|
||||||
|
## Release Process
|
||||||
|
|
||||||
|
### 1. GitHub Release Creation
|
||||||
|
1. Go to: https://github.com/mwisnowski/mtg_python_deckbuilder/releases
|
||||||
|
2. Click "Create a new release"
|
||||||
|
3. Configure release:
|
||||||
|
- **Tag version**: `v1.0.0` (create new tag)
|
||||||
|
- **Target**: `main` branch
|
||||||
|
- **Release title**: `MTG Python Deckbuilder v1.0.0`
|
||||||
|
- **Description**: Use content from RELEASE_NOTES.md
|
||||||
|
|
||||||
|
### 2. Release Assets (Optional)
|
||||||
|
Consider including:
|
||||||
|
- [ ] Source code (automatic)
|
||||||
|
- [ ] Docker image reference
|
||||||
|
- [ ] Windows executable (if using PyInstaller)
|
||||||
|
- [ ] Requirements file
|
||||||
|
|
||||||
|
### 3. Docker Image Release (Optional)
|
||||||
|
```bash
|
||||||
|
# Build and tag for GitHub Container Registry
|
||||||
|
docker build -t ghcr.io/mwisnowski/mtg-deckbuilder:1.0.0 .
|
||||||
|
docker build -t ghcr.io/mwisnowski/mtg-deckbuilder:latest .
|
||||||
|
|
||||||
|
# Login to GitHub Container Registry
|
||||||
|
echo $GITHUB_TOKEN | docker login ghcr.io -u mwisnowski --password-stdin
|
||||||
|
|
||||||
|
# Push images
|
||||||
|
docker push ghcr.io/mwisnowski/mtg-deckbuilder:1.0.0
|
||||||
|
docker push ghcr.io/mwisnowski/mtg-deckbuilder:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. PyPI Release (Optional)
|
||||||
|
```bash
|
||||||
|
# Build package
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
# Upload to PyPI
|
||||||
|
python -m twine upload dist/*
|
||||||
|
```
|
||||||
|
|
||||||
|
## Post-Release
|
||||||
|
|
||||||
|
### 1. Documentation Updates
|
||||||
|
- [ ] Update README.md with release badge
|
||||||
|
- [ ] Add installation instructions
|
||||||
|
- [ ] Update Docker Hub description if applicable
|
||||||
|
|
||||||
|
### 2. Communication
|
||||||
|
- [ ] Announce on relevant platforms
|
||||||
|
- [ ] Update project status
|
||||||
|
- [ ] Create next milestone/version
|
||||||
|
|
||||||
|
### 3. Cleanup
|
||||||
|
- [ ] Merge any release branches
|
||||||
|
- [ ] Update development branch
|
||||||
|
- [ ] Plan next version features
|
||||||
|
|
||||||
|
## Quick Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check current version
|
||||||
|
grep version pyproject.toml
|
||||||
|
|
||||||
|
# Test Docker build
|
||||||
|
docker build -t mtg-deckbuilder-test .
|
||||||
|
|
||||||
|
# Run final tests
|
||||||
|
python -m pytest
|
||||||
|
mypy code/
|
||||||
|
|
||||||
|
# Create GitHub release (using gh CLI)
|
||||||
|
gh release create v1.0.0 --title "MTG Python Deckbuilder v1.0.0" --notes-file RELEASE_NOTES.md
|
||||||
|
```
|
BIN
README.md
BIN
README.md
Binary file not shown.
116
RELEASE_NOTES.md
Normal file
116
RELEASE_NOTES.md
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
# MTG Python Deckbuilder v1.0.0 Release Notes
|
||||||
|
|
||||||
|
## 🎉 Initial Release
|
||||||
|
|
||||||
|
This is the first stable release of the MTG Python Deckbuilder - a comprehensive command-line tool for building and analyzing Magic: The Gathering Commander/EDH decks.
|
||||||
|
|
||||||
|
## 🚀 Features
|
||||||
|
|
||||||
|
### Core Functionality
|
||||||
|
- **Deck Building**: Create and manage Commander/EDH decks with intelligent card suggestions
|
||||||
|
- **Theme Detection**: Automatically identify and suggest cards based on deck themes and strategies
|
||||||
|
- **Color Identity Support**: Filter cards based on Commander color identity rules
|
||||||
|
- **CSV File Management**: Efficient storage and retrieval of card data
|
||||||
|
- **Card Database**: Comprehensive MTG card database with regular updates
|
||||||
|
- **Instant Export**: Completed deck lists are automatically displayed for easy copy/paste to online deck builders like Moxfield
|
||||||
|
|
||||||
|
### Setup & Management
|
||||||
|
- **Initial Setup**: Automated download and processing of MTG card data
|
||||||
|
- **CSV File Tagging**: Automatically tag cards with themes and strategies
|
||||||
|
- **Commander Validation**: Verify commander legality and format compliance
|
||||||
|
|
||||||
|
### Planned Features
|
||||||
|
- **Price Checking**: From the initial unpolished build I have plans to leverage Scrython for price information (using cheapest print)
|
||||||
|
- **Deck Value**: From the price checking, there's plans to track the deck value, assign a max deck value, and a max per card value
|
||||||
|
- **Non-Singleton Cards**: Also from an unpolished build there's remnants for adding and tracking cards you can have multiple copies of (i.e. Nazgul or Hare Apparent) and use these as a "Hidden" theme
|
||||||
|
- **Further Tag Refinment**: I'm sure there's some missing themes or mis tags, there's honestly far too many cards for me to want to read through and make sure everything is correct, but this will be an evolving project
|
||||||
|
|
||||||
|
## 🐳 Docker Support
|
||||||
|
|
||||||
|
### Easy Deployment
|
||||||
|
- **Cross-platform**: Works on Windows, macOS, and Linux
|
||||||
|
- **No Python Required**: Run without installing Python locally
|
||||||
|
- **File Persistence**: Your decks and data persist between container runs
|
||||||
|
- **Interactive Terminal**: Full menu and keyboard interaction support
|
||||||
|
|
||||||
|
### Quick Start
|
||||||
|
```bash
|
||||||
|
# Linux/macOS
|
||||||
|
./quick-start.sh
|
||||||
|
|
||||||
|
# Windows PowerShell
|
||||||
|
.\run-docker.ps1 compose
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📦 Installation Options
|
||||||
|
|
||||||
|
### Option 1: Docker (Recommended)
|
||||||
|
1. Clone the repository
|
||||||
|
2. Ensure Docker is installed
|
||||||
|
3. Run `./quick-start.sh` (Linux/macOS) or `.\run-docker.ps1 compose` (Windows)
|
||||||
|
|
||||||
|
### Option 2: From Source
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/mwisnowski/mtg_python_deckbuilder.git
|
||||||
|
cd mtg_python_deckbuilder
|
||||||
|
pip install -r requirements.txt
|
||||||
|
python code/main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🗂️ File Structure
|
||||||
|
|
||||||
|
After running, you'll have:
|
||||||
|
```
|
||||||
|
mtg_python_deckbuilder/
|
||||||
|
├── deck_files/ # Your saved decks (CSV and TXT files)
|
||||||
|
├── logs/ # Application logs
|
||||||
|
├── csv_files/ # Card database files
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 System Requirements
|
||||||
|
|
||||||
|
- **Docker**: Latest version recommended
|
||||||
|
- **Python**: 3.11+ (if running from source)
|
||||||
|
- **Memory**: 2GB+ RAM for card database processing
|
||||||
|
- **Storage**: 500MB+ for card data and decks
|
||||||
|
|
||||||
|
## 📋 Dependencies
|
||||||
|
|
||||||
|
### Core Dependencies
|
||||||
|
- pandas >= 1.5.0
|
||||||
|
- inquirer >= 3.1.3
|
||||||
|
- scrython >= 1.10.0
|
||||||
|
- numpy >= 1.24.0
|
||||||
|
- requests >= 2.31.0
|
||||||
|
|
||||||
|
### Development Dependencies
|
||||||
|
- mypy >= 1.3.0
|
||||||
|
- pandas-stubs >= 2.0.0
|
||||||
|
- pytest >= 8.0.0
|
||||||
|
|
||||||
|
## 🐛 Known Issues
|
||||||
|
|
||||||
|
- Initial setup requires internet connection for card data download
|
||||||
|
- Large card database may take time to process on first run
|
||||||
|
- File permissions may show as 'root' when using Docker (normal behavior)
|
||||||
|
|
||||||
|
## 🔄 Breaking Changes
|
||||||
|
|
||||||
|
N/A - Initial release
|
||||||
|
|
||||||
|
## 🙏 Acknowledgments
|
||||||
|
|
||||||
|
- MTG JSON for comprehensive card data
|
||||||
|
- The Python community for excellent libraries
|
||||||
|
- Magic: The Gathering players and deck builders
|
||||||
|
|
||||||
|
## 📞 Support
|
||||||
|
|
||||||
|
- **Issues**: [GitHub Issues](https://github.com/mwisnowski/mtg_python_deckbuilder/issues)
|
||||||
|
- **Documentation**: See README.md and DOCKER.md
|
||||||
|
- **Docker Help**: `./run-docker.sh help`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Full Changelog**: This is the initial release
|
|
@ -87,7 +87,9 @@ class DeckBuilder(
|
||||||
try:
|
try:
|
||||||
import os as _os
|
import os as _os
|
||||||
base, _ext = _os.path.splitext(_os.path.basename(csv_path))
|
base, _ext = _os.path.splitext(_os.path.basename(csv_path))
|
||||||
self.export_decklist_text(filename=base + '.txt') # type: ignore[attr_defined]
|
txt_path = self.export_decklist_text(filename=base + '.txt') # type: ignore[attr-defined]
|
||||||
|
# Display the text file contents for easy copy/paste to online deck builders
|
||||||
|
self._display_txt_contents(txt_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning("Plaintext export failed (non-fatal)")
|
logger.warning("Plaintext export failed (non-fatal)")
|
||||||
end_ts = datetime.datetime.now()
|
end_ts = datetime.datetime.now()
|
||||||
|
@ -99,6 +101,38 @@ class DeckBuilder(
|
||||||
logger.exception("Deck build failed with exception")
|
logger.exception("Deck build failed with exception")
|
||||||
self.output_func(f"Deck build failed: {e}")
|
self.output_func(f"Deck build failed: {e}")
|
||||||
|
|
||||||
|
def _display_txt_contents(self, txt_path: str):
|
||||||
|
"""Display the contents of the exported .txt file for easy copy/paste to online deck builders."""
|
||||||
|
try:
|
||||||
|
import os
|
||||||
|
if not os.path.exists(txt_path):
|
||||||
|
self.output_func("Warning: Text file not found for display.")
|
||||||
|
return
|
||||||
|
|
||||||
|
with open(txt_path, 'r', encoding='utf-8') as f:
|
||||||
|
contents = f.read().strip()
|
||||||
|
|
||||||
|
if not contents:
|
||||||
|
self.output_func("Warning: Text file is empty.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Create a nice display format
|
||||||
|
filename = os.path.basename(txt_path)
|
||||||
|
separator = "=" * 60
|
||||||
|
|
||||||
|
self.output_func(f"\n{separator}")
|
||||||
|
self.output_func(f"DECK LIST - {filename}")
|
||||||
|
self.output_func("Ready for copy/paste to Moxfield, EDHREC, or other deck builders")
|
||||||
|
self.output_func(f"{separator}")
|
||||||
|
self.output_func(contents)
|
||||||
|
self.output_func(f"{separator}")
|
||||||
|
self.output_func(f"Deck list also saved to: {txt_path}")
|
||||||
|
self.output_func(f"{separator}\n")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Failed to display text file contents: {e}")
|
||||||
|
self.output_func(f"Warning: Could not display deck list contents. Check {txt_path} manually.")
|
||||||
|
|
||||||
def add_creatures_phase(self):
|
def add_creatures_phase(self):
|
||||||
"""Run the creature addition phase (delegated to CreatureAdditionMixin)."""
|
"""Run the creature addition phase (delegated to CreatureAdditionMixin)."""
|
||||||
if hasattr(super(), 'add_creatures_phase'):
|
if hasattr(super(), 'add_creatures_phase'):
|
||||||
|
|
|
@ -22,7 +22,7 @@ classifiers = [
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
]
|
]
|
||||||
requires-python = ">=3.13" # This is what it was built with anyway
|
requires-python = ">=3.11" # This is what it was built with anyway
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pandas>=1.5.0",
|
"pandas>=1.5.0",
|
||||||
"inquirer>=3.1.3",
|
"inquirer>=3.1.3",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue