File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : linux-test
2+
3+ on :
4+ push :
5+ pull_request :
6+
7+ jobs :
8+ pytest :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - name : Set up Python 3.10
13+ uses : actions/setup-python@v3
14+ with :
15+ python-version : ' 3.10'
16+ - name : Install dependencies
17+ run : |
18+ pip install . -v
19+ pip install pytest
20+ - name : Update permissions
21+ run : |
22+ sudo chmod 755 /opt/hostedtoolcache/Python/3.10.12/x64/pyrclone/rclone
23+ - name : Test with pytest
24+ run : |
25+ make test
Original file line number Diff line number Diff line change 11import logging
22import subprocess
33import os
4+ import sys
45
56
67class RCloneWrapper :
@@ -11,9 +12,9 @@ def __init__(self, cfg):
1112 self .cfg = '\n ' .join (f'[{ name } ]\n ' + '\n ' .join (f'{ k } = { v } ' for k ,
1213 v in settings .items ()) for name , settings in cfg .items ())
1314 self .log = logging .getLogger ("RClone" )
14- cur_dir = os .path .dirname (os .path .realpath (__file__ ))
15- self .config_path = os .path .join (cur_dir , "rclone.conf" )
16- self .rclone_path = os .path .join (cur_dir , "rclone" )
15+ wrapper_dir = os .path .dirname (os .path .realpath (__file__ ))
16+ self .config_path = os .path .join (wrapper_dir , "rclone.conf" )
17+ self .rclone_path = os .path .join (sys . prefix , "pyrclone" , "rclone" )
1718
1819 def _execute (self , command_with_args ):
1920 # print(command_with_args)
Original file line number Diff line number Diff line change 44
55PROJECT_NAME = 'pyrclone'
66if os .name == 'nt' : # Windows
7- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['win/rclone.exe' ])
7+ rclone_binary = (f'{ PROJECT_NAME } ' , ['win/rclone.exe' ])
88elif os .name == 'posix' : # Unix-like
99 if os .uname ().sysname == 'Linux' :
10- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['linux/rclone' ])
10+ rclone_binary = (f'{ PROJECT_NAME } ' , ['linux/rclone' ])
1111 elif os .uname ().sysname == 'Darwin' :
12- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['mac/rclone' ])
12+ rclone_binary = (f'{ PROJECT_NAME } ' , ['mac/rclone' ])
1313else :
1414 raise NotImplementedError ('Unsupported OS' )
1515
1616setuptools .setup (
1717 name = "PyRCloneTest" ,
18- version = "0.0.1-v1.62.2 " ,
18+ version = "0.0.1" ,
1919 author = "Yuangang Li" ,
2020 author_email = "yuangangli@outlook.com" ,
2121 description = "A package that provides a wrapper for RClone" ,
You can’t perform that action at this time.
0 commit comments