Skip to content

Commit e0892ea

Browse files
Merge pull request #61 from HPCNow/main
froster v0.12.18
2 parents de3468b + edb9eac commit e0892ea

File tree

5 files changed

+24
-32
lines changed

5 files changed

+24
-32
lines changed

Diff for: .github/workflows/test-froster-config.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ jobs:
1818
with:
1919
python-version: '3.10'
2020

21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install .
21+
- name: Create and activate virtual environment
22+
run: |
23+
python -m venv venv
24+
source venv/bin/activate
25+
26+
- name: Install froster
27+
env:
28+
LOCAL_INSTALL: true
29+
run: ./install.sh
2530

2631
- name: Run unittests
2732
env:

Diff for: froster/froster.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def set_aws(self, aws: 'AWSBoto'):
472472
# Ask user to enter the path to a aws credentials directory
473473

474474
default_aws_dir = os.path.join(self.home_dir, '.aws')
475-
if not os.path.exists(os.path.join(self.home_dir, '.aws')):
476-
os.makedirs(self.aws_dir, exist_ok=True, mode=0o775)
475+
if not os.path.exists(default_aws_dir):
476+
os.makedirs(default_aws_dir, exist_ok=True, mode=0o775)
477477

478478
aws_dir_question = [
479479
inquirer.Path(

Diff for: install.sh

+10-23
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ install_froster() {
229229

230230
if [ "$LOCAL_INSTALL" = "true" ]; then
231231
echo " Installing from the current directory"
232-
pipx install . >/dev/null 2>&1 &
232+
pip install . >/dev/null 2>&1 &
233233
spinner $!
234234
else
235235
echo " Installing from PyPi package repository"
@@ -283,16 +283,9 @@ install_pwalk() {
283283

284284
# Move pwalk to froster's binaries folder
285285
echo " Moving pwalk to froster's binaries folder"
286-
if [ -d "${XDG_DATA_HOME}/pipx" ]; then
287-
mv ${pwalk_path}/pwalk ${XDG_DATA_HOME}/pipx/venvs/froster/bin/pwalk >/dev/null 2>&1
288-
elif [ -d "${HOME}/.local/pipx" ]; then
289-
mv ${pwalk_path}/pwalk ${HOME}/.local/pipx/venvs/froster/bin/pwalk >/dev/null 2>&1
290-
elif [ -v PIPX_HOME ]; then
291-
mv ${pwalk_path}/pwalk ${PIPX_HOME}/venvs/froster/bin/pwalk >/dev/null 2>&1
292-
else
293-
echo "Error: pipx installation path not found."
294-
exit 1
295-
fi
286+
froster_path=$(which froster)
287+
froster_dir=$(dirname ${froster_path})
288+
mv ${pwalk_path}/pwalk ${froster_dir}/pwalk >/dev/null 2>&1
296289

297290
# Delete downloaded pwalk files
298291
echo " Cleaning up pwalk installation files"
@@ -337,16 +330,10 @@ install_rclone() {
337330

338331
# Move rclone to froster's binaries folder
339332
echo " Moving rclone to froster's binaries folder"
340-
if [ -d "${XDG_DATA_HOME}/pipx" ]; then
341-
mv rclone-v*/rclone ${XDG_DATA_HOME}/pipx/venvs/froster/bin/rclone >/dev/null 2>&1
342-
elif [ -d "${HOME}/.local/pipx" ]; then
343-
mv rclone-v*/rclone ${HOME}/.local/pipx/venvs/froster/bin/rclone >/dev/null 2>&1
344-
elif [ -v PIPX_HOME ]; then
345-
mv rclone-v*/rclone ${PIPX_HOME}/venvs/froster/bin/rclone >/dev/null 2>&1
346-
else
347-
echo "Error: pipx installation path not found."
348-
exit 1
349-
fi
333+
froster_path=$(which froster)
334+
froster_dir=$(dirname ${froster_path})
335+
mv rclone-v*/rclone ${froster_dir}/rclone >/dev/null 2>&1
336+
350337

351338
# Remove the downloaded zip file
352339
echo " Cleaning up rclone installation files"
@@ -378,11 +365,11 @@ install_pwalk
378365
install_rclone
379366

380367
# Get the installed froster version
381-
version=$(pipx runpip froster show froster | grep Version | awk '{print $2}')
368+
version=$(froster -v | awk '{print $2}')
382369

383370
# Print success message
384371
echo
385-
echo "froster v$version has been successfully installed!"
372+
echo "froster $version has been successfully installed!"
386373

387374
# Print post-installation instructions
388375
echo

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "froster"
7-
version = "0.12.17"
7+
version = "0.12.18"
88
description = "Froster is a tool for easy data transfer between local file systems and AWS S3 storage."
99
authors = ["Victor Machado <[email protected]>"]
1010
readme = "README.md"

Diff for: tests/test_config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ def test_set_s3_select_bucket(self, mock_print, mock_list, mock_text):
12331233

12341234
if __name__ == '__main__':
12351235

1236-
if True:
1236+
if False:
12371237
unittest.main(verbosity=2)
12381238
else:
12391239
suite = unittest.TestSuite()
@@ -1254,7 +1254,7 @@ def test_set_s3_select_bucket(self, mock_print, mock_list, mock_text):
12541254
# suite.addTest(TestConfigAWS('test_set_aws'))
12551255
# suite.addTest(TestConfigShared('test_set_shared'))
12561256
# suite.addTest(TestConfigNIH('test_set_nih'))
1257-
# suite.addTest(TestConfigS3('test_set_s3'))
1257+
suite.addTest(TestConfigS3('test_set_s3'))
12581258

12591259
runner = unittest.TextTestRunner(verbosity=2)
12601260
runner.run(suite)

0 commit comments

Comments
 (0)