Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
modified test and project generation to remove veresionneer
Browse files Browse the repository at this point in the history
  • Loading branch information
steff456 committed Jul 19, 2019
1 parent 902417c commit 9ea4288
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
31 changes: 2 additions & 29 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Does the following:
1. Removes _version file and run versioneer install if use_versioneer == y
"""

from __future__ import print_function
Expand All @@ -17,23 +16,6 @@ def remove_file(file_name):
os.remove(file_name)


def remove_version_file():
"""Removes the _version file if versioneer is going to be used."""
file_name = os.path.join(PROJECT_DIRECTORY,
'{{ cookiecutter.project_name }}',
'_version.py')
remove_file(file_name)


def install_versioneer():
"""Start versioneer in the repository, this will create
versioneer.py and _version.py."""
try:
call(['versioneer', 'install'])
except Exception:
print(
"versioneer isn't avalaible, please install versioneer and run:\n $ versioneer install")

def init_git():
"""Start git repository"""
try:
Expand All @@ -42,16 +24,7 @@ def init_git():
print("git isn't avalaible, please install git and run:\n $ git init")


# 1. Removes _version file and run versioneer install if use_versioneer == y

if '{{ cookiecutter.use_versioneer }}'.lower() == 'y':
remove_version_file()

init_git()
install_versioneer()


# 2. Moves gitattributes to .gitattributes
# 1. Moves gitattributes to .gitattributes
# Having a .gitattributes with wrong syntax (because it has some jinja syntax)
# cause some annoying warnings

Expand All @@ -61,7 +34,7 @@ def init_git():
os.rename(old_gitattributes, new_gitattributes)


# 3. Create empty assets directory
# 2. Create empty assets directory

assets_dir = os.path.join(PROJECT_DIRECTORY,
'{{ cookiecutter.project_name }}',
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.repo_name }}/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
spyder>=3.3
{%- else -%}
spyder>=4.0.0b3
{%- enfif -%}
{%- endif -%}
pytest
pytest-qt

0 comments on commit 9ea4288

Please sign in to comment.