Skip to content

Spring cleaning 2023: bug fixes, updates, and improvements #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ffcfc88
Bump version number to 1.3.0
dagpunk Mar 1, 2023
430115e
Separate dev and user requirements
dagpunk Mar 1, 2023
6e22011
Store the coin flip results in a dataframe
dagpunk Mar 1, 2023
ed310f7
Separate user and dev requirements
dagpunk Mar 1, 2023
a167a80
Remove the quick test step via pytest-xdist
dagpunk Mar 4, 2023
05692fd
Ignore PyCharm project metadata
dagpunk Mar 4, 2023
684e39c
Remove the sample changelog
dagpunk Mar 4, 2023
8e11706
Remove CodeQL workflow from template
dagpunk Mar 4, 2023
fab39cc
Remove unnecessary max-line-length option
dagpunk Mar 4, 2023
6c502c2
Bump project version to 2.0.0
dagpunk Mar 4, 2023
3bb3835
Store source code in the src/ directory
dagpunk Mar 4, 2023
b501623
Test the single coin flip function
dagpunk Mar 4, 2023
af507d9
Implement a single coin flip function
dagpunk Mar 4, 2023
029c75a
Update the docstring for multi-flip function
dagpunk Mar 4, 2023
a6c4795
Remove checks now handled by single flip function
dagpunk Mar 4, 2023
dd8d9b5
Store single flip data in a dataframe
dagpunk Mar 4, 2023
18b7d21
Refactor the multi-flip function to use dataframes
dagpunk Mar 4, 2023
37b465a
Update multi-flip test params and return types
dagpunk Mar 4, 2023
4ca8fe2
Update reference to renamed column
dagpunk Mar 4, 2023
f746cd0
Remove unused import
dagpunk Mar 4, 2023
f488c9c
Increase max code line length to 100
dagpunk Mar 4, 2023
6e2e2e9
Shorten long code line
dagpunk Mar 4, 2023
404d74a
Update reference to renamed subpackage
dagpunk Mar 4, 2023
5519249
Added module names to pylint exceptions config
dagpunk Mar 4, 2023
ee14f37
Update docstring to reflect change in return type
dagpunk Mar 4, 2023
4d3b026
Test the dataframe directly
dagpunk Mar 4, 2023
a1bfc81
Rename test function to be more descriptive
dagpunk Mar 4, 2023
664ae7d
Isolate exception testing in a new test
dagpunk Mar 4, 2023
01670c0
Raise an exception if coin_flip_count is invalid
dagpunk Mar 4, 2023
cdb37a5
Test the exception raising logic for non-ints
dagpunk Mar 4, 2023
03302cf
Increase pylint max line length to 100
dagpunk Mar 4, 2023
9b957d3
Return a TypeError if param type is incorrect
dagpunk Mar 4, 2023
465b91b
Test input validation in single coin flip function
dagpunk Mar 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,.venv
max-line-length = 80
max-line-length = 100
70 changes: 0 additions & 70 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
- name: Install user dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install dev dependencies
run: |
if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=80 --statistics
flake8 . --count --max-complexity=10 --statistics
- name: Lint with pylint
run: |
python -m pylint games_of_chance/
- name: Test with pytest (quick)
run: |
python -m pytest -v -x -n auto
python -m pylint src/
- name: Test with pytest
run: |
python -m coverage run -m pytest -v
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json

# VS Code settings file
.vscode/settings.json

# PyCharm project metadata
.idea/
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ indent-after-paren=4
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=80
max-line-length=100

# Maximum number of lines in a module.
max-module-lines=1000
Expand Down Expand Up @@ -565,5 +565,5 @@ preferred-modules=

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
125 changes: 0 additions & 125 deletions CHANGELOG.md

This file was deleted.

4 changes: 4 additions & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage>=7.2
flake8>=6.0
pylint>=2.16
pytest>=7.2
52 changes: 52 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --resolver=backtracking dev-requirements.in
#
astroid==2.14.2
# via pylint
attrs==22.2.0
# via pytest
coverage==7.2.1
# via -r dev-requirements.in
dill==0.3.6
# via pylint
exceptiongroup==1.1.0
# via pytest
flake8==6.0.0
# via -r dev-requirements.in
iniconfig==2.0.0
# via pytest
isort==5.12.0
# via pylint
lazy-object-proxy==1.9.0
# via astroid
mccabe==0.7.0
# via
# flake8
# pylint
packaging==23.0
# via pytest
platformdirs==3.0.0
# via pylint
pluggy==1.0.0
# via pytest
pycodestyle==2.10.0
# via flake8
pyflakes==3.0.1
# via flake8
pylint==2.16.2
# via -r dev-requirements.in
pytest==7.2.1
# via -r dev-requirements.in
tomli==2.0.1
# via
# pylint
# pytest
tomlkit==0.11.6
# via pylint
typing-extensions==4.5.0
# via astroid
wrapt==1.15.0
# via astroid
81 changes: 0 additions & 81 deletions games_of_chance/flip_coins.py

This file was deleted.

Loading