redfetch 0.2.1.dev0__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/.github/workflows/pipeline.yml +24 -10
  2. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/.gitignore +3 -0
  3. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/CHANGELOG.md +2 -2
  4. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/PKG-INFO +2 -2
  5. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/__about__.py +2 -2
  6. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/main.py +20 -16
  7. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/LICENSE +0 -0
  8. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/README.md +0 -0
  9. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/pyproject.toml +0 -0
  10. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/redfetch.ico +0 -0
  11. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/ResourceInstallBtn.js +0 -0
  12. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/__init__.py +0 -0
  13. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/api.py +0 -0
  14. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/auth.py +0 -0
  15. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/config.py +0 -0
  16. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/config_firstrun.py +0 -0
  17. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/db.py +0 -0
  18. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/download.py +0 -0
  19. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/listener.py +0 -0
  20. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/meta.py +0 -0
  21. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/push.py +0 -0
  22. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/settings.toml +0 -0
  23. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/terminal_ui.py +0 -0
  24. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/terminal_ui.tcss +0 -0
  25. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/src/redfetch/utils.py +0 -0
  26. {redfetch-0.2.1.dev0 → redfetch-0.2.6}/tests/test_is_special_or_dependency.py +0 -0
@@ -30,6 +30,7 @@ jobs:
30
30
  uses: actions/checkout@v4
31
31
  with:
32
32
  fetch-depth: 0 # Ensure full Git history is available for versioning
33
+ fetch-tags: true
33
34
 
34
35
  - name: Set Up Python
35
36
  uses: actions/setup-python@v5
@@ -71,7 +72,8 @@ jobs:
71
72
  needs: build-and-publish-python
72
73
  if: needs.build-and-publish-python.result == 'success'
73
74
  runs-on: windows-latest
74
-
75
+ outputs:
76
+ project-version: ${{ steps.set_version.outputs.version }}
75
77
  steps:
76
78
  - name: Checkout Code
77
79
  uses: actions/checkout@v4
@@ -107,8 +109,10 @@ jobs:
107
109
  run: pip install hatch
108
110
 
109
111
  - name: Set PYAPP_PROJECT_VERSION
112
+ id: set_version
110
113
  run: |
111
114
  "PYAPP_PROJECT_VERSION=${{ needs.build-and-publish-python.outputs.package-version }}" >> $env:GITHUB_ENV
115
+ echo "version=${{ needs.build-and-publish-python.outputs.package-version }}" >> $GITHUB_OUTPUT
112
116
  shell: pwsh
113
117
 
114
118
  - name: Set Up Rust
@@ -178,21 +182,31 @@ jobs:
178
182
  redfetch.exe
179
183
  description: 'RedFetch Executable'
180
184
 
185
+ - name: Upload Executable Artifact
186
+ uses: actions/upload-artifact@v4
187
+ with:
188
+ name: redfetch.exe
189
+ path: redfetch.exe
190
+
191
+ publish-to-redguides:
192
+ needs: build-and-publish-exe
193
+ if: startsWith(github.ref, 'refs/tags/v')
194
+ runs-on: ubuntu-latest
195
+ steps:
196
+ - name: Checkout Code
197
+ uses: actions/checkout@v4
198
+ - name: Download Executable Artifact
199
+ uses: actions/download-artifact@v4
200
+ with:
201
+ name: redfetch.exe
181
202
  - name: Redguides Publish
182
- if: startsWith(github.ref, 'refs/tags/v')
183
203
  uses: RedGuides/redguides-publish@v1
184
204
  env:
185
- REDGUIDES_API_KEY: ${{ secrets.REDGUIDES_API_KEY }}
205
+ REDGUIDES_API_KEY: ${{ secrets.REDGUIDES_API_KEY }}
186
206
  with:
187
207
  resource_id: '3177'
188
208
  description: 'README.md'
189
- version: ${{ env.PYAPP_PROJECT_VERSION }}
209
+ version: ${{ needs.build-and-publish-exe.outputs.project-version }}
190
210
  message: 'CHANGELOG.md'
191
211
  file: 'redfetch.exe'
192
212
  domain: 'https://raw.githubusercontent.com/RedGuides/redfetch/main/'
193
-
194
- - name: Upload Executable Artifact
195
- uses: actions/upload-artifact@v4
196
- with:
197
- name: redfetch.exe
198
- path: redfetch.exe
@@ -20,6 +20,9 @@ dist/
20
20
  # Local configuration
21
21
  *.local.toml
22
22
 
23
+ # Version file
24
+ src/redfetch/__about__.py
25
+
23
26
  # Database files
24
27
  *.db
25
28
 
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.0.0] - 2024-10-27
8
+ ## [0.2.6] - 2024-10-27
9
9
 
10
10
  ### Added
11
- - Initial release of the project
11
+ - Final pipeline test. I hope it works.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: redfetch
3
- Version: 0.2.1.dev0
3
+ Version: 0.2.6
4
4
  Summary: Download and publish EverQuest scripts and software using the RedGuides API
5
5
  Project-URL: Homepage, https://www.redguides.com
6
6
  Project-URL: Documentation, https://www.redguides.com/community/resources/redfetch.3177/
7
7
  Project-URL: Repository, https://github.com/RedGuides/redfetch
8
8
  Project-URL: Issues, https://github.com/RedGuides/redfetch/issues
9
9
  Project-URL: Changelog, https://github.com/RedGuides/redfetch/blob/main/CHANGELOG.md
10
- Project-URL: Source_archive, https://github.com/RedGuides/redfetch/archive/aa352f697589ec0b6cb49025dc03f426f5f22984.zip
10
+ Project-URL: Source_archive, https://github.com/RedGuides/redfetch/archive/f930eedfa3a9238d6486c1e1a2ac49c2fd38d418.zip
11
11
  Author-email: Redbot <ask@redguides.com>
12
12
  License-Expression: GPL-3.0-or-later
13
13
  License-File: LICENSE
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.1.dev0'
16
- __version_tuple__ = version_tuple = (0, 2, 1, 'dev0')
15
+ __version__ = version = '0.2.6'
16
+ __version_tuple__ = version_tuple = (0, 2, 6)
@@ -19,6 +19,10 @@ from redfetch import download
19
19
  from redfetch import utils
20
20
  from redfetch import push
21
21
 
22
+ class RedFetchError(Exception):
23
+ """Custom exception for RedFetch-related errors."""
24
+ pass
25
+
22
26
  def parse_arguments():
23
27
  parser = argparse.ArgumentParser(description="RedFetch CLI.", formatter_class=RichHelpFormatter)
24
28
 
@@ -51,8 +55,7 @@ def validate_settings():
51
55
  try:
52
56
  config.settings.validators.validate()
53
57
  except ValidationError as e:
54
- print(f"Validation error: {e}")
55
- sys.exit(1)
58
+ raise RedFetchError(f"Validation error: {e}")
56
59
  print("Server:", config.settings.current_env)
57
60
 
58
61
  def get_special_resource_status(resource_ids=None):
@@ -292,7 +295,7 @@ def handle_fetch(args):
292
295
  auth.logout()
293
296
  print("Logged out successfully.")
294
297
  else:
295
- print("Cannot logout when using API key from environment variable.")
298
+ raise RedFetchError("Cannot logout when using API key from environment variable.")
296
299
  return
297
300
 
298
301
  if not API_KEY:
@@ -313,14 +316,13 @@ def handle_fetch(args):
313
316
 
314
317
  if args.update_setting:
315
318
  num_args = len(args.update_setting)
319
+ if num_args not in [2, 3]:
320
+ raise RedFetchError("Error: --update-setting requires 2 or 3 arguments: SETTING_PATH VALUE [ENVIRONMENT]")
316
321
  if num_args == 2:
317
322
  setting_path, value = args.update_setting
318
323
  env = None
319
324
  elif num_args == 3:
320
325
  setting_path, value, env = args.update_setting
321
- else:
322
- print("Error: --update-setting requires 2 or 3 arguments: SETTING_PATH VALUE [ENVIRONMENT]")
323
- return
324
326
  setting_path_list = setting_path.split('.')
325
327
  config.update_setting(setting_path_list, value, env)
326
328
  print(f"Updated setting {setting_path} to {value}{' in environment ' + env if env else ''}.")
@@ -371,17 +373,19 @@ def main():
371
373
  args = parse_arguments()
372
374
  config.initialize_config()
373
375
 
374
- # Handle uninstall command early if needed
375
- if args.uninstall:
376
- meta.uninstall()
377
- return
376
+ try:
377
+ # Handle uninstall command early if needed
378
+ if args.uninstall:
379
+ meta.uninstall()
380
+ return
378
381
 
379
- # Check if the push command was called
380
- if args.command == 'push':
381
- handle_push(args)
382
- else:
383
- # Proceed with fetch-related operations
384
- handle_fetch(args)
382
+ if args.command == 'push':
383
+ handle_push(args)
384
+ else:
385
+ handle_fetch(args)
386
+ except Exception as e:
387
+ print(f"An error occurred: {e}", file=sys.stderr)
388
+ sys.exit(1) # Exit with non-zero code to indicate failure
385
389
 
386
390
  if __name__ == "__main__":
387
391
  main()
File without changes
File without changes
File without changes
File without changes