Repository: blakepotvin/playingcards.py (language: python)

Issue:
Publication



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml
new file mode 100644
index 0000000..f0f0311
--- /dev/null
+++ b/.github/workflows/publish_to_pypi.yml
@@ -0,0 +1,39 @@
+name: Test, Build, & Publish
+
+on:
+  release:
+    types: [created]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python 3.9
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.9
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install flake8 pytest setuptools wheel twine
+        if [ -f requirements.txt ]; then pip install -r 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 --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+    - name: Test with pytest
+      run: |
+        pytest
+    - name: Build Binary Wheel and Source Tarball
+      run: |
+        python3 setup.py sdist bdist_wheel
+    - name: Upload to PyPI
+      uses: pypa/gh-action-pypi-publish@release/v1
+      with:
+        user: __token__
+        password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index bb724bd..294867d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,144 @@
-/__pycache__
-/playingcards/__pycache__
-/tests/__pycache__
-.DS_Store
-/.vscode
\ No newline at end of file
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+#   For a library or package, you might want to ignore these files since the code is
+#   intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# VS Code project settings
+.vscode
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# MacOS system files
+.DS_Store
\ No newline at end of file
diff --git a/playingcards/__init__.py b/playingcards/__init__.py
index dfc92fc..1495758 100644
--- a/playingcards/__init__.py
+++ b/playingcards/__init__.py
@@ -1,4 +1,6 @@
 # __init__.py
+from .deck import Deck
+from .card import Card
 
 # Version of the playingcards.py package
 __version__ = "1.0.0"
\ No newline at end of file
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..56f3eff
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,28 @@
+import pathlib
+from setuptools import setup
+
+# The directory containing this file
+HERE = pathlib.Path(__file__).parent
+
+# The text of the README file
+README = (HERE / "README.md").read_text()
+
+setup(
+    name="playingcards.py",
+    version="1.0.0",
+    description="An Advanced Python Playing Card Module that makes creating playing card games simple and easy!",
+    long_description=README,
+    long_description_content_type="text/markdown",
+    url="https://github.com/Prodxgy/playingcards.py",
+    author="Prodxgy",
+    license="MIT",
+    classifiers=[
+        "License :: OSI Approved :: MIT License",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+    ],
+    packages=["playingcards"],
+    python_requires=">=3.6.0",
+)
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/python-test.yml b/.github/workflows/test_latest_commit.yml
similarity index 72%
rename from .github/workflows/python-test.yml
rename to .github/workflows/test_latest_commit.yml
index 70bba55..9ab69fe 100644
--- a/.github/workflows/python-test.yml
+++ b/.github/workflows/test_latest_commit.yml
@@ -1,13 +1,10 @@
-# This workflow will install Python dependencies, run tests and lint with a single version of Python
-# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
-
-name: Python application
+name: Test Latest Commit
 
 on:
   push:
-    branches: [ master ]
+    branches: [ master, develop ]
   pull_request:
-    branches: [ master ]
+    branches: [ master, develop]
 
 jobs:
   build:
@@ -33,4 +30,4 @@ jobs:
         flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
     - name: Test with pytest
       run: |
-        pytest
+        pytest
\ No newline at end of file
diff --git a/tests/test_card.py b/tests/test_card.py
index a826b0d..e0ea8e3 100644
--- a/tests/test_card.py
+++ b/tests/test_card.py
@@ -1,6 +1,6 @@
-from playingcards import card as c
+from playingcards import Card
 
-card = c.Card(seed="xyz")
+card = Card(seed="xyz")
 
 def test_value():
     assert card.value == 5
diff --git a/tests/test_deck.py b/tests/test_deck.py
index 71e52fa..698ab2c 100644
--- a/tests/test_deck.py
+++ b/tests/test_deck.py
@@ -1,6 +1,6 @@
-from playingcards import deck as d
+from playingcards import Deck
 
-deck = d.Deck(seed="xyz")
+deck = Deck(seed="xyz")
 card = deck.draw_card()
 
 """