Skip to content

Commit

Permalink
Fix use of template on windows introducing "py_pkg_name" template var…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed May 19, 2019
1 parent 526638e commit 1c490cf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"github_name": "myname",
"copyright": "2019, {{ cookiecutter.author }}",
"version": "0.1.0",
"release": "alpha"
"release": "alpha",
"py_pkg_name": "{{ cookiecutter.namespace|replace('-', '_') }}"
}
2 changes: 1 addition & 1 deletion {{ cookiecutter.namespace }}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ docs/source/_static
!docs/source/_static/theme_overrides.css

# copied spec files
src/pynwb/{{ cookiecutter.namespace|replace("-", "_") }}/spec/*.yaml
src/pynwb/{{ cookiecutter.py_pkg_name }}/spec/*.yaml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.namespace }}/NEXTSTEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ update `setup.py` setting the `package_data` and `include_package_data` keyword
```python
setup_args = {
# [...]
'package_data': {'{{ cookiecutter.namespace|replace("-", "_") }}': [
'package_data': {'{{ cookiecutter.py_pkg_name }}': [
'spec/{{ cookiecutter.namespace }}.namespace.yaml',
'spec/{{ cookiecutter.namespace }}.extensions.yaml',
]},
Expand Down
4 changes: 2 additions & 2 deletions {{ cookiecutter.namespace }}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
'packages': find_packages('src/pynwb'),
'package_dir': {'': 'src/pynwb'},
'package_data': {'{{ cookiecutter.namespace|replace("-", "_") }}': [
'package_data': {'{{ cookiecutter.py_pkg_name }}': [
'spec/{{ cookiecutter.namespace }}.namespace.yaml',
'spec/{{ cookiecutter.namespace }}.extensions.yaml',
]},
Expand All @@ -34,7 +34,7 @@ def _copy_spec_files(project_dir):
ns_path = os.path.join(project_dir, 'spec', '{{ cookiecutter.namespace }}.namespace.yaml')
ext_path = os.path.join(project_dir, 'spec', '{{ cookiecutter.namespace }}.extensions.yaml')

dst_dir = os.path.join(project_dir, 'src', 'pynwb', '{{ cookiecutter.namespace|replace("-", "_") }}', 'spec')
dst_dir = os.path.join(project_dir, 'src', 'pynwb', '{{ cookiecutter.py_pkg_name }}', 'spec')
if not os.path.exists(dst_dir):
os.mkdir(dst_dir)

Expand Down

0 comments on commit 1c490cf

Please sign in to comment.