Skip to content

Commit

Permalink
Merge pull request #7 from n-wbrown/dev
Browse files Browse the repository at this point in the history
Fix python version, some docs
  • Loading branch information
n-wbrown authored Nov 20, 2023
2 parents 1fd2ffd + e9b0f47 commit 704ef54
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 16 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/cookiecutter-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -70,18 +69,26 @@ jobs:
git config --global user.email "[email protected]"
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"
- 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: |
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
-------------------------
Expand Down
6 changes: 3 additions & 3 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion hooks/post_gen_project.sh
Original file line number Diff line number Diff line change
@@ -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 }} [email protected]:{{ cookiecutter.github_repo_group }}/{{ cookiecutter.repo_name }}.git
git commit -am "Initial commit from cookiecutter-pcds-python"
Expand Down
2 changes: 1 addition & 1 deletion tests/default_config.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
default_context:
default_context:
2 changes: 1 addition & 1 deletion {{ cookiecutter.folder_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Requirements

* Python 3.9+
* Python {{ cookiecutter.python_version }}+

## Installation
```
Expand All @@ -21,4 +21,4 @@
## Running the Tests
```
$ pytest -v
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Requirements
------------

* Python 3.9+
* Python {{ cookiecutter.python_version }}+

Installation
------------
Expand Down

0 comments on commit 704ef54

Please sign in to comment.