Skip to content

Commit ab138e4

Browse files
committed
Add justfile to run commands
1 parent 5583a17 commit ab138e4

File tree

5 files changed

+120
-42
lines changed

5 files changed

+120
-42
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,55 +34,26 @@ jobs:
3434
- name: Install tools
3535
run: |
3636
pip install -r requirements_dev.txt
37-
./aux/fetch_aux.sh
3837
3938
- name: Run tests
4039
if: matrix.python-version == '3.10' # avoid hammering the sites
4140
continue-on-error: true
42-
run: |
43-
pytest \
44-
--showlocals \
45-
tests/*.py
41+
run: just test
4642

47-
- name: Check typings
48-
run: |
49-
mypy \
50-
--strict \
51-
engines/*.py \
52-
tests/*.py
53-
pyright \
54-
engines/*.py \
55-
tests/*.py
43+
- name: Run type check
44+
run: just check
5645

5746
- name: Lint code
58-
run: |
59-
pyflakes \
60-
engines/*.py \
61-
tests/*.py
62-
bandit \
63-
--skip B101,B110,B310,B314,B405 \
64-
engines/*.py \
65-
tests/*.py
47+
run: just lint
6648

6749
- name: Format code
6850
run: |
69-
# skipping E265, fixing it will break plugin usage on older qbt instances (< v4.1.2)
70-
pycodestyle \
71-
--ignore=E265,W503 \
72-
--max-line-length=1000 \
73-
--statistics \
74-
engines/*.py \
75-
tests/*.py
76-
isort \
77-
--check \
78-
--diff \
79-
--line-length 1000 \
80-
engines/*.py \
81-
tests/*.py
51+
just format
52+
just --fmt --unstable
53+
git diff --exit-code
8254
8355
- name: Build code
84-
run: |
85-
python -m compileall engines/*.py
56+
run: just build
8657

8758

8859
zizmor:

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
Search Plugins
22
===
3-
[![GitHub Actions CI Status](https://github.com/qbittorrent/search-plugins/workflows/CI/badge.svg)](https://github.com/qbittorrent/search-plugins/actions)
43

54
This repository contains search plugins for the search feature in [qBittorrent](https://github.com/qbittorrent/qBittorrent).
65

7-
:warning: We removed support for Python 2. Please, upgrade to Python 3 to continue using the search function.
8-
9-
Jackett search plugin is enabled by default but you have to install an external program to make it work. You can disable the Jackett search plugin or [install Jackett](https://github.com/qbittorrent/search-plugins/wiki/How-to-configure-Jackett-plugin).
6+
**Use the plugins and the websites they refer to at your own risk. You are personally responsible for following your country's copyright laws.**
107

118
Most probably, you want to head over to the [wiki](https://github.com/qbittorrent/search-plugins/wiki):
129
* [List of unofficial search plugins](https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins)
@@ -16,8 +13,16 @@ Most probably, you want to head over to the [wiki](https://github.com/qbittorren
1613
* [How to install search plugins](https://github.com/qbittorrent/search-plugins/wiki/Install-search-plugins)
1714
* [New Torznab search engine](https://github.com/qbittorrent/search-plugins/wiki/New-Torznab-search-engine)
1815

16+
## Contribute
17+
1918
Everyone is welcome to submit PRs that fix problems or add new plugins.
2019

2120
This repository isn't managed by the core team directly. Its purpose is to allow a place where 3rd party contributors can gather and submit their plugins.
2221

23-
**Use the plugins and the websites they refer to at your own risk. You are personally responsible for following your country's copyright laws.**
22+
## News
23+
24+
* 2020/08/19 \
25+
We removed support for Python 2. Please, upgrade to Python 3 to continue using the search function.
26+
27+
* 2020/04/26 \
28+
We are going to remove support for Python 2 soon. Please upgrade to Python 3 to be prepared and get a better experience.

nova3/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
nova3 Plugins
2+
===
3+
[![GitHub Actions CI Status](https://github.com/qbittorrent/search-plugins/workflows/CI/badge.svg)](https://github.com/qbittorrent/search-plugins/actions)
4+
5+
## Development Workflow
6+
7+
0. Prerequisite
8+
9+
Make sure you have [Python](https://www.python.org/) installed.
10+
11+
1. Setup Development Environment
12+
13+
Note that it is recommended to setup a [virtual environment][venv_guide] for development.
14+
15+
```shell
16+
pip install -r requirements_dev.txt
17+
```
18+
19+
[venv_guide]: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments
20+
21+
2. Run tests
22+
23+
```shell
24+
just test
25+
```
26+
27+
3. Run type check
28+
29+
```shell
30+
just check
31+
```
32+
33+
4. Run static analyzer
34+
35+
```shell
36+
just lint
37+
```
38+
39+
5. Apply formatting
40+
41+
```shell
42+
just format
43+
```
44+
45+
## References
46+
47+
* [How to write a search plugin](https://github.com/qbittorrent/search-plugins/wiki/How-to-write-a-search-plugin)
48+
* [justfile manual](https://just.systems/man/en/)

nova3/justfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# show available recipes to run
2+
default:
3+
just --list
4+
5+
# Run type check
6+
check files='engines/*.py tests/*.py': fetch_aux
7+
mypy \
8+
--strict \
9+
{{ files }}
10+
pyright \
11+
{{ files }}
12+
13+
# Byte-compile files
14+
build files='engines/*.py':
15+
python \
16+
-m compileall \
17+
{{ files }}
18+
19+
# Fetch auxiliary files
20+
[private]
21+
fetch_aux:
22+
#!/usr/bin/sh
23+
if [ ! -f aux/helpers.py ]; then
24+
./aux/fetch_aux.sh
25+
fi
26+
27+
# Apply formatting
28+
format files='engines/*.py tests/*.py':
29+
# skipping E265, fixing it will break plugin usage on older qbt instances (< v4.1.2)
30+
pycodestyle \
31+
--ignore=E265,W503 \
32+
--max-line-length=1000 \
33+
--statistics \
34+
{{ files }}
35+
isort \
36+
--check \
37+
--diff \
38+
--line-length 1000 \
39+
{{ files }}
40+
41+
# Run static analyzer
42+
lint files='engines/*.py tests/*.py':
43+
pyflakes \
44+
{{ files }}
45+
bandit \
46+
--skip B101,B110,B310,B314,B405 \
47+
{{ files }}
48+
49+
# Run tests
50+
test files='tests/*.py': fetch_aux
51+
pytest \
52+
--showlocals \
53+
{{ files }}

nova3/requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ pycodestyle
55
pyflakes
66
pyright
77
pytest
8+
rust-just

0 commit comments

Comments
 (0)