posit-dev / posit-dev/rsconnect-python
deploy manifest errs when give a directory containing a manifest
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 37
- Forks
- 28
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 7
Beschreibung
The help for deploy manifest reads:
Usage: rsconnect deploy manifest [OPTIONS] FILE
Deploy content to Posit Connect, Posit Cloud, or shinyapps.io using an
existing manifest.json file. The specified file must either be named
"manifest.json" or refer to a directory that contains a file named
"manifest.json".
However, when providing a directory that contains a manifest.json, an error results.
Traceback (most recent call last):
File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/main.py", line 108, in wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "BASE_DIR/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/main.py", line 1119, in deploy_manifest
kwargs["title"] = title or default_title_from_manifest(file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/bundle.py", line 744, in default_title_from_manifest
source_manifest, _ = read_manifest_file(file)
^^^^^^^^^^^^^^^^^^^^^^^^
File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/bundle.py", line 757, in read_manifest_file
with open(manifest_path, "rb") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: 'model'
Internal error: [Errno 21] Is a directory: 'model'
Providing the path to the manifest.json works.
# error
rsconnect deploy manifest model
# no error
rsconnect deploy manifest model/manifest.json
Using rsconnect-python 1.23.0.
The manifest is correctly identified:
rsconnect.bundle.validate_manifest_file("model")
#> 'model/manifest.json'
However, in deploy_manifest(), we rewrite the incoming file to file_name but do not consistently use that variable.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in rsconnect/main.py bei deploy_manifest(), folge dann default_title_from_manifest() und read_manifest_file() in rsconnect/bundle.py. Vergleiche, wie file und file_name nach der Manifestvalidierung verwendet werden, und verifiziere, dass sowohl rsconnect deploy manifest model als auch der direkte Manifestpfad ohne den Verzeichnisfehler abgeschlossen werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100