From 6fc859b766f33eeab4f156d7b71ad9c9f4749495 Mon Sep 17 00:00:00 2001 From: mwisnowski Date: Thu, 21 Aug 2025 10:50:22 -0700 Subject: [PATCH] Planned first release --- .gitignore | 3 +- DECK_LIST_DISPLAY_FEATURE.md | 49 +++++++++++++++ GITHUB_RELEASE_CHECKLIST.md | 101 ++++++++++++++++++++++++++++++ README.md | Bin 5002 -> 18590 bytes RELEASE_NOTES.md | 116 +++++++++++++++++++++++++++++++++++ code/deck_builder/builder.py | 36 ++++++++++- pyproject.toml | 2 +- 7 files changed, 304 insertions(+), 3 deletions(-) create mode 100644 DECK_LIST_DISPLAY_FEATURE.md create mode 100644 GITHUB_RELEASE_CHECKLIST.md create mode 100644 RELEASE_NOTES.md diff --git a/.gitignore b/.gitignore index 28ec5b7..a2bc12a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ non_interactive_test.py test_determinism.py test.py deterministic_test.py -build.ps1 \ No newline at end of file +build.ps1 +*.bat \ No newline at end of file diff --git a/DECK_LIST_DISPLAY_FEATURE.md b/DECK_LIST_DISPLAY_FEATURE.md new file mode 100644 index 0000000..91338fb --- /dev/null +++ b/DECK_LIST_DISPLAY_FEATURE.md @@ -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. diff --git a/GITHUB_RELEASE_CHECKLIST.md b/GITHUB_RELEASE_CHECKLIST.md new file mode 100644 index 0000000..8507aae --- /dev/null +++ b/GITHUB_RELEASE_CHECKLIST.md @@ -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 +``` diff --git a/README.md b/README.md index 2160c24364e7f825b88cc4ce75437324a26c89b9..aa2d5c578761116d5aa4dabeb61a6a2e8d22aadb 100644 GIT binary patch literal 18590 zcmdU%OK+T48OL8CR!E2qJ3yM&(6|@dxwKrWxRPT#jhnbJv7w+8C64VlCcfcuk|yec zufejPfDgb5#0nPdzzf>$_!x!%@BHWSIp>{sY=;)AYUFt4opYZ1{T%1tpN%!W=JL_s z{@H65o0aBmeOhXsHiylFX0O@Rr@3aMS!*6P_nJq|R+?bL&E^~F=XUc#bGx~r zZ`SmDx9RKOH??cASrD{eHRFPFsMo%}d9#_)YpdC5Hk(O(exUao31VNLw}fv>SXPB$ zQ_rVbP$vd3Cqx~)wzd9Ag7aAGU+%=UC%mR=Pt+eI8Yi{yKs%-cp`^O6C#L%4g0or{ zmxS+vUaxjyJ3D9lg@h-X40S^MZ;R56Q}}u!&f&d;llfXtlG#lXLYi<^@-(OK(I|TS zd>R5%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KF@4JO-o<){2SA( zs~s=kA@$z&!{2nhr=!!F^ei1p)%kwcK7HN0XNt$?(~I~Whzt=aS&II@3x(-w2goz8 zkeBsyo{9oJw@E)|jl&944L&iiHR+wAr%Ql=r&Ka&e!S7SXazjAV(^R!ahwtJJXjRW zcRi!VF7QGT;3FMAICLUiI@NXi4D#)&tfxOTtShbiNg8>i=P|+X34}rmm~5}**?#&L DnO;7! diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..55de78b --- /dev/null +++ b/RELEASE_NOTES.md @@ -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 diff --git a/code/deck_builder/builder.py b/code/deck_builder/builder.py index 4c0effe..d4359f5 100644 --- a/code/deck_builder/builder.py +++ b/code/deck_builder/builder.py @@ -87,7 +87,9 @@ class DeckBuilder( try: import os as _os 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: logger.warning("Plaintext export failed (non-fatal)") end_ts = datetime.datetime.now() @@ -99,6 +101,38 @@ class DeckBuilder( logger.exception("Deck build failed with exception") 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): """Run the creature addition phase (delegated to CreatureAdditionMixin).""" if hasattr(super(), 'add_creatures_phase'): diff --git a/pyproject.toml b/pyproject.toml index b1e5a45..fa8cd85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "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 = [ "pandas>=1.5.0", "inquirer>=3.1.3",