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

Move tests folder to be aligned with develop template #170

Merged
merged 5 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions spaceflights-pyspark/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from kedro.framework.cli.starters import _parse_add_ons_input


def main(selected_add_ons_list):
def main(selected_add_ons):
current_dir = Path.cwd()
requirements_file_path = current_dir / "requirements.txt"
pyproject_file_path = current_dir / "pyproject.toml"
python_package_name = '{{ cookiecutter.python_package }}'

# Handle template directories and requirements according to selected add-ons
setup_template_add_ons(selected_add_ons_list, requirements_file_path, pyproject_file_path, python_package_name)
setup_template_add_ons(selected_add_ons, requirements_file_path, pyproject_file_path, python_package_name)

# Sort requirements.txt file in alphabetical order
sort_requirements(requirements_file_path)
Expand All @@ -24,10 +24,8 @@ def main(selected_add_ons_list):
if __name__ == "__main__":
# Get the selected add-ons from cookiecutter
selected_add_ons = "{{ cookiecutter.add_ons }}"
# Parse the add-ons to get a list
selected_add_ons_list = _parse_add_ons_input(selected_add_ons)

# Execute the script only if the PySpark add-on (represented by "6") is selected.
# Execute the script only if the Pyspark add-on is selected.
# This ensures the script doesn't run with kedro new --starter but only with the add-ons flow option.
if "6" in selected_add_ons_list:
main(selected_add_ons_list)
if "Pyspark" in selected_add_ons:
main(selected_add_ons)