Skip to content

Commit

Permalink
Merge pull request #46 from boldandbrad/develop
Browse files Browse the repository at this point in the history
v0.6.0 - develop
  • Loading branch information
boldandbrad authored Nov 24, 2021
2 parents 29a1ac8 + f0fca8a commit 1ddd36a
Show file tree
Hide file tree
Showing 47 changed files with 487 additions and 532 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
language: python
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# - "3.10"
- "nightly"

install:
- pip install --upgrade pip
- pip install pip-tools
- pip-compile
- pip-compile --extra dev
- pip install -r requirements.txt
- pip install .

script:
- pytest --cov-report=xml --cov=./euchrecli/
- pytest --cov-report=xml --cov=./euchre/

after_success:
- codecov
Expand Down
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ Please do contribute! Issues and pull requests are welcome.
Clone euchre-cli repo.

```zsh
git clone https://github.com/bradleycwojcik/euchre-cli
git clone https://github.com/boldandbrad/euchre-cli
```

Install local package in development mode..
Install local package in development mode.

```zsh
pip install -e .
> Note: The `pip` line does not work in zsh for some reason. Run it in another shell.
```bash
cd euchre-cli
pip install -e .[dev]
```

Run the cli.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

# euchre-cli

[![Build Status](https://travis-ci.org/bradleycwojcik/euchre-cli.svg?branch=main)](https://travis-ci.org/bradleycwojcik/euchre-cli)
[![codecov](https://codecov.io/gh/bradleycwojcik/euchre-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/bradleycwojcik/euchre-cli)
[![Docs](https://img.shields.io/website?down_message=down&label=docs&up_message=online&url=https%3A%2F%2Fbradleycwojcik.github.io%2Feuchre-cli%2F)](https://bradleycwojcik.github.io/euchre-cli/)
[![Build Status](https://api.travis-ci.com/boldandbrad/euchre-cli.svg?branch=main)](https://travis-ci.com/github/boldandbrad/euchre-cli)
[![codecov](https://codecov.io/gh/boldandbrad/euchre-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/boldandbrad/euchre-cli)
[![Docs](https://img.shields.io/website?down_message=down&label=docs&up_message=online&url=https%3A%2F%2Fboldandbrad.github.io%2Feuchre-cli%2F)](https://boldandbrad.github.io/euchre-cli/)
[![PyPI](https://img.shields.io/pypi/v/euchre-cli)](https://pypi.org/project/euchre-cli/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/euchre-cli)

Expand All @@ -23,7 +23,7 @@

## Special Thanks :clap:

* James Barbret: logo design
* James Barbret - logo design

## Planned Features

Expand Down
4 changes: 2 additions & 2 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

[<img src="_media/logo_light.png" alt="logo" width="200"/>](/)

# [**euchre-cli** **<small>0.5.1</small>**](/)
# [**euchre-cli** **<small>0.6.0</small>**](/)

> Play euchre in your terminal.
- Written in python
- Cross platform
- Free and open source

[Github](https://github.com/bradleycwojcik/euchre-cli "Github")
[Github](https://github.com/boldandbrad/euchre-cli "Github")
[Learn More](#euchre-cli "Learn More")

![color](#B3C69F)
2 changes: 1 addition & 1 deletion docs/_homepage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ been awarded a total of 10 points.

## Special Thanks :clap:

- James Barbret: logo design
- James Barbret - logo design

<div style="text-align: right"><i>Last updated: {docsify-updated}</i></div>
17 changes: 17 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ The format is based on
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html "Semantic Versioning").

## [0.6.0] - 2021-11-24

### Updated

- Dependency Click from v7.x to v8.x
- Code formatting and structure

### Fixed

- `euchre --version` Correctly works again with latest dependencies.

### Removed

- `euchre rules` No longer works on older versions of euchre-cli due to
[relocated documentation](https://boldandbrad.github.io/euchre-cli/).
- Support for python versions 3.6 and 3.7

## [0.5.1] - 2020-09-08

### Added
Expand Down
14 changes: 9 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>euchre-cli</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Play euchre in your terminal.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="icon" type="image/png" href="_media/logo_light.png">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>

<body>
<div id="app"></div>
<script>
var year = new Date().getFullYear()
window.$docsify = {
name: '<img src="_media/logo_light.png" alt="logo" title="euchre-cli" width="100"/>',
repo: 'bradleycwojcik/euchre-cli',
repo: 'boldandbrad/euchre-cli',
coverpage: true,
homepage: '_homepage.md',
notFoundPage: true,
Expand All @@ -28,7 +31,7 @@
search: 'auto',
footer: {
copy: `<span>&copy; ${year}</span>`,
auth: 'Bradley C. Wojcik (<a href="https://github.com/bradleycwojcik" target="_blank">@bradleycwojcik</a>) | <a href="https://github.com/bradleycwojcik/euchre-cli/blob/main/LICENSE" target="_blank">MIT License</a>',
auth: 'Bradley C. Wojcik (<a href="https://github.com/boldandbrad" target="_blank">@boldandbrad</a>) | <a href="https://github.com/boldandbrad/euchre-cli/blob/main/LICENSE" target="_blank">MIT License</a>',
class: 'footer',
},
}
Expand All @@ -39,4 +42,5 @@
<script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="//unpkg.com/docsify-footer-enh/dist/docsify-footer-enh.min.js"></script>
</body>
</html>

</html>
3 changes: 2 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Start playing euchre in your terminal.

> Note: **euchre-cli** is compatible with `python 3.6+` on macOS, Windows, and Linux.
> Note: The latest version of **euchre-cli** is compatible with `python 3.8+`
> on macOS, Windows, and Linux.
Install with pip.

Expand Down
2 changes: 1 addition & 1 deletion docs/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Archives will need to unzipped to be read.
## Report

Please report issues with included log screenshots or excerpts to the **euchre-cli**
[issue tracker](https://github.com/bradleycwojcik/euchre-cli/issues "Github - Issues").
[issue tracker](https://github.com/boldandbrad/euchre-cli/issues "Github - Issues").

<div style="text-align: right"><i>Last updated: {docsify-updated}</i></div>
2 changes: 1 addition & 1 deletion euchrecli/__init__.py → euchre/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# release version
version = '0.5.1'
version = "0.6.0"
File renamed without changes.
27 changes: 15 additions & 12 deletions euchrecli/abstract/card.py → euchre/abstract/card.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

from . import Suit, Face


class Card():
"""Representation of a standard playing card.
"""
class Card:
"""Representation of a standard playing card."""

def __init__(self, suit: Suit, face: Face) -> None:
self.suit = suit
Expand All @@ -20,9 +18,11 @@ def is_left_bower(self, trump_suit: Suit) -> bool:
bool: Whether the card is the left bower.
"""
# if jack of same color as trump suit
return self.face.name == 'Jack' and \
self.suit.color == trump_suit.color and \
self.suit.name != trump_suit.name
return (
self.face.name == "Jack"
and self.suit.color == trump_suit.color
and self.suit.name != trump_suit.name
)

def adjusted_suit(self, trump_suit: Suit) -> Suit:
"""Return trump suit if card is left bower.
Expand Down Expand Up @@ -62,14 +62,17 @@ def weighted_value(self, trump_suit: Suit, lead_suit: Suit = None) -> int:
if self.is_left_bower(trump_suit):
weighted_val += 15 # 26
elif self.suit.name == trump_suit.name:
if self.face.name in ['Nine', 'Ten']:
if self.face.name in ["Nine", "Ten"]:
weighted_val += 12 # 21, 22
elif self.face.name in ['Queen', 'King', 'Ace']:
elif self.face.name in ["Queen", "King", "Ace"]:
weighted_val += 11 # 23, 24, 25
elif self.face.name == 'Jack':
elif self.face.name == "Jack":
weighted_val += 16 # 27 (right_bower)
elif lead_suit and trump_suit.name != lead_suit.name and \
self.suit.name == lead_suit.name:
elif (
lead_suit
and trump_suit.name != lead_suit.name
and self.suit.name == lead_suit.name
):
weighted_val += 6 # 15, 16, 17, 18, 19, 20

return weighted_val
Expand Down
Loading

0 comments on commit 1ddd36a

Please sign in to comment.