Skip to content
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

Transition to pyproject.toml #43

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install the package
run: pip install -e .
- name: Test with unittest
Expand Down
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[project]
name='sortgs'
version='1.0.3'
authors=[{name='Fernando Marcos Wittmann'}]
description='A Python tool to rank Google Scholar publications by citations.'
readme = 'README.md'
urls={github='https://github.com/WittmannF/sort-google-scholar'}
dependencies=[
'beautifulsoup4',
'matplotlib',
'pandas',
'requests',
'selenium',
]
scripts = {sortgs='sortgs:main'}
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
]
requires-python='>=3.8'

[build-system]
requires = ['setuptools']
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where =["src"]
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions src/sortgs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from sortgs.sortgs import main
File renamed without changes.
14 changes: 6 additions & 8 deletions test/test_sortgs.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import unittest
from unittest.mock import patch
import sortgs
import os
import unittest
import pandas as pd

class TestSortGS(unittest.TestCase):
@classmethod
def setUpClass(self):
'''run once before all tests'''
os.system("python sortgs.py --debug --kw 'machine learning' --nresults 10 --endyear 2022")
os.system("sortgs --debug --kw 'machine learning' --nresults 10 --endyear 2022")
self.df_top_10=pd.read_csv('machine_learning.csv')

os.system("python sortgs.py --debug --kw 'machine learning' --nresults 20 --endyear 2022")
os.system("sortgs --debug --kw 'machine learning' --nresults 20 --endyear 2022")
self.df_top_20=pd.read_csv('machine_learning.csv')

os.system("python sortgs.py --debug --kw 'machine learning' --nresults 20 --endyear 2022 --sortby 'cit/year'")
os.system("sortgs --debug --kw 'machine learning' --nresults 20 --endyear 2022 --sortby 'cit/year'")
self.df_top_sorted_cit_per_year=pd.read_csv('machine_learning.csv')

# Repeat the above, but testing the cli command
Expand Down Expand Up @@ -55,7 +53,7 @@ def test_cit_per_year_sorted(self):
[2896, 782, 571, 352, 302]])

def test_csv_exists(self):
os.system("python sortgs.py --debug --kw 'machine learning' --nresults 10")
os.system("sortgs --debug --kw 'machine learning' --nresults 10")
self.assertTrue(os.path.exists('machine_learning.csv'))

def test_cli_get_10_results(self):
Expand Down Expand Up @@ -88,4 +86,4 @@ def test_cli_cit_per_year_sorted(self):


if __name__=='__main__':
unittest.main()
unittest.main()
Loading