From f15b19fe5d7679c99b8144fa93135f21a87bbd7c Mon Sep 17 00:00:00 2001 From: jacobi petrucciani <8117202+jpetrucciani@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:45:47 -0500 Subject: [PATCH] update supported python versions, update actions (#18) --- .github/workflows/test.yml | 2 +- .prospector.yaml | 21 ++++++--------------- README.md | 4 ++-- default.nix | 18 ++++++++++-------- gamble/models/cards.py | 8 +++++--- setup.cfg | 4 ++-- setup.py | 4 ++-- tests/models/test_cards.py | 4 ++++ tox.ini | 2 +- 9 files changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef988a9..175d7d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: needs: [archives, mypy, prospector, black] strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] name: python ${{ matrix.python-version }} tests steps: - uses: actions/checkout@v2 diff --git a/.prospector.yaml b/.prospector.yaml index 8c1aee8..82ea1e3 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -10,18 +10,6 @@ ignore-patterns: - tmp\.py pylint: - disable: - - bad-continuation - - broad-except - - import-error - - import-self - - logging-format-interpolation - - missing-docstring - - no-self-use - - unused-argument - - wrong-import-order - - unsubscriptable-object - options: max-args: 10 max-locals: 100 @@ -43,6 +31,7 @@ pycodestyle: disable: - N802 - N807 + - N818 - W503 options: max-line-length: 100 @@ -56,9 +45,6 @@ bandit: pyroma: run: false - disable: - - PYR19 - - PYR16 pydocstyle: disable: @@ -82,3 +68,8 @@ pydocstyle: - D404 - D403 - D415 + +pyflakes: + disable: + - F401 + - F403 diff --git a/README.md b/README.md index 87f8dfd..d3d97a5 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ version](https://badge.fury.io/py/gamble.svg)](https://badge.fury.io/py/gamble) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) -[![Python 3.6+ -supported](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/release/python-360/) +[![Python 3.7+ +supported](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-370/) [![Documentation style: archives](https://img.shields.io/badge/docstyle-archives-lightblue.svg)](https://github.com/jpetrucciani/archives) diff --git a/default.nix b/default.nix index ed814db..951e69c 100644 --- a/default.nix +++ b/default.nix @@ -1,11 +1,9 @@ { jacobi ? import - ( - fetchTarball { - name = "jpetrucciani-2022-08-17"; - url = "https://github.com/jpetrucciani/nix/archive/93ad4046a5fe9924282af9c56dc88012d8b5315e.tar.gz"; - sha256 = "1ps5d55qvmh66n3xlmm1avsczl6xz82xic2n3vqrd1aj31kzdkm3"; - } - ) + (fetchTarball { + name = "jacobi-2022-12-01"; + url = "https://nix.cobi.dev/x/15e5cfd7927420eddc8d822e2dc0ee32908c850b"; + sha256 = "139k9dnqb5k1n7r1i6hk7vfiy9nmmla4hdvczi14sa4lv7grg7aq"; + }) { } }: let @@ -32,7 +30,11 @@ let ]; scripts = [ (writeShellScriptBin "test_actions" '' - ${jacobi.act}/bin/act --artifact-server-path ./.cache/ -r --rm + export DOCKER_HOST=$(${jacobi.docker-client}/bin/docker context inspect --format '{{.Endpoints.docker.Host}}') + ${jacobi.act}/bin/act --container-architecture linux/amd64 -r --rm + '') + (writeShellScriptBin "prospector" '' + ${prospector}/bin/prospector $@ '') ]; }; diff --git a/gamble/models/cards.py b/gamble/models/cards.py index 36d464b..7e2e2cb 100644 --- a/gamble/models/cards.py +++ b/gamble/models/cards.py @@ -5,7 +5,7 @@ import random from collections import Counter from types import SimpleNamespace -from typing import Any, Dict, List, Union +from typing import Any, Dict, List, Optional, Union from gamble.errors import InvalidCard @@ -491,7 +491,9 @@ class Deck: @desc playing card deck model """ - def __init__(self, cards: List[Card] = None, shuffle: bool = True) -> None: + def __init__( + self, cards: Optional[List[Card]] = None, shuffle: bool = True + ) -> None: """ @cc 3 @desc deck constructor @@ -608,7 +610,7 @@ class EuchreDeck(Deck): @desc deck specifically for euchre """ - def __init__(self, **kwargs: Any) -> None: + def __init__(self, **_: Any) -> None: """ @cc 2 @desc euchre deck constructor diff --git a/setup.cfg b/setup.cfg index 2678b7d..6757f68 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [mypy] -python_version = 3.9 +python_version = 3.10 disallow_untyped_defs = True ignore_missing_imports = True @@ -9,4 +9,4 @@ max-line-length = 100 max-complexity = 20 [tool:pytest] -log_print = False +filterwarnings = ignore::pytest.PytestConfigWarning diff --git a/setup.py b/setup.py index 5e981a9..78b4eb1 100755 --- a/setup.py +++ b/setup.py @@ -8,9 +8,9 @@ __library__ = "gamble" __version__ = "VERSION" - __user__ = "https://github.com/jpetrucciani" + with open("README.md", "r", encoding="UTF-8") as readme: LONG_DESCRIPTION = readme.read() @@ -29,11 +29,11 @@ install_requires=[], classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], diff --git a/tests/models/test_cards.py b/tests/models/test_cards.py index 5817f4d..db8df3d 100644 --- a/tests/models/test_cards.py +++ b/tests/models/test_cards.py @@ -2,10 +2,14 @@ tests for the cards submodule of gamble """ import pytest +import random from gamble import Card, Deck, EuchreDeck, Hand from gamble.errors import InvalidCard +random.seed(420) + + def test_card_init() -> None: """test that a card can be created""" card = Card() diff --git a/tox.ini b/tox.ini index a7620fa..64dbf60 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310 +envlist = py37,py38,py39,py310,py311 [testenv] deps =