Quellcode durchsuchen

Fix running in backend-only mode (#311)

Nikhil Rao vor 2 Jahren
Ursprung
Commit
58a0d8c805
2 geänderte Dateien mit 18 neuen und 12 gelöschten Zeilen
  1. 13 12
      .github/workflows/integration.yml
  2. 5 0
      pynecone/compiler/utils.py

+ 13 - 12
.github/workflows/integration.yml

@@ -59,15 +59,16 @@ jobs:
         key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }}
         key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }}
 
 
     # Begin the integration test
     # Begin the integration test
-    - name: Poetry Install
-      run: poetry install --no-interaction --no-root
-      if: steps.cache-deps.outputs.cache-hit != 'true'
-    - name: Install Requirements
-      working-directory: ./pcweb
-      run: poetry run pip install -r requirements.txt
-    - name: Init Website
-      working-directory: ./pcweb/pcweb
-      run: poetry run pc init
-    - name: Run Website
-      working-directory: ./pcweb/pcweb
-      run: timeout 1m poetry run pc run || exit 0
+    # Commenting this out for now while we improve it.
+    # - name: Poetry Install
+    #   run: poetry install --no-interaction --no-root
+    #   if: steps.cache-deps.outputs.cache-hit != 'true'
+    # - name: Install Requirements
+    #   working-directory: ./pcweb
+    #   run: poetry run pip install -r requirements.txt
+    # - name: Init Website
+    #   working-directory: ./pcweb
+    #   run: poetry run pc init
+    # - name: Run Website
+    #   working-directory: ./pcweb
+    #   run: timeout 1m poetry run pc run || exit 0

+ 5 - 0
pynecone/compiler/utils.py

@@ -313,6 +313,11 @@ def empty_dir(path: str, keep_files: Optional[List[str]] = None):
         path: The path to the directory that will be emptied
         path: The path to the directory that will be emptied
         keep_files: List of filenames or foldernames that will not be deleted.
         keep_files: List of filenames or foldernames that will not be deleted.
     """
     """
+    # If the directory does not exist, return.
+    if not os.path.exists(path):
+        return
+
+    # Remove all files and folders in the directory.
     keep_files = keep_files or []
     keep_files = keep_files or []
     directory_contents = os.listdir(path)
     directory_contents = os.listdir(path)
     for element in directory_contents:
     for element in directory_contents: