diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 9d9bd4cb..0b56db30 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -22,7 +22,7 @@ import os {%- if cookiecutter.command_line_interface|lower == 'no' %} - os.unlink(join('src', '{{ cookiecutter.package_name }}', '__main__.py')) + os.unlink(join('src', '{{ cookiecutter.package_name|replace('-', '_') }}', '__main__.py')) {% endif %} {%- if cookiecutter.test_matrix_configurator|lower == 'no' %} diff --git a/{{cookiecutter.repo_name}}/.bumpversion.cfg b/{{cookiecutter.repo_name}}/.bumpversion.cfg index e66ab38d..a26d022a 100644 --- a/{{cookiecutter.repo_name}}/.bumpversion.cfg +++ b/{{cookiecutter.repo_name}}/.bumpversion.cfg @@ -5,4 +5,4 @@ tag = True [bumpversion:file:setup.py] [bumpversion:file:docs/conf.py] -[bumpversion:file:src/{{ cookiecutter.package_name }}/__init__.py] +[bumpversion:file:src/{{ cookiecutter.package_name|replace('-', '_') }}/__init__.py] diff --git a/{{cookiecutter.repo_name}}/MANIFEST.in b/{{cookiecutter.repo_name}}/MANIFEST.in index 33a4802c..49b230a8 100644 --- a/{{cookiecutter.repo_name}}/MANIFEST.in +++ b/{{cookiecutter.repo_name}}/MANIFEST.in @@ -18,4 +18,4 @@ include README.rst include tox.ini .travis.yml appveyor.yml -global-exclude *.py[cod] __pycache__ *.so +global-exclude *.py[cod] __pycache__ *.so *.dylib diff --git a/{{cookiecutter.repo_name}}/ci/templates/tox.ini b/{{cookiecutter.repo_name}}/ci/templates/tox.ini index e42be25f..4528e0de 100644 --- a/{{cookiecutter.repo_name}}/ci/templates/tox.ini +++ b/{{cookiecutter.repo_name}}/ci/templates/tox.ini @@ -59,7 +59,9 @@ deps = matrix skip_install = true commands = - python bootstrap.py + python ci/bootstrap.py +passenv = + * [testenv:check] basepython = python3.4 @@ -141,7 +143,7 @@ commands = {%- if cookiecutter.test_runner|lower == "pytest" %} {posargs:py.test --cov --cov-report=term-missing -vv} {%- else %} - {posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name }}} + {posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name|replace('-', '_') }}} {%- endif %} {%- raw %} {% endif %} diff --git a/{{cookiecutter.repo_name}}/docs/reference/index.rst b/{{cookiecutter.repo_name}}/docs/reference/index.rst index 67a2e6f3..3e267eeb 100644 --- a/{{cookiecutter.repo_name}}/docs/reference/index.rst +++ b/{{cookiecutter.repo_name}}/docs/reference/index.rst @@ -4,4 +4,4 @@ Reference .. toctree:: :glob: - {{cookiecutter.package_name}}* + {{ cookiecutter.package_name|replace('-', '_') }}* diff --git a/{{cookiecutter.repo_name}}/docs/reference/{{cookiecutter.package_name}}.rst b/{{cookiecutter.repo_name}}/docs/reference/{{cookiecutter.package_name}}.rst index 16716903..541a7e6f 100644 --- a/{{cookiecutter.repo_name}}/docs/reference/{{cookiecutter.package_name}}.rst +++ b/{{cookiecutter.repo_name}}/docs/reference/{{cookiecutter.package_name}}.rst @@ -1,5 +1,5 @@ -{{cookiecutter.package_name}} -============================= +{{ cookiecutter.package_name|replace('-', '_') }} +{{ "=" * cookiecutter.package_name|length }} -.. automodule:: {{cookiecutter.package_name}} +.. automodule:: {{ cookiecutter.package_name|replace('-', '_') }} :members: diff --git a/{{cookiecutter.repo_name}}/docs/usage.rst b/{{cookiecutter.repo_name}}/docs/usage.rst index 8b2def1b..a8e772b4 100644 --- a/{{cookiecutter.repo_name}}/docs/usage.rst +++ b/{{cookiecutter.repo_name}}/docs/usage.rst @@ -4,4 +4,4 @@ Usage To use {{ cookiecutter.project_name }} in a project:: - import {{ cookiecutter.package_name }} + import {{ cookiecutter.package_name|replace('-', '_') }} diff --git a/{{cookiecutter.repo_name}}/setup.cfg b/{{cookiecutter.repo_name}}/setup.cfg index aa0d5543..c1194283 100644 --- a/{{cookiecutter.repo_name}}/setup.cfg +++ b/{{cookiecutter.repo_name}}/setup.cfg @@ -36,9 +36,9 @@ addopts = [isort] force_single_line=True line_length=120 -known_first_party={{ cookiecutter.package_name }} +known_first_party={{ cookiecutter.package_name|replace('-', '_') }} default_section=THIRDPARTY -forced_separate=test_{{ cookiecutter.package_name }} +forced_separate=test_{{ cookiecutter.package_name|replace('-', '_') }} {%- if cookiecutter.test_matrix_configurator|lower == "yes" %} [matrix] @@ -82,4 +82,4 @@ coverage_flags = environment_variables = - -{% endif %} \ No newline at end of file +{% endif %} diff --git a/{{cookiecutter.repo_name}}/setup.py b/{{cookiecutter.repo_name}}/setup.py index 1d4b4b87..1193b542 100644 --- a/{{cookiecutter.repo_name}}/setup.py +++ b/{{cookiecutter.repo_name}}/setup.py @@ -117,7 +117,7 @@ def _unavailable(self, e): {%- if cookiecutter.command_line_interface|lower in ['plain', 'click'] %} entry_points={ 'console_scripts': [ - '{{ cookiecutter.distribution_name }} = {{ cookiecutter.package_name }}.__main__:main', + '{{ cookiecutter.distribution_name }} = {{ cookiecutter.package_name|replace('-', '_') }}.__main__:main', ] }, {%- endif %} diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/__init__.py b/{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name.replace('-','_')}}/__init__.py similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/__init__.py rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.package_name.replace('-','_')}}/__init__.py diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/__main__.py b/{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name.replace('-','_')}}/__main__.py similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/__main__.py rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.package_name.replace('-','_')}}/__main__.py diff --git a/{{cookiecutter.repo_name}}/tox.ini b/{{cookiecutter.repo_name}}/tox.ini index 2974a3b2..e6ca92bb 100644 --- a/{{cookiecutter.repo_name}}/tox.ini +++ b/{{cookiecutter.repo_name}}/tox.ini @@ -54,7 +54,7 @@ commands = {%- if cookiecutter.test_runner|lower == "pytest" %} {posargs:py.test --cov --cov-report=term-missing -vv} {%- else %} - {posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name }}} + {posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name|replace('-', '_') }}} {%- endif %} usedevelop = true