From 01a98fc131313d1c8f1d6a1bc28ab225292fcd3b Mon Sep 17 00:00:00 2001 From: bcanfield Date: Tue, 17 Oct 2023 23:50:54 -0400 Subject: [PATCH] fix: Clean up dependencies and release --- .circleci/config.yml | 43 ------ .github/workflows/release.yml | 24 ++++ CHANGELOG.md | 263 ++++++++++++++++++++++++++++++++++ README.md | 7 + pyproject.toml | 56 ++++++++ requirements.txt | 21 +-- southpaw/fanduel.py | 5 +- 7 files changed, 358 insertions(+), 61 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md create mode 100644 pyproject.toml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e17dbae..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 2.1 -jobs: - # build_test: - # docker: - # - image: circleci/python:3.9.5 - # steps: - # - checkout # checkout source code to working directory - # - run: - # command: | # create whl and use pipenv to install dependencies - # python setup.py sdist bdist_wheel - # pip install pipenv - # pip install pytest - # pip install -r requirements.txt - # pipenv install dist/southpaw-1.2.0-py3-none-any.whl - # pipenv install pytest - # python -m pytest - # pip install pdoc3 - # mkdir /tmp/documentation - # pdoc --html southpaw --force -o /tmp/documentation - # - store_artifacts: - # path: /tmp/documentation - pypi_publish: - docker: - - image: circleci/python:3.9.5 - steps: - - checkout # checkout source code to working directory - - run: - command: | # create whl, install twine and publish to PyPI - python setup.py sdist bdist_wheel - sudo pip install pipenv - pipenv install twine - pipenv run twine upload dist/* -workflows: - build_test_publish: - jobs: - # - build_test - - pypi_publish: - # requires: - # - build_test - filters: - branches: - only: - - main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..02e65c3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Semantic Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master + with: + github_token: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c58227b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,263 @@ +# CHANGELOG + + +## Unreleased + +### Unknown + +* Update README.md ([`19720fa`](https://github.com/bcanfield/southpaw/commit/19720fa655e2c116f0aa5666cd018e383c0ef892)) + +* Update README ([`2c474ae`](https://github.com/bcanfield/southpaw/commit/2c474ae144eefc174b27bd3483d16919fa6fffbe)) + +* Add easier way to get started ([`1d799a6`](https://github.com/bcanfield/southpaw/commit/1d799a66155ad15c845bb8559a377cec0f7ca48a)) + +* Fix README and test ([`1c74f54`](https://github.com/bcanfield/southpaw/commit/1c74f544c77c9fcc75f0bbe5cb37f0948f4c448f)) + +* Remove breaking stage from pipeline ([`9781523`](https://github.com/bcanfield/southpaw/commit/978152397e3e8abd75fc47ee897e70d82fe64d47)) + +* Fanduel Automation Crackdown Fix (#38) + +* Fix Fanduel authorization + +* Update README.md + +* Increment version ([`7fbfb57`](https://github.com/bcanfield/southpaw/commit/7fbfb57a4be1f04c5852312f4ddfc7874eeefdae)) + +* Update README.md ([`2ec2356`](https://github.com/bcanfield/southpaw/commit/2ec2356bbe25be82434e058e76612451888e012b)) + +* Automate entries (#18) + +* Update README.md + +* Add update entries function + +* Update unit tests + +* Update readme + +* Bump version + +* Fix deps ([`e362d42`](https://github.com/bcanfield/southpaw/commit/e362d42cfa4d83b971127f96b0f624b2cc1cdbf2)) + +* New develop (#16) + +* Enhance fanduel + +* Add helper functions + +* Update README + +* Remove unnecessary json file + +* Update Fanduel + +* Update version ([`498aae2`](https://github.com/bcanfield/southpaw/commit/498aae2931190ac971a41f49d02783d0a1f24cbb)) + +* Fix build ([`292807b`](https://github.com/bcanfield/southpaw/commit/292807b4ebb49f20e66a1b65d7fe741ed1839c09)) + +* Chores (#9) ([`e17c0f2`](https://github.com/bcanfield/southpaw/commit/e17c0f2d0ca9ed253b944fdc502e05cd1bb76bfb)) + +* Update version ([`c46d19a`](https://github.com/bcanfield/southpaw/commit/c46d19a4f26972e0277a7aa309e28595637dc98f)) + +* Fix pipeline ([`d14a29d`](https://github.com/bcanfield/southpaw/commit/d14a29dd9bd7c582c6a122eb41e5cd8480c6cef6)) + +* Fix pipeline ([`09fa320`](https://github.com/bcanfield/southpaw/commit/09fa320a5d367d2ce1df36b90061469acd5e43b2)) + +* Fix pipeline ([`57cc52d`](https://github.com/bcanfield/southpaw/commit/57cc52db2bf9b4c6bcac07613d09907ac41ea75f)) + +* Remove tests ([`86ace7a`](https://github.com/bcanfield/southpaw/commit/86ace7a6406ad92c32a12c067ae47317db1bc2ef)) + +* Fix and update Fanduel api (#8) + +* Improve user authentication process + +* Improve fanduel api + +* Remove unused functionality ([`2f554df`](https://github.com/bcanfield/southpaw/commit/2f554df928caf114cb3fa3c7e6db58f1675fe2a3)) + +* Attempt to fix linear generation ([`e59e60f`](https://github.com/bcanfield/southpaw/commit/e59e60f4741e584451cc280a5fe160591e6ff2b3)) + +* Remove pandas as a dependency ([`5393c75`](https://github.com/bcanfield/southpaw/commit/5393c759aebfe244f0f5f5ff68927bae820f11df)) + +* Modify install dependencies ([`3af5dd3`](https://github.com/bcanfield/southpaw/commit/3af5dd3997e6be5fd2dfe0ca204406a5756f96ca)) + +* Downgrade numpy and pandas ([`3516c6b`](https://github.com/bcanfield/southpaw/commit/3516c6bd82d2cefb40238fba89c3cd6b63bbece7)) + +* Pass in dataframe to linear generator ([`95d2c72`](https://github.com/bcanfield/southpaw/commit/95d2c7224c22211e7e300986b549c164d5a680c2)) + +* Update docs ([`de128d8`](https://github.com/bcanfield/southpaw/commit/de128d8b034283c0b94a8f4c394d67b341b37a90)) + +* Add ability to get entries in a contest ([`8c1b6f7`](https://github.com/bcanfield/southpaw/commit/8c1b6f78cc87c432ac34960ea2fb183b8085e025)) + +* Add function to get x auth token and user id ([`7a95180`](https://github.com/bcanfield/southpaw/commit/7a951800e03c8e223ed423852fe0334d293e8ace)) + +* Bump version ([`33c6cdb`](https://github.com/bcanfield/southpaw/commit/33c6cdb61bd5ae0e3590641de0750cc7774a6d80)) + +* Merge pull request #6 from bcanfield/develop + +Cleanup and add doumentation ([`862a369`](https://github.com/bcanfield/southpaw/commit/862a369be920b393de62459693f53c464d874a3f)) + +* Update README.md ([`492cd79`](https://github.com/bcanfield/southpaw/commit/492cd799fdd898ebec96c7b9cb60404ca64192e6)) + +* Update README.md ([`65033e3`](https://github.com/bcanfield/southpaw/commit/65033e3051f64193213358a774d9e5f749f582e4)) + +* Cleanup and add doumentation ([`a43d6f0`](https://github.com/bcanfield/southpaw/commit/a43d6f0f9eca348e21477dfae379a11cc76e4be0)) + +* Merge pull request #5 from bcanfield/develop + +Develop ([`d387b2f`](https://github.com/bcanfield/southpaw/commit/d387b2f24fc7878e09da5c5d31d14bd089bee11e)) + +* Fix genetic params ([`b99920f`](https://github.com/bcanfield/southpaw/commit/b99920fe8438d2b55637d0d46e408ddaef4bf771)) + +* Merge branch 'main' of https://github.com/bcanfield/truce into develop ([`7930bf7`](https://github.com/bcanfield/southpaw/commit/7930bf70d9379bcfcafd6601bb0c0d2f5a6a2729)) + +* Modift genetitic generator params ([`b313389`](https://github.com/bcanfield/southpaw/commit/b313389fa58266c69cafa91c26c3e93622a16962)) + +* Merge branch 'develop' of https://github.com/bcanfield/truce into develop ([`2afc305`](https://github.com/bcanfield/southpaw/commit/2afc305a483eb8242dc3cd69ef04720c74727de5)) + +* Add data retrieval to fanduel api ([`99aab23`](https://github.com/bcanfield/southpaw/commit/99aab239555d053935975e2e2448f07d3e66b797)) + +* Fix import of fanduel sportsbook api ([`50d0ae6`](https://github.com/bcanfield/southpaw/commit/50d0ae60e3083cff9b853ad47f314afdcfcf44c2)) + +* Bump version ([`7137e66`](https://github.com/bcanfield/southpaw/commit/7137e66bc8cddb197402dcacae4850c74bff839a)) + +* Specify package dependencies in setup.py ([`39e089d`](https://github.com/bcanfield/southpaw/commit/39e089d0232989884130271c994e3f6800cbcf2b)) + +* Fix function imports ([`ba23fd5`](https://github.com/bcanfield/southpaw/commit/ba23fd5a8e649651f3651998c58b9ec7e1c059a4)) + +* Bump version ([`e65f70a`](https://github.com/bcanfield/southpaw/commit/e65f70adc00669a1015844b3ff581af67c1506ea)) + +* Remove external api tests ([`c687826`](https://github.com/bcanfield/southpaw/commit/c687826a23c0be576e313f42561822fad2afa83f)) + +* Revert requirement change ([`e7e60de`](https://github.com/bcanfield/southpaw/commit/e7e60de7fafb0d92f29cf9bc54faeefe32f66587)) + +* Attempt to fix requirements ([`adef552`](https://github.com/bcanfield/southpaw/commit/adef552ffb67f4d7790aeb4ed1fd2b33d2cabbf1)) + +* Attempt to fix http request in pipeline ([`8355289`](https://github.com/bcanfield/southpaw/commit/835528935fd71e576e51aea8d04d62fb516c1d89)) + +* Merge branch 'main' of https://github.com/bcanfield/southpaw into main ([`945ce06`](https://github.com/bcanfield/southpaw/commit/945ce06e6f9f810667d3b47f5fd7956b33d2e28a)) + +* Add missing requirement ([`3c33ca3`](https://github.com/bcanfield/southpaw/commit/3c33ca352274f3cc0e6d4ffdf3032fc045b2677c)) + +* Update README.md ([`84848d9`](https://github.com/bcanfield/southpaw/commit/84848d91dd00f6840b8e1f76ad2fd6d0e939e78a)) + +* Enhance tests ([`0a650ea`](https://github.com/bcanfield/southpaw/commit/0a650eac985ea36725acf81b3c148d3cb78dbaf0)) + +* Bump Version ([`1a910f5`](https://github.com/bcanfield/southpaw/commit/1a910f587a8e31af3284984dd5e6090dd95754a1)) + +* Fix Build ([`99384a1`](https://github.com/bcanfield/southpaw/commit/99384a1a3df9f9e0f2bdacf415827d07752c769d)) + +* Fix Build ([`3d06235`](https://github.com/bcanfield/southpaw/commit/3d06235e7ad37a95da8035828958e04a850979e4)) + +* Fix Build ([`08a93b1`](https://github.com/bcanfield/southpaw/commit/08a93b11adf154e83ca339590d93bfd63c9d2efb)) + +* Fix Build ([`11ca1b2`](https://github.com/bcanfield/southpaw/commit/11ca1b2572d2260bf8992f9fd0f40056f0b13e0c)) + +* Fix Build ([`1b9b0d6`](https://github.com/bcanfield/southpaw/commit/1b9b0d6c2e20cddbb60249d8b4a1b279aa1ff8f7)) + +* Fix Build ([`95c7d31`](https://github.com/bcanfield/southpaw/commit/95c7d318948eed6513473974fbc39a1b3017717b)) + +* Fix Build ([`d80fb26`](https://github.com/bcanfield/southpaw/commit/d80fb2644ad8dfed8d8c7cced0cfb64c8f4bed12)) + +* Fix Build ([`657dfa8`](https://github.com/bcanfield/southpaw/commit/657dfa8b49e5c2628f4cf0c01c9cdabc0d4f0a51)) + +* Fix Build ([`aa2e088`](https://github.com/bcanfield/southpaw/commit/aa2e08851bd4f15db2ef3d7b3f83926d568519c2)) + +* Fix Build ([`d6bb838`](https://github.com/bcanfield/southpaw/commit/d6bb838037a50186e2f1031cb0d5a7ea8669d7e7)) + +* Fix Build ([`316757d`](https://github.com/bcanfield/southpaw/commit/316757d92ed52807224964e6819ee4f0ba4e4b3f)) + +* Fix Build ([`51d3982`](https://github.com/bcanfield/southpaw/commit/51d39821204e12589565cdeb13eb59cc6d4d5358)) + +* Fix Build ([`f7fc167`](https://github.com/bcanfield/southpaw/commit/f7fc167d720ec98c2159868da41d6fde73527c6e)) + +* Fix Build ([`fed2b94`](https://github.com/bcanfield/southpaw/commit/fed2b94b4a6e4fe23a17f3043e59d207e289a9dd)) + +* Fix Build ([`de2b877`](https://github.com/bcanfield/southpaw/commit/de2b877ee0c97bafb7c3c2c49723801335aee427)) + +* Fix Build ([`6a2d886`](https://github.com/bcanfield/southpaw/commit/6a2d886d1b2a1a986cba6172e7ec87e36d58f4b3)) + +* Fix Build ([`2725eba`](https://github.com/bcanfield/southpaw/commit/2725ebabd2b923892374fbf03d1fb5e0df9c2a98)) + +* Fix Build ([`122a790`](https://github.com/bcanfield/southpaw/commit/122a7904162d9d5c8a9be6fdab9db2505e98db48)) + +* Fix Build ([`74793d0`](https://github.com/bcanfield/southpaw/commit/74793d03072a6ac92a3d065848bf1be7cbe40f33)) + +* Merge pull request #4 from bcanfield/develop + +Fix Build ([`f11f689`](https://github.com/bcanfield/southpaw/commit/f11f68977e24181744de41048faa093ad15de353)) + +* Fix Build ([`4979c86`](https://github.com/bcanfield/southpaw/commit/4979c86dd23464fa712e6cf746388dacddaf6c90)) + +* Merge pull request #3 from bcanfield/develop + +Develop ([`eef55c7`](https://github.com/bcanfield/southpaw/commit/eef55c739af7104a0af636068fa9e721ccdeb127)) + +* Add auto-documentation ([`8c5a7f1`](https://github.com/bcanfield/southpaw/commit/8c5a7f1e51929b15590ba80c92bdd881e5357c53)) + +* Add initial scraper ([`0237583`](https://github.com/bcanfield/southpaw/commit/023758362a0e24c51306779ca2027d9343adf345)) + +* Bump version ([`d3b31f3`](https://github.com/bcanfield/southpaw/commit/d3b31f323d48d651f1110f8276c0f768631bc124)) + +* Update README.md ([`fa0cb8e`](https://github.com/bcanfield/southpaw/commit/fa0cb8e4f30019256fb16e702a8718feaf72ed48)) + +* Merge pull request #2 from bcanfield/develop + +Develop ([`eedbc70`](https://github.com/bcanfield/southpaw/commit/eedbc7045b024428ea2e03fcfb2dd44ba1d4a80b)) + +* Bump version ([`9d5642b`](https://github.com/bcanfield/southpaw/commit/9d5642bd6d874ec828193e66a669dd556784c19a)) + +* Create genetic algorithm ([`fe3d9d4`](https://github.com/bcanfield/southpaw/commit/fe3d9d484318846bcf2033ae76ec341870cb5743)) + +* Cleanup ([`88fb4e6`](https://github.com/bcanfield/southpaw/commit/88fb4e634bffd0403030ce65cd8a5b601c74d81b)) + +* Attempt to fix build ([`a59c076`](https://github.com/bcanfield/southpaw/commit/a59c07625f967652edb3e67c0305056ed36fbf66)) + +* Attempt to fix build ([`529e5cb`](https://github.com/bcanfield/southpaw/commit/529e5cb6fe010fa160fed0ffd53811e4a6f92322)) + +* Attempt to fix build ([`a0399ce`](https://github.com/bcanfield/southpaw/commit/a0399ce11bec068c5cfe56b0f452669c7e5dc6fa)) + +* Attempt to fix build ([`3b722d5`](https://github.com/bcanfield/southpaw/commit/3b722d5fc1ef3e6e24dcd86d60ab108d7e11d77c)) + +* Attempt to fix build ([`5169158`](https://github.com/bcanfield/southpaw/commit/5169158718858743b1ef33884b50983aee287a15)) + +* Attempt to fix build ([`10d7f02`](https://github.com/bcanfield/southpaw/commit/10d7f028ea2a2349eaf4fe83d781528b40296ccb)) + +* Attempt to fix build ([`99a0617`](https://github.com/bcanfield/southpaw/commit/99a0617fbee0978e44f0977a73ca179126bba476)) + +* Fix test ([`68f799b`](https://github.com/bcanfield/southpaw/commit/68f799b553e1f03de912015a0ea5f62bceaad1d2)) + +* Fix broken test ([`43e5b51`](https://github.com/bcanfield/southpaw/commit/43e5b51a9fd6d3c42f9717f4cacc68b6e5622fb0)) + +* Add test and small fix to linear generator ([`4a9f955`](https://github.com/bcanfield/southpaw/commit/4a9f955142189cc6eadc9f62d025b35da1615701)) + +* Rename package ([`88aabb3`](https://github.com/bcanfield/southpaw/commit/88aabb33d3edd3d1612d86e71064b5a31c6a1f60)) + +* Merge pull request #1 from bcanfield/develop + +Develop ([`9394794`](https://github.com/bcanfield/southpaw/commit/93947941f2a1a813bda337f9971149a3c5711f2b)) + +* Edit setup file ([`7f77f88`](https://github.com/bcanfield/southpaw/commit/7f77f8813cc0a91b5299e8f2afa3e3ced0bcc283)) + +* Rename package ([`40b1413`](https://github.com/bcanfield/southpaw/commit/40b1413abbe84e87063ea7ca4342ef49c7494f22)) + +* Fix README ([`00a0827`](https://github.com/bcanfield/southpaw/commit/00a0827d87aad22d0c60d7d6ec4c5f5ca5296822)) + +* Add README ([`e3d4aa5`](https://github.com/bcanfield/southpaw/commit/e3d4aa58a60d8aa6b11c079f700b416874344c51)) + +* Rstructure files ([`5338fae`](https://github.com/bcanfield/southpaw/commit/5338faee1cee8bad4d6dd20149bdd8923ad9b5c5)) + +* Bump version ([`2ce8535`](https://github.com/bcanfield/southpaw/commit/2ce8535233718c447e6f8b6b8479966adc8a7caa)) + +* Upgrade python version in build config ([`723be50`](https://github.com/bcanfield/southpaw/commit/723be50f230e414ef5dc418781fa6d65ccc2789c)) + +* Merge branch 'main' of https://github.com/bcanfield/truce into main ([`d8a6de5`](https://github.com/bcanfield/southpaw/commit/d8a6de579afd48296a40d340e9966450cf858564)) + +* Fix CircleCI config ([`020757c`](https://github.com/bcanfield/southpaw/commit/020757ce6bc300130d62a32e4eaac95f18444b1a)) + +* Add requirement ([`09d929c`](https://github.com/bcanfield/southpaw/commit/09d929c39d9bfb8c2bef34d4365a0302b2b70559)) + +* Initial pipeline setup ([`b7a4230`](https://github.com/bcanfield/southpaw/commit/b7a423006823fbfd45bfa0f071bb53afb502d753)) + +* first commit ([`027bdb4`](https://github.com/bcanfield/southpaw/commit/027bdb4d65693e6c1550207c702f7622cbce48da)) + diff --git a/README.md b/README.md index 531d603..19e8051 100644 --- a/README.md +++ b/README.md @@ -174,3 +174,10 @@ This project is for educational use only. Accumulating Fanduel points or prizes through unauthorized methods such as unauthorized scripts or other automated means is against the Fanduel terms and may result in account disqualification. The contributors of Southpaw shall not be held responsible for any actions taken using this tool. + +## Developing +Build package locally: +`python setup.py bdist_wheel` + +Install package locally: +`pip install dist/southpaw-<...>.whl --force-reinstall` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b3b8d8d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +[tool.semantic_release] +version_variables = ["setup.py:VERSION"] + +[tool.semantic_release] +assets = [] +commit_message = "{version}\n\nAutomatically generated by python-semantic-release" +commit_parser = "angular" +logging_use_named_masks = false +major_on_zero = true +tag_format = "v{version}" + +[tool.semantic_release.branches.main] +match = "(main|master)" +prerelease_token = "rc" +prerelease = false + +[tool.semantic_release.changelog] +template_dir = "templates" +changelog_file = "CHANGELOG.md" +exclude_commit_patterns = [] + +[tool.semantic_release.changelog.environment] +block_start_string = "{%" +block_end_string = "%}" +variable_start_string = "{{" +variable_end_string = "}}" +comment_start_string = "{#" +comment_end_string = "#}" +trim_blocks = false +lstrip_blocks = false +newline_sequence = "\n" +keep_trailing_newline = false +extensions = [] +autoescape = true + +[tool.semantic_release.commit_author] +env = "GIT_COMMIT_AUTHOR" +default = "semantic-release " + +[tool.semantic_release.commit_parser_options] +allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"] + +[tool.semantic_release.remote] +name = "origin" +type = "github" +ignore_token_for_push = false + +[tool.semantic_release.remote.token] +env = "GH_TOKEN" + +[tool.semantic_release.publish] +dist_glob_patterns = ["dist/*"] +upload_to_vcs_release = true + diff --git a/requirements.txt b/requirements.txt index 6d76486..9025663 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,6 @@ -attrs==21.2.0 -certifi==2021.10.8 -charset-normalizer==2.0.7 -idna==3.3 -iniconfig==1.1.1 -packaging==21.2 -pluggy==1.0.0 -py==1.11.0 -pyparsing==2.4.7 -pytest==6.2.5 -requests==2.26.0 -responses==0.15.0 -six==1.16.0 -toml==0.10.2 -urllib3==1.26.7 +certifi==2023.7.22 +charset-normalizer==3.3.0 +colorful==0.5.5 +idna==3.4 +requests==2.31.0 +urllib3==2.0.7 diff --git a/southpaw/fanduel.py b/southpaw/fanduel.py index e2275ae..d0c666f 100644 --- a/southpaw/fanduel.py +++ b/southpaw/fanduel.py @@ -1,6 +1,6 @@ import requests import json - +import colorful as cf class Player(): ''' @@ -445,8 +445,7 @@ def __authenticate(self): # Succesfully sent off a request with the given credentials user = current_response_json['users'][0] self.user_auth.user_id = user['id'] - print("#######################\nLogged in Fanduel user: ", - user['username'], "\n#######################\n") + print(cf.green("Successfully logged in Fanduel user: "),user['username']) else: raise Exception( '#######################\nError Authenticating Fanduel User\n#######################\n')