Skip to content

Commit

Permalink
remove usage of old Random2 backport (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored Sep 15, 2024
1 parent b74dcde commit d7c145a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install:
- copy %PYTHON%\python.exe %PYTHON%\python3.exe
- SET PATH=%PYTHON%;%PYTHON%\Scripts;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- python3 -mpip install Pillow attrs configobj flake8 flake8-import-order
pycotap pygame pyinstaller pysol-cards random2 setuptools six
pycotap pygame pyinstaller pysol-cards setuptools six
ttkthemes
- perl -v
- copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 flake8-import-order \
attrs configobj pycotap pysol-cards random2 setuptools six
attrs configobj pycotap pysol-cards setuptools six
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --no-binary=Pillow \
Pillow attrs configobj py2app pycotap pygame pysol-cards random2 setuptools six ttkthemes
Pillow attrs configobj py2app pycotap pygame pysol-cards setuptools six ttkthemes
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
brew install create-dmg
- name: Get cardsets
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ install:
# Tests are failing for them sometimes
- cpanm --notest Capture::Tiny IPC::System::Simple
- cpanm Code::TidyAll::Plugin::Flake8 Perl::Tidy Test::Code::TidyAll Test::Differences Test::TrailingSpace
- export PY_MODS='attrs configobj pycotap pysol-cards random2 setuptools six'
- export PY_MODS='attrs configobj pycotap pysol-cards setuptools six'
- if test "$TRAVIS_OS_NAME" = "osx" ; then export PY_MODS="--no-binary=Pillow Pillow $PY_MODS" ; fi
- sudo -H pip3 install --upgrade wheel
- sudo -H pip3 install --upgrade $PY_MODS flake8 flake8-import-order
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,19 @@ per the instructions above.
At the moment, this only works on POSIX (Linux, FreeBSD and similar) systems.
Windows and Mac users - you'll need to chip in with a script for your system.

#### 1 - Install build prerequisites: six, random2 and pysol-cards
#### 1 - Install build prerequisites: six and pysol-cards

This is kind of stupid and maybe it can be fixed in the future, but for now:

```
pip install six
pip install random2
pip install pysol-cards
```

You may want to use your OS distribution package system instead, for example:

```
sudo apt-get install python-six
sudo apt-get install python-random2
sudo apt-get install python3-six
```

For Pillow compilation, libjpeg headers and libraries need to be available:
Expand Down
2 changes: 1 addition & 1 deletion buildozer/buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version.filename = %(source.dir)s/version.txt

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy,pysol-cards,random2,configobj,attrs
requirements = python3,kivy,pysol-cards,configobj,attrs

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
Expand Down
2 changes: 1 addition & 1 deletion contrib/install-pysolfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PIP="${PKGTREE}/env/bin/pip"
PYPROG="${PKGTREE}/env/bin/python"
VERSION="$(env PYTHONPATH=`pwd` "$PYPROG" -c 'from pysollib.settings import VERSION ; print(VERSION)')"
XZBALL="dist/PySolFC-${VERSION}.tar.xz"
reqs=(pillow pygame random2 six)
reqs=(pillow pygame six)

make dist

Expand Down
5 changes: 2 additions & 3 deletions pysollib/game/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@


import math
import random
import time
import traceback
from pickle import Pickler, Unpickler, UnpicklingError
Expand Down Expand Up @@ -67,8 +68,6 @@
from pysollib.settings import VERSION, VERSION_TUPLE
from pysollib.struct_new import NewStruct

import random2

import six
from six import BytesIO
from six.moves import range
Expand Down Expand Up @@ -3363,7 +3362,7 @@ def validate(v, txt):
game.random = construct_random(initial_seed)
state = pload()
if (game.random is not None and
not isinstance(game.random, random2.Random) and
not isinstance(game.random, random.Random) and
isinstance(state, int)):
game.random.setstate(state)
# if not hasattr(game.random, "origin"):
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ def get_data_files(source, destination):
'author': 'Skomoroh',
'author_email': '[email protected]',
'description': 'a Python solitaire game collection',
'classifiers': [
'Programming Language :: Python :: 3',
],
'install_requires': [
'attrs>=18.2.0',
'configobj',
'pysol_cards',
'random2',
'six',
],
'long_description': long_description,
Expand Down

0 comments on commit d7c145a

Please sign in to comment.