Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codebases for Python samples #1087

Merged
merged 1 commit into from
May 16, 2023
Merged

Add codebases for Python samples #1087

merged 1 commit into from
May 16, 2023

Conversation

jhuleatt
Copy link
Collaborator

@jhuleatt jhuleatt commented May 16, 2023

  • Move all main.py and requirements.txt into a functions folder to match the getting started guide
  • Add a firebase.json that declares a codebase for each python sample
  • Add a README for each sample (though it doesn't really say anything yet)

This was done by running the following shell script twice, once in the Python folder, and once in the Python/quickstarts folder:

for f in */main.py; do
    SAMPLE_FOLDER="${f%/main.py}"
    echo "${SAMPLE_FOLDER}"

    mkdir "${SAMPLE_FOLDER}/functions"
    mv "${SAMPLE_FOLDER}/main.py" "${SAMPLE_FOLDER}/functions/main.py"
    mv "${SAMPLE_FOLDER}/requirements.txt" "${SAMPLE_FOLDER}/functions/requirements.txt"
    touch "${SAMPLE_FOLDER}/README.md"
    echo "# ${SAMPLE_FOLDER}" > "${SAMPLE_FOLDER}/README.md"
    echo "{\n  \"functions\": {\n    \"codebase\": \"${SAMPLE_FOLDER}\"\n  }\n}" > "${SAMPLE_FOLDER}/firebase.json"
done

Probably easiest to review by browsing the Python directory for the branch.

NOTE: We'll have to update the snippets repo since the paths to samples changed

@jhuleatt jhuleatt marked this pull request as ready for review May 16, 2023 13:48
Copy link
Contributor

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, thanks Jeff!

@jhuleatt jhuleatt merged commit 3daa7a6 into main May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants