diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6eab267 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +__pycache__/ +*.pyc +*.pyo +*.pyd +.Python +env/ +pip-log.txt +pip-delete-this-directory.txt +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.log +.git +.mypy_cache +.pytest_cache +.hypothesis +.venv/ +.env +logs/*.log +*.egg-info/ diff --git a/.gitignore b/.gitignore index 87e7f38..28ec5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ logs/ non_interactive_test.py test_determinism.py test.py -deterministic_test.py \ No newline at end of file +deterministic_test.py +build.ps1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..60242fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Use Python 3.11 slim image for smaller size +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +# Install system dependencies if needed +RUN apt-get update && apt-get install -y \ + gcc \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements first for better caching +COPY requirements.txt . + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY code/ ./code/ +COPY csv_files/ ./csv_files/ +COPY mypy.ini . + +# Create necessary directories +RUN mkdir -p deck_files logs + +# Set the working directory to code for proper imports +WORKDIR /app/code + +# Run the application +CMD ["python", "main.py"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4b0ca0a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "mtg-deckbuilder" +version = "1.0.0" +description = "A command-line tool for building and analyzing Magic: The Gathering decks" +readme = "README.md" +license = {file = "LICENSE"} +authors = [ + {name = "Your Name", email = "your.email@example.com"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +requires-python = ">=3.10" +dependencies = [ + "pandas>=1.5.0", + "inquirer>=3.1.3", + "typing_extensions>=4.5.0", + "fuzzywuzzy>=0.18.0", + "python-Levenshtein>=0.12.0", + "tqdm>=4.66.0", + "scrython>=1.10.0", + "numpy>=1.24.0", + "requests>=2.31.0", + "prettytable>=3.9.0", +] + +[project.optional-dependencies] +dev = [ + "mypy>=1.3.0", + "pandas-stubs>=2.0.0", + "pytest>=8.0.0", +] + +[project.scripts] +mtg-deckbuilder = "code.main:run_menu" + +[project.urls] +Homepage = "https://github.com/mwisnowski/mtg_python_deckbuilder" +Repository = "https://github.com/mwisnowski/mtg_python_deckbuilder" +Issues = "https://github.com/mwisnowski/mtg_python_deckbuilder/issues" + +[tool.setuptools.packages.find] +include = ["code*"] + +[tool.setuptools.package-data] +"*" = ["*.csv"]