From 5f080bd14fd5d43f2053ada032949b5dc5c8da2b Mon Sep 17 00:00:00 2001 From: Claromes Date: Sun, 28 May 2023 03:36:24 -0300 Subject: [PATCH 1/2] create setup --- README.md | 25 ++++++++++++++++--------- TODO.md | 3 --- dev-requirements.txt | 4 ++++ fivbvis/__init__.py | 6 +++++- fivbvis/version.py | 1 + requirements.txt | 4 +--- setup.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 69 insertions(+), 16 deletions(-) delete mode 100644 TODO.md create mode 100644 dev-requirements.txt create mode 100644 fivbvis/version.py create mode 100644 setup.py diff --git a/README.md b/README.md index 2809ff5..9dd1ae8 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,19 @@ Responses are formatted using JSON. ## Installation -PyPI soon. - -## Docs - -[Objects documentation](docs/DOCS.md) +```shell +pip3 install fivbvis +``` ## Usage ```python ->>> from fivbvis import VolleyMatch ->>> vm = VolleyMatch() ->>> print(vm.match(9211)) +from fivbvis import VolleyMatch + +vb = VolleyMatch() + +print(vb.match(9211)) +``` +```json { "data":{ "assistantScorerCountryCode":"None", @@ -34,13 +36,18 @@ PyPI soon. } } ``` + +## Docs + +[Objects documentation](docs/DOCS.md) + ## Development $ `git clone git@github.com:claromes/fivbvis.git` $ `cd fivbvis` -$ `pip install -r requirements.txt` +$ `pip3 install -r dev-requirements.txt` ## Requests diff --git a/TODO.md b/TODO.md deleted file mode 100644 index f0ebd56..0000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -# TODO - -- [ ] add filter options \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..b5451a2 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,4 @@ +-r requirements.txt + +pytest==7.2.0 +vcrpy==4.2.1 \ No newline at end of file diff --git a/fivbvis/__init__.py b/fivbvis/__init__.py index 870dc4b..be4a260 100644 --- a/fivbvis/__init__.py +++ b/fivbvis/__init__.py @@ -1,2 +1,6 @@ from .volley_match import VolleyMatch -from .article import Article \ No newline at end of file +from .article import Article + +from . import version + +__version__ = version.__version__ \ No newline at end of file diff --git a/fivbvis/version.py b/fivbvis/version.py new file mode 100644 index 0000000..34da6b8 --- /dev/null +++ b/fivbvis/version.py @@ -0,0 +1 @@ +__version__ = '0.1.2' \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4176928..5e77405 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1 @@ -requests==2.28.1 -pytest==7.2.0 -vcrpy==4.2.1 \ No newline at end of file +requests==2.28.1 \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..8576809 --- /dev/null +++ b/setup.py @@ -0,0 +1,42 @@ +from setuptools import setup, find_packages +import re + +with open('README.md', 'r', encoding='utf-8') as f: + long_description = f.read() + +with open('requirements.txt', 'r', encoding='utf-8') as f: + install_requires = f.read().splitlines() + +with open('fivbvis/version.py', 'r', encoding='utf-8') as f: + version = re.search(r"^__version__\s*=\s*'(.*)'.*$", + f.read(), flags=re.MULTILINE).group(1) + +setup( + name='fivbvis', + version=version, + author='claromes', + license='GPLv3', + description='FIVB VIS Web Service Python Client', + long_description=long_description, + long_description_content_type='text/markdown', + keywords='api-wrapper fivbvis fivb volleyball beachvolleyball', + url='https://github.com/claromes/fivbvis', + packages=find_packages(exclude=['docs', 'tests*']), + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Science/Research', + 'Intended Audience :: Education', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.8', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Utilities' + ], + python_requires='>=3.8', + install_requires=install_requires +) \ No newline at end of file From e6f1cce5d35efa7a8be31b23e080208ecc0fd362 Mon Sep 17 00:00:00 2001 From: Claromes Date: Sun, 28 May 2023 03:40:03 -0300 Subject: [PATCH 2/2] update gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 74fc83b..8160bb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,15 @@ +# test .pytest_cache/ fivbvis/__pycache__/ tests/__pycache__/ tests/vcr_cassettes/ example.py request.txt + +# build +/dist/ +/build/ +/*.egg-info/ + +# env /venv \ No newline at end of file