Skip to content

Commit

Permalink
Move tests folder to be aligned with develop template (#170)
Browse files Browse the repository at this point in the history
* Update post_gen_project.py

Signed-off-by: SajidAlamQB <[email protected]>

* move tests for spaceflights-pyspark

Signed-off-by: SajidAlamQB <[email protected]>

* move all test folders

Signed-off-by: SajidAlamQB <[email protected]>

* update comment

Signed-off-by: SajidAlamQB <[email protected]>

* Update post_gen_project.py

Signed-off-by: SajidAlamQB <[email protected]>

---------

Signed-off-by: SajidAlamQB <[email protected]>
  • Loading branch information
SajidAlamQB authored Oct 25, 2023
1 parent 2c5274b commit 542cd26
Show file tree
Hide file tree
Showing 31 changed files with 5 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
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)

0 comments on commit 542cd26

Please sign in to comment.