From 60943f342323ae5a213768cafb451f3b5fb9a8a0 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 18:53:01 +0200 Subject: [PATCH 1/7] First steps for drone CI script. --- .drone.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..12b1d28 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +--- +kind: pipeline +type: docker +name: torrentSearch + +platform: + os: linux + arch: amd64 + +steps: + - name: Install python + image: python:3.8 + commands: + - python setup.py install + - pytest + + - name: Upload coverage report + image: python:3.8 + commands: + - python setup.py install + - coverage run -m pytest + - codecov -t $CODECOV_TOKEN From 45fd26ad3444790f91e7bde8b4aab46d8ca44462 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 19:03:46 +0200 Subject: [PATCH 2/7] fix: explicit install pytest --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 12b1d28..4420a8f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,11 +12,13 @@ steps: image: python:3.8 commands: - python setup.py install + - pip install pytest - pytest - name: Upload coverage report image: python:3.8 commands: - python setup.py install + - pip install pytest - coverage run -m pytest - codecov -t $CODECOV_TOKEN From 0b22df4f0a84a0c6481c9f629b8feee6b72bc909 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 19:05:31 +0200 Subject: [PATCH 3/7] fix: install coverage before running command --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4420a8f..558990f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,6 +19,6 @@ steps: image: python:3.8 commands: - python setup.py install - - pip install pytest + - pip install pytest coverage - coverage run -m pytest - codecov -t $CODECOV_TOKEN From 69991340e67cbf70194882cd020549d8cfbf97fd Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 19:06:37 +0200 Subject: [PATCH 4/7] fix: install codecov before running command --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 558990f..beaf5ae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,6 +19,6 @@ steps: image: python:3.8 commands: - python setup.py install - - pip install pytest coverage + - pip install pytest coverage codecov - coverage run -m pytest - codecov -t $CODECOV_TOKEN From d828d4e4f0e1118f73ebfe5bbed8a7415aee25a8 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 19:09:00 +0200 Subject: [PATCH 5/7] Add codecov secert as env variable --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index beaf5ae..cf3c47f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,3 +22,6 @@ steps: - pip install pytest coverage codecov - coverage run -m pytest - codecov -t $CODECOV_TOKEN + environment: + CODECOV_TOKEN: + from_secret: CODECOV_TOKEN From 11cc5f084b47fd7b8e3a7a0ed038d5e46d8df777 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 3 Jul 2021 19:11:49 +0200 Subject: [PATCH 6/7] Moved badges to table & added drone CI --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5794812..8c2af7f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # Torrent Search -[![PyVersion](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/) -[![Build Status](https://travis-ci.org/KevinMidboe/torrent_search.svg?branch=master)](https://travis-ci.org/KevinMidboe/torrent_search) -[![codecov](https://codecov.io/gh/KevinMidboe/torrent_search/branch/master/graph/badge.svg)](https://codecov.io/gh/KevinMidboe/torrent_search) -[![Known Vulnerabilities](https://snyk.io/test/github/kevinmidboe/torrent_search/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/kevinmidboe/torrent_search?targetFile=requirements.txt) -[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE) +| Tested version | PyPi package | Drone CI | Travis CI | Code coverage | Known vulnerabilities | License | +|:--------|:------|:------|:------|:------|:------|:------------| +| [![PyVersion](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/) | ![PyPI](https://img.shields.io/pypi/v/torrentSearch) | [![Build Status](https://drone.schleppe.cloud/api/badges/KevinMidboe/torrent_search/status.svg)](https://drone.schleppe.cloud/KevinMidboe/torrent_search) | [![Build Status](https://travis-ci.org/KevinMidboe/torrent_search.svg?branch=master)](https://travis-ci.org/KevinMidboe/torrent_search) | [![codecov](https://codecov.io/gh/KevinMidboe/torrent_search/branch/master/graph/badge.svg)](https://codecov.io/gh/KevinMidboe/torrent_search) | [![Known Vulnerabilities](https://snyk.io/test/github/kevinmidboe/torrent_search/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/kevinmidboe/torrent_search?targetFile=requirements.txt) | [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE) ## Idea The idea behind this project is to create a modular torrent searcher/indexer in python. Currently we have the option to search for two sites, thepiratebay and with jackett. To add more sites one only needs to create a scraper script for a specific service, and from there create torrent class objects that are returned back to the search script. If the new site needs specific configuration values this can be set in the config.ini file and needs to be imported in the site selector in search.py. From 2f02a6dd805bec6cd19e20b00cacc045c0a8ccc8 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Jul 2021 19:15:20 +0200 Subject: [PATCH 7/7] Instead of manually defining dev deps, use requirements-dev. --- .drone.yml | 2 +- requirements-dev.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index cf3c47f..3c642dd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,7 +19,7 @@ steps: image: python:3.8 commands: - python setup.py install - - pip install pytest coverage codecov + - pip install -r requirements-dev.txt - coverage run -m pytest - codecov -t $CODECOV_TOKEN environment: diff --git a/requirements-dev.txt b/requirements-dev.txt index f7492ca..296ab08 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,4 @@ # dependencies for testing pytest>=3.2.5 codecov>=1.4.0 +coverage==5.5