diff --git a/.gitignore b/.gitignore index 32df70c..1fd1dae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,146 +1,2 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# static files generated from Django application using `collectstatic` -media -static - # IDE .idea/ diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..8df6e1b --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,146 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# static files generated from Django application using `collectstatic` +media +static + +# IDE +../.idea/ diff --git a/model/__init__.py b/server/model/__init__.py similarity index 100% rename from model/__init__.py rename to server/model/__init__.py diff --git a/model/animals.py b/server/model/animals.py similarity index 100% rename from model/animals.py rename to server/model/animals.py diff --git a/model/card.py b/server/model/card.py similarity index 100% rename from model/card.py rename to server/model/card.py diff --git a/model/data.py b/server/model/data.py similarity index 95% rename from model/data.py rename to server/model/data.py index 4a6d1ac..b68d4b8 100644 --- a/model/data.py +++ b/server/model/data.py @@ -3,10 +3,10 @@ from collections import defaultdict from dataclasses import dataclass from typing import List, Dict, Optional -from model.animals import random_animal_name -from model.card import Card -from model.deck import Deck -from model.hand import Hand +from server.model.hand import Hand +from server.model.animals import random_animal_name +from server.model.card import Card +from server.model.deck import Deck @dataclass @@ -93,7 +93,7 @@ class Game: else: # Next player, announce or menteur announce = current_player.announce(current_bet) if announce.bet: - while announce.bet.value() < current_bet.value(): # Bad announce! + while announce.bet.value() < current_bet.value(): # Bad announce! print(f"Invalid bet, {announce.bet} < {current_bet}!") announce = current_player.announce(current_bet) current_bet = announce.bet diff --git a/model/deck.py b/server/model/deck.py similarity index 94% rename from model/deck.py rename to server/model/deck.py index 4cdf951..0a67670 100644 --- a/model/deck.py +++ b/server/model/deck.py @@ -1,6 +1,6 @@ from random import randrange, shuffle -from model.card import Card, Value, Color +from server.model.card import Card, Value, Color class Deck: diff --git a/model/hand.py b/server/model/hand.py similarity index 98% rename from model/hand.py rename to server/model/hand.py index ecc6699..58b8a20 100644 --- a/model/hand.py +++ b/server/model/hand.py @@ -1,7 +1,7 @@ from collections import Counter from typing import List -from model.card import Card +from server.model.card import Card class Hand: diff --git a/model/hands.py b/server/model/hands.py similarity index 95% rename from model/hands.py rename to server/model/hands.py index 34a4666..7904faa 100644 --- a/model/hands.py +++ b/server/model/hands.py @@ -1,5 +1,5 @@ -from model.hand import Hand -from model.card import Value, Color, Card +from server.model.hand import Hand +from server.model.card import Value, Color, Card def carre(value) -> Hand: diff --git a/model/known.py b/server/model/known.py similarity index 83% rename from model/known.py rename to server/model/known.py index d43183d..d0acae6 100644 --- a/model/known.py +++ b/server/model/known.py @@ -1,5 +1,5 @@ -from model.card import Value, Color, Card -from model.hands import pair, single, double_pair, brelan, full, carre +from server.model.card import Value, Color, Card +from server.model.hands import pair, single, double_pair, brelan, full, carre ACE_OF_HEARTS = Card(Value.Ace, Color.Hearts) ACE_OF_SPADES = Card(Value.Ace, Color.Spades) diff --git a/requirements.txt b/server/requirements.txt similarity index 100% rename from requirements.txt rename to server/requirements.txt diff --git a/test/__init__.py b/server/test/__init__.py similarity index 100% rename from test/__init__.py rename to server/test/__init__.py diff --git a/test/test_data.py b/server/test/test_data.py similarity index 96% rename from test/test_data.py rename to server/test/test_data.py index c4ef4b1..22d56f5 100644 --- a/test/test_data.py +++ b/server/test/test_data.py @@ -1,11 +1,11 @@ from unittest import TestCase -from model.data import Player -from model.deck import Deck -from model.hand import Hand -from model.card import Value, Color, Card -from model.hands import full, brelan, pair, single, double_pair, carre -from model.known import ACE_OF_HEARTS, PAIR_ACE, SINGLE_ACE, DOUBLE_PAIR_ACE, BRELAN_ACE, FULL_ACE +from server.model.data import Player +from server.model.deck import Deck +from server.model.hand import Hand +from server.model.card import Value, Color, Card +from server.model.hands import full, brelan, pair, single, double_pair, carre +from server.model.known import ACE_OF_HEARTS, PAIR_ACE, SINGLE_ACE, DOUBLE_PAIR_ACE, BRELAN_ACE, FULL_ACE class TestDeck(TestCase): diff --git a/test/test_game.py b/server/test/test_game.py similarity index 96% rename from test/test_game.py rename to server/test/test_game.py index 023a1b7..2dbfe19 100644 --- a/test/test_game.py +++ b/server/test/test_game.py @@ -1,6 +1,6 @@ from unittest import TestCase -from model.data import Game, Player +from server.model.data import Game, Player class TestGame(TestCase):