diff --git a/.gitignore b/.gitignore index 76627ed..821ec43 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ venv/ .vscode/ __pycache__ *.pyc -*.egg-info \ No newline at end of file +*.egg-info +.tox +dist +build +gitcomp.egg-info \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 656bc44..b5a3c46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,5 @@ [build-system] requires = [ - "prettytable==2.1.0", - "wcwidth==0.1.8", - "urllib3==1.25.8", "setuptools>=42", "wheel" ] diff --git a/requirements.txt b/requirements.txt index 91f298b..71ea1a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ tabulate==0.8.9 -urllib3==1.25.8 +urllib3==1.26.5 wcwidth==0.1.8 +tox==3.24.0 diff --git a/setup.py b/setup.py index 2998e26..c584016 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,12 @@ from setuptools import setup, find_packages -with open('requirements.txt') as f: - requirements = f.readlines() +requirements = [ + 'tabulate == 0.8.9', + 'urllib3 == 1.26.5', + 'wcwidth == 0.1.8' +] -with open("README.md", "r", encoding="utf-8") as fh: +with open('README.md', 'r', encoding='utf-8') as fh: long_description = fh.read() setup( @@ -14,27 +17,27 @@ url='https://github.com/avaish1409/gitcomp', description='A python based command line tool to compare Github Users or Repositories.', long_description=long_description, - long_description_content_type="text/markdown", + long_description_content_type='text/markdown', license='MIT', - package_dir={"": "src"}, - packages=find_packages(where="src"), + package_dir={'': 'src'}, + packages=find_packages(where='src'), entry_points={ 'console_scripts': [ 'gitcomp = gitcomp.__main__:main' ] }, project_urls={ - "Bug Tracker": "https://github.com/avaish1409/gitcomp/issues", + 'Bug Tracker': 'https://github.com/avaish1409/gitcomp/issues', 'Documentation': 'https://avaish1409.github.io/gitcomp/', 'Source': 'https://github.com/avaish1409/gitcomp' }, classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', ], keywords='command-line-tools cli gitcomp python package compare git github', install_requires=requirements, - python_requires=">=3.6", + python_requires='>=3.6', zip_safe=False ) diff --git a/tests/basic_test.py b/tests/basic_test.py new file mode 100644 index 0000000..49e02ac --- /dev/null +++ b/tests/basic_test.py @@ -0,0 +1,30 @@ +import gitcomp + +""" +Baisc test cases dependent on GitComp class output (as caputured in capsys) +- usernames +- reponames +- null args +""" + + +def test_user(capsys): + gitcomp.GitComp(['avaish1409']) + + out, err = capsys.readouterr() + print(out) + assert err == '' + + +def test_repo(capsys): + gitcomp.GitComp(repos=['avaish1409/VideoChatBot']) + + out, err = capsys.readouterr() + assert err == '' + + +def test_null(capsys): + gitcomp.GitComp() + + out, err = capsys.readouterr() + assert err == '' diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..7db4d35 --- /dev/null +++ b/tox.ini @@ -0,0 +1,7 @@ +[tox] +envlist = py39 +isolated_build=true + +[testenv] +deps = pytest +commands = pytest