Skip to content

Commit

Permalink
Add cruft update workflow option
Browse files Browse the repository at this point in the history
  • Loading branch information
CyclingNinja committed Jan 19, 2024
1 parent 0f441a2 commit 84614fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 78 deletions.
77 changes: 0 additions & 77 deletions .github/workflows/sub_package_update.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ venv.bak/
.spyderproject
.spyproject

# Pycharm project settings
.idea

# Rope project settings
.ropeproject

Expand Down
1 change: 1 addition & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"use_compiled_extensions": "n",
"enable_dynamic_dev_versions": "n",
"include_example_code": "n",
"include_cruft_update_github_workflow": "n",
"_sphinx_theme": "alabaster",
"_parent_project": "",
"_install_requires": "",
Expand Down
7 changes: 7 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@ def process_version(enable_dynamic_dev_versions):
remove_dir(os.path.join(PROJECT_DIRECTORY, '{{ cookiecutter.module_name }}', '_dev'))
remove_file(os.path.join(PROJECT_DIRECTORY, '{{ cookiecutter.module_name }}', 'version.py'))


def process_github_workflow(include_cruft_update_github_workflow):
if include_cruft_update_github_workflow != "y":
remove_dir(os.path.join(PROJECT_DIRECTORY, '{{ cookiecutter.module_name }}', '.github'))


if __name__ == '__main__':
process_license('{{ cookiecutter.license }}')
process_version('{{ cookiecutter.enable_dynamic_dev_versions }}')
process_github_workflow('{{ cookiecutter.include_cruft_update_github_workflow }}')
include_examples = '{{ cookiecutter.include_example_code }}' == 'y'
use_compiled = '{{ cookiecutter.use_compiled_extensions }}' == 'y'

Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.package_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ docs = [
"tomli; python_version <\"3.11\"",
]

{%0 if cookiecutter.include_example_code == 'y' %}
{%- if cookiecutter.include_example_code == 'y' %}
[project.scripts]
astropy_package_template_example = "{{ cookiecutter.module_name }}.example_mod:main"
{% endif -%}
Expand Down

0 comments on commit 84614fa

Please sign in to comment.