Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pysol-cards for openSUSE:Factory checked in at 2025-09-30 17:41:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pysol-cards (Old) and /work/SRC/openSUSE:Factory/.python-pysol-cards.new.11973 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pysol-cards" Tue Sep 30 17:41:47 2025 rev:8 rq:1308069 version:0.24.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pysol-cards/python-pysol-cards.changes 2025-02-25 16:48:34.953405852 +0100 +++ /work/SRC/openSUSE:Factory/.python-pysol-cards.new.11973/python-pysol-cards.changes 2025-09-30 17:43:43.672650416 +0200 @@ -1,0 +2,8 @@ +Mon Sep 29 21:22:20 UTC 2025 - Dirk Müller <[email protected]> + +- update to 0.24.0: + * Add pysol_cards.gen_multi_cli for generating ranges of deals. + * Add tests and documentation for "pysol_cards.cwrap" . + * Add "pysol_cards.cwrap" . + +------------------------------------------------------------------- Old: ---- pysol_cards-0.18.1.tar.gz New: ---- pysol_cards-0.24.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pysol-cards.spec ++++++ --- /var/tmp/diff_new_pack.oeqHbF/_old 2025-09-30 17:43:44.392680731 +0200 +++ /var/tmp/diff_new_pack.oeqHbF/_new 2025-09-30 17:43:44.396680899 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pysol-cards # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # Copyright (c) 2020 Malcolm J Lewis <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} Name: python-pysol-cards -Version: 0.18.1 +Version: 0.24.0 Release: 0 Summary: Python module for pysol-cards License: Apache-2.0 ++++++ pysol_cards-0.18.1.tar.gz -> pysol_cards-0.24.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/CHANGELOG.rst new/pysol_cards-0.24.0/CHANGELOG.rst --- old/pysol_cards-0.18.1/CHANGELOG.rst 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/CHANGELOG.rst 2025-06-13 15:43:46.000000000 +0200 @@ -5,8 +5,8 @@ :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. :License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.) -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index:: CHANGELOG @@ -19,6 +19,21 @@ Version History =============== +0.24.0 +------ + +* Add pysol_cards.gen_multi_cli for generating ranges of deals. + +0.22.0 +------ + +* Add tests and documentation for "pysol_cards.cwrap" . + +0.20.0 +------ + +* Add "pysol_cards.cwrap" . + 0.18.1 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/PKG-INFO new/pysol_cards-0.24.0/PKG-INFO --- old/pysol_cards-0.18.1/PKG-INFO 2025-02-11 08:15:43.059038200 +0100 +++ new/pysol_cards-0.24.0/PKG-INFO 2025-06-13 15:43:55.774971700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pysol_cards -Version: 0.18.1 +Version: 0.24.0 Summary: Deal PySol FC Cards Home-page: https://github.com/shlomif/pysol_cards Author: Shlomi Fish @@ -26,8 +26,8 @@ :Info: This is the README file for pysol_cards. :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index: README .. image:: https://travis-ci.org/shlomif/pysol_cards.svg?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/README new/pysol_cards-0.24.0/README --- old/pysol_cards-0.18.1/README 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/README 2025-06-13 15:43:46.000000000 +0200 @@ -4,8 +4,8 @@ :Info: This is the README file for pysol_cards. :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index: README .. image:: https://travis-ci.org/shlomif/pysol_cards.svg?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/README.rst new/pysol_cards-0.24.0/README.rst --- old/pysol_cards-0.18.1/README.rst 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/README.rst 2025-06-13 15:43:46.000000000 +0200 @@ -4,8 +4,8 @@ :Info: This is the README file for pysol_cards. :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index: README .. image:: https://travis-ci.org/shlomif/pysol_cards.svg?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/docs/CHANGELOG.rst new/pysol_cards-0.24.0/docs/CHANGELOG.rst --- old/pysol_cards-0.18.1/docs/CHANGELOG.rst 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/docs/CHANGELOG.rst 2025-06-13 15:43:46.000000000 +0200 @@ -5,8 +5,8 @@ :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. :License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.) -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index:: CHANGELOG diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/docs/LICENSE.rst new/pysol_cards-0.24.0/docs/LICENSE.rst --- old/pysol_cards-0.18.1/docs/LICENSE.rst 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/docs/LICENSE.rst 2025-06-13 15:43:46.000000000 +0200 @@ -5,8 +5,8 @@ :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. :License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.) -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index:: LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/docs/README.rst new/pysol_cards-0.24.0/docs/README.rst --- old/pysol_cards-0.18.1/docs/README.rst 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/docs/README.rst 2025-06-13 15:43:46.000000000 +0200 @@ -4,8 +4,8 @@ :Info: This is the README file for pysol_cards. :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index: README .. image:: https://travis-ci.org/shlomif/pysol_cards.svg?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/docs/conf.py new/pysol_cards-0.24.0/docs/conf.py --- old/pysol_cards-0.18.1/docs/conf.py 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/docs/conf.py 2025-06-13 15:43:46.000000000 +0200 @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '0.18.1' +version = '0.24.0' # The full version, including alpha/beta/rc tags. -release = '0.18.1' +release = '0.24.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/pysol_cards/__init__.py new/pysol_cards-0.24.0/pysol_cards/__init__.py --- old/pysol_cards-0.18.1/pysol_cards/__init__.py 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/pysol_cards/__init__.py 2025-06-13 15:43:46.000000000 +0200 @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -# pysol_cards v0.18.1 +# pysol_cards v0.24.0 # Deal PySol FC Cards # Copyright © 2020, Shlomi Fish. # All rights reserved. @@ -40,7 +40,7 @@ """ __title__ = 'pysol_cards' -__version__ = '0.18.1' +__version__ = '0.24.0' __author__ = 'Shlomi Fish' __license__ = '3-clause BSD' __docformat__ = 'restructuredtext en' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/pysol_cards/cwrap.py new/pysol_cards-0.24.0/pysol_cards/cwrap.py --- old/pysol_cards-0.18.1/pysol_cards/cwrap.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pysol_cards-0.24.0/pysol_cards/cwrap.py 2025-06-13 15:43:46.000000000 +0200 @@ -0,0 +1,36 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2025 Shlomi Fish < https://www.shlomifish.org/ > +# +# Licensed under the terms of the MIT license. + +""" + + from pysol_cards.cwrap import create_gen + variant = "freecell" + DEALS_MS = 0 + gen = create_gen(variant, DEALS_MS) + deal_idx = 240002 + deal_s = gen(deal_idx) + +""" + +from pysol_cards.cards import CardRenderer +from pysol_cards.deal_game import Game +from pysol_cards.random import RandomBase + + +_r = CardRenderer(True) + + +def create_gen(game_variant, ms): + which_deals = ( + RandomBase.DEALS_MS if (ms == 0) else RandomBase.DEALS_PYSOLFC + ) + game = Game(game_variant, 1, which_deals, 13) + + def _ret(deal_idx): + return game.calc_deal_string(deal_idx, _r) + return _ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/pysol_cards/gen_multi_cli.py new/pysol_cards-0.24.0/pysol_cards/gen_multi_cli.py --- old/pysol_cards-0.18.1/pysol_cards/gen_multi_cli.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pysol_cards-0.24.0/pysol_cards/gen_multi_cli.py 2025-06-13 15:43:46.000000000 +0200 @@ -0,0 +1,207 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2025 Shlomi Fish < https://www.shlomifish.org/ > +# +# Licensed under the terms of the MIT license. + +""" +This is a module that implements a command line interface ( CLI ) +for generating ranges of deals, which is used by: + +https://github.com/shlomif/fc-solve/blob/master/fc-solve/source/board_gen/gen-multiple-pysol-layouts + +The interface has not yet stabilized. + +""" + +import argparse +import os +import sys +from os.path import basename, join +from pathlib import Path + +from pysol_cards.cards import CardRenderer +from pysol_cards.deal_game import Game +from pysol_cards.random import RandomBase + + +class DealsRange: + def __init__(self, idxs): + assert idxs.pop(0) == 'seq' + self.start = int(idxs.pop(0)) + self.end = int(idxs.pop(0)) + assert self.start >= 1 + assert self.end >= self.start + + def run(self): + return range(self.start, self.end + 1) + + +class GenMultiParseCmdLine: + def __init__(self, argv): + cliargs = argv[1:] + if cliargs == ["--mode", "shlomif"] or cliargs == ["--mode=shlomif"]: + self._backend = ShlomifDwimGenDeals() + return + parser = argparse.ArgumentParser( + prog='PROG', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('--concat', action='store_true', + help='concatenate the deals into one large file') + parser.add_argument('--dir', type=str, required=True, + help='output dir') + parser.add_argument('--force', action='store_true', + help='override deal files in existing directory') + parser.add_argument('--game', type=str, default='freecell', + help='The Solitaire variant') + parser.add_argument( + '--mkdir', action='store_true', + help='Make the target directory if it does not exist') + parser.add_argument('--ms', action='store_true', + help='MS/FC-Pro Deals') + parser.add_argument('--prefix', type=str, required=True, + help='filename prefix') + parser.add_argument('--suffix', type=str, required=True, + help='filename suffix') + parser.add_argument('idxs', nargs='+', default=[], + help='indexes') + args = parser.parse_args(argv[1:]) + self._backend = GenMulti( + concat=args.concat, + dir_=args.dir, + force=args.force, + game_variant=args.game, + idxs=args.idxs, + mkdir_=args.mkdir, + ms=args.ms, + prefix=args.prefix, + suffix=args.suffix, + ) + + def run(self): + return self._backend.run() + + +class GenMulti: + def __init__(self, concat, dir_, force, game_variant, idxs, + mkdir_, ms, prefix, suffix): + self.concat = concat + self.dir_ = dir_ + self.force = force + self.game_variant = game_variant + self.idxs = idxs + self.mkdir_ = mkdir_ + # Sanitize, see: + # https://stackoverflow.com/questions/6803505 + self.prefix = basename(prefix) + self.suffix = basename(suffix) + self.which_deals = (RandomBase.DEALS_MS if ms + else RandomBase.DEALS_PYSOLFC) + + self.rend = CardRenderer(True) + self.game = Game(self.game_variant, 1, self.which_deals, 13) + + def _out_deal(self, deal): + with open(join( + self.dir_, self.prefix + str(deal) + self.suffix + ), 'wt') as f: + f.write(self.game.calc_deal_string(deal, self.rend)) + + def run(self): + if self.concat: + idxs = self.idxs + r = DealsRange(idxs=idxs) + assert len(idxs) == 0 + with open(self.dir_, 'wt') as f: + width = None + for deal in r.run(): + s = self.game.calc_deal_string(deal, self.rend) + w = len(s) + if width is None: + width = w + assert w == width + f.write(s) + metadata_fn = self.dir_ + ".metadata.json" + + def i2s(i): + assert isinstance(i, int) + return "{}".format(i) + which_deals = ( + "ms" if (self.which_deals == RandomBase.DEALS_MS) + else "pysolfc" + ) + metadata = { + "game": self.game_variant, + "seeds": [{ + "end": i2s(r.end), + "start": i2s(r.start), + "type": "seq", + }], + "width": i2s(width), + "which_deals": which_deals, + } + import json + with open(metadata_fn, 'wt') as f: + json.dump(metadata, f, sort_keys=True) + + return + if self.mkdir_: + dir_ = Path(self.dir_) + if dir_.is_dir(): + if not self.force: + return + os.makedirs(self.dir_, exist_ok=True) + idxs = self.idxs + while len(idxs): + i = idxs[0] + if i == 'seq': + r = DealsRange(idxs=idxs) + for deal in r.run(): + self._out_deal(deal) + elif i == 'slurp': + idxs.pop(0) + slurpfn = idxs.pop(0) + with open(slurpfn, 'rt') as fh: + for line in fh: + self._out_deal(int(line)) + else: + idxs.pop(0) + self._out_deal(int(i)) + return 0 + + +class ShlomifDwimGenDeals: + def __init__(self): + return + + def run(self): + from pathlib import Path + parent_dir = Path.home() / "Arcs" / "temp" / "solitaire" / \ + "deals" / "ms" + os.makedirs(parent_dir, exist_ok=True) + concat = True + for game_variant in ["all_in_a_row", "black_hole", "freecell", "golf"]: + dir_obj = parent_dir / game_variant + dir_ = str(dir_obj) + generator = GenMulti( + concat=concat, + dir_=dir_, + force=False, + game_variant=game_variant, + idxs=["seq", "1", "32000",], + mkdir_=True, + ms=True, + prefix="ms", + suffix=".board", + ) + generator.run() + + +def _cli_main(): + sys.exit(GenMultiParseCmdLine(argv=sys.argv).run()) + + +if __name__ == "__main__": + _cli_main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/pysol_cards.egg-info/PKG-INFO new/pysol_cards-0.24.0/pysol_cards.egg-info/PKG-INFO --- old/pysol_cards-0.18.1/pysol_cards.egg-info/PKG-INFO 2025-02-11 08:15:43.000000000 +0100 +++ new/pysol_cards-0.24.0/pysol_cards.egg-info/PKG-INFO 2025-06-13 15:43:55.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pysol_cards -Version: 0.18.1 +Version: 0.24.0 Summary: Deal PySol FC Cards Home-page: https://github.com/shlomif/pysol_cards Author: Shlomi Fish @@ -26,8 +26,8 @@ :Info: This is the README file for pysol_cards. :Author: Shlomi Fish <[email protected]> :Copyright: © 2020, Shlomi Fish. -:Date: 2025-02-11 -:Version: 0.18.1 +:Date: 2025-06-13 +:Version: 0.24.0 .. index: README .. image:: https://travis-ci.org/shlomif/pysol_cards.svg?branch=master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/pysol_cards.egg-info/SOURCES.txt new/pysol_cards-0.24.0/pysol_cards.egg-info/SOURCES.txt --- old/pysol_cards-0.18.1/pysol_cards.egg-info/SOURCES.txt 2025-02-11 08:15:43.000000000 +0100 +++ new/pysol_cards-0.24.0/pysol_cards.egg-info/SOURCES.txt 2025-06-13 15:43:55.000000000 +0200 @@ -16,8 +16,10 @@ docs/html/index.html pysol_cards/__init__.py pysol_cards/cards.py +pysol_cards/cwrap.py pysol_cards/deal_game.py pysol_cards/errors.py +pysol_cards/gen_multi_cli.py pysol_cards/random.py pysol_cards/random_base.py pysol_cards/single_deal_args_parse.py @@ -26,4 +28,5 @@ pysol_cards.egg-info/dependency_links.txt pysol_cards.egg-info/not-zip-safe pysol_cards.egg-info/top_level.txt -tests/test_pysol_cards.py \ No newline at end of file +tests/test_pysol_cards.py +tests/test_pysol_cwrap.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/setup.py new/pysol_cards-0.24.0/setup.py --- old/pysol_cards-0.18.1/setup.py 2025-02-11 08:15:33.000000000 +0100 +++ new/pysol_cards-0.24.0/setup.py 2025-06-13 15:43:46.000000000 +0200 @@ -5,7 +5,7 @@ setup(name='pysol_cards', - version='0.18.1', + version='0.24.0', description='Deal PySol FC Cards', keywords='pysol_cards', author='Shlomi Fish', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysol_cards-0.18.1/tests/test_pysol_cwrap.py new/pysol_cards-0.24.0/tests/test_pysol_cwrap.py --- old/pysol_cards-0.18.1/tests/test_pysol_cwrap.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pysol_cards-0.24.0/tests/test_pysol_cwrap.py 2025-06-13 15:43:46.000000000 +0200 @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2019 Shlomi Fish <[email protected]> +# +# Distributed under the terms of the MIT / Expat license: +# +# https://en.wikipedia.org/wiki/MIT_License + +""" + +code/tests/test_pysol_cwrap.py +------------------------------ + +Tests for `pysol_cards.cwrap` module. + +""" + +from unittest import TestCase + + +class TestPysolCards(TestCase): + def test_cwrap_pysolfc_black_hole(self): + from pysol_cards.cwrap import create_gen + DEALS_PYSOLFC = 1 + generator = create_gen("black_hole", DEALS_PYSOLFC) + deal_idx = 240000 + deal_s = generator(deal_idx) + # make_pysol_freecell_board.py -F -t 240000 black_hole + self.assertEqual( + deal_s, + """Foundations: AS +3S 8H JH +7H 9C 5C +6H 5H 8S +5S 2S 3C +8D 3H 4H +5D TD AH +KC 3D 7S +4S QC QH +TC AC 2C +6C 9H 4D +TH JD KS +JC 7C 4C +QS AD 2H +9D 6D 8C +7D KD JS +2D 9S TS +6S QD KH +""", + "pysolfc black_hole deal #240000", + ) + deal_idx = 3700037 + deal_s = generator(deal_idx) + # make_pysol_freecell_board.py -F -t 240000 black_hole + self.assertEqual( + deal_s, + """Foundations: AS +2D 5C 4C +AD 6C 8C +7C TD JC +4H JH 5D +KD 3H KS +AH 6S 7S +4D 6D QH +9S KH 2H +3D 7D 3S +5S 4S 7H +JD AC TH +2C TS QC +TC 6H QS +9C 9H 3C +9D 8H 8S +QD KC 8D +JS 5H 2S +""", + "pysolfc black_hole deal #3700037", + ) + + def test_cwrap_ms_freecell(self): + from pysol_cards.cwrap import create_gen + variant = "freecell" + DEALS_MS = 0 + generator = create_gen(variant, DEALS_MS) + deal_idx = 240002 + deal_s = generator(deal_idx) + # /usr/bin/pi-make-microsoft-freecell-board -t 240002 + wanted_deal_s = """4C AH 8D TH QS 4S JC +AC 8S 3D 5S 4H 9H KS +3S 8C QC 7D 6C 9S KH +7S KC 9D 4D 2S TC AS +9C 5D QD 6S 2H AD +6D 5H 2D JD QH TD +JS KD 5C 7C 6H 8H +3C 3H JH TS 7H 2C +""" + + self.assertEqual( + deal_s, + wanted_deal_s, + "pysolfc freecell ms deal #240002", + )
