diff --git a/.github/workflows/cookiecutter-test.yml b/.github/workflows/cookiecutter-test.yml index d84da7e..f0f13a9 100644 --- a/.github/workflows/cookiecutter-test.yml +++ b/.github/workflows/cookiecutter-test.yml @@ -10,7 +10,7 @@ env: PROJECT_DIR: "project_name" IMPORT_NAME: "project_name" ENTRYPOINT_NAME: "project-name" - PYTHON_VERSION: "3.9" + # PYTHON_VERSION: "3.9" MAMBA_ROOT_PREFIX: "~/micromamba" CONDARC_SOURCE: | notify_outdated_conda: false @@ -41,8 +41,7 @@ jobs: strategy: matrix: config_file: [ default_config.yaml, complex_config.yaml] - python_version: [ "3.6", "3.7", "3.8", "3.9", "3.10"] - + python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -70,6 +69,11 @@ jobs: git config --global user.email "pcds-bot@example.com" git config --global user.name "PCDS / GitHub CI" + - name: Append version to config + run: | + echo ' python_version: "${{ matrix.python_version }}"' >> tests/${{ matrix.config_file }} + cat tests/${{ matrix.config_file }} + - name: Use the cookiecutter run: | cookiecutter . --no-input --config-file tests/${{ matrix.config_file }} --output-dir "$HOME" @@ -77,11 +81,14 @@ jobs: - name: Build wheel and source distribution run: | export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) + export SETUPTOOLS_SCM_DEBUG=1 echo "Source date epoch set to ${SOURCE_DATE_EPOCH} for reproducible build" # See: https://github.com/python/cpython/pull/5200 # And: https://reproducible-builds.org/docs/source-date-epoch/ cd "${HOME}/${PROJECT_DIR}" python -m build --sdist --wheel --outdir ./dist + cat pyproject.toml + - name: Check the source distribution run: | diff --git a/README.rst b/README.rst index 9bb1694..73f57b9 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Python Package and Notebook Cookiecutter ======================================== -A project template for python projects and notebooks. This package is primarily intended for reserachers organize small projects +A project template for python projects and notebooks. This package is primarily intended for researchers to organize small projects consisting of modules and notebooks. To learn more about cookiecutter: @@ -29,15 +29,15 @@ Starting a New Project If using for the first time or in need of a new clone: :: - $ cookiecutter https://github.com/pcdshub/cookiecutter-pcds-python + $ cookiecutter https://github.com/n-wbrown/cookiecutter-python-notebook or :: - $ cookiecutter gh:pcdshub/cookiecutter-pcds-python + $ cookiecutter gh:n-wbrown/cookiecutter-python-notebook Otherwise: :: - $ cookiecutter cookiecutter-pcds-python + $ cookiecutter cookiecutter-python-notebook Configuring a New Project ------------------------- diff --git a/cookiecutter.json b/cookiecutter.json index 5c7bd68..d9eb8c1 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,14 +1,14 @@ { "project_name": "project-name", "repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}", - "author_name": "SLAC National Accelerator Laboratory", + "author_name": "Author Name", "email": "", "folder_name": "{{ cookiecutter.repo_name.replace('-', '_') }}", "github_repo_group": "pcdshub", "import_name": "{{ cookiecutter.folder_name }}", "description": "A short description of the project.", - "python_interpreter": ["python3", "python"], - "auto_git_setup": ["yes","no"], + "python_version": ["3.11", "3.10", "3.9", "3.8", "3.12"], + "auto_git_setup": ["no", "yes"], "git_remote_name": "origin", "readme_format": ["md", "rst"], "simple": ["yes", "no"] diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index 606a6f9..d89a0ef 100644 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -1,6 +1,6 @@ #!/bin/bash -{% if cookiecutter.auto_git_setup == "yes" %} git init +{% if cookiecutter.auto_git_setup == "yes" %} git add -A git remote add {{ cookiecutter.git_remote_name }} git@github.com:{{ cookiecutter.github_repo_group }}/{{ cookiecutter.repo_name }}.git git commit -am "Initial commit from cookiecutter-pcds-python" diff --git a/tests/default_config.yaml b/tests/default_config.yaml index 6912e72..f160141 100644 --- a/tests/default_config.yaml +++ b/tests/default_config.yaml @@ -1 +1 @@ -default_context: \ No newline at end of file +default_context: diff --git a/{{ cookiecutter.folder_name }}/pyproject.toml b/{{ cookiecutter.folder_name }}/pyproject.toml index 423161d..716449a 100644 --- a/{{ cookiecutter.folder_name }}/pyproject.toml +++ b/{{ cookiecutter.folder_name }}/pyproject.toml @@ -16,7 +16,7 @@ description = "{{ cookiecutter.description }}" dynamic = [ "version", "readme", "dependencies", "optional-dependencies",] keywords = [] name = "{{ cookiecutter.repo_name }}" -requires-python = ">=3.9" +requires-python = ">={{ cookiecutter.python_version }}" [options] zip_safe = false diff --git a/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'md' %}README.md{% endif %} b/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'md' %}README.md{% endif %} index 57c44a3..0023f08 100644 --- a/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'md' %}README.md{% endif %} +++ b/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'md' %}README.md{% endif %} @@ -11,7 +11,7 @@ ## Requirements -* Python 3.9+ +* Python {{ cookiecutter.python_version }}+ ## Installation ``` @@ -21,4 +21,4 @@ ## Running the Tests ``` $ pytest -v -``` \ No newline at end of file +``` diff --git a/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'rst' %}README.rst{% endif %} b/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'rst' %}README.rst{% endif %} index e9caebe..0a37878 100644 --- a/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'rst' %}README.rst{% endif %} +++ b/{{ cookiecutter.folder_name }}/{% if cookiecutter.readme_format== 'rst' %}README.rst{% endif %} @@ -15,7 +15,7 @@ Requirements ------------ -* Python 3.9+ +* Python {{ cookiecutter.python_version }}+ Installation ------------