Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gitignore template #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 74 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,81 @@
*.py[co]
# Automatically generated by nengo-bones, do not edit this file directly
# Version: 0.2.2.dev0

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.dist-info/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Testing / coverage
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
coverage.xml
*.cover
.pytest_cache/

# Sphinx
_build/
.doctrees

# Jupyter
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# OS related
.DS_Store
_build
build
dist
*.egg-info
Thumbs.db
[Dd]esktop.ini

# Editor related
*~
*.bak
*.swp
log.txt
.ipynb_checkpoints/
.cache
.tox
.vagrant
wintest.sh
Vagrantfile
*.class
*.eggs/
.coverage
htmlcov
*.dist-info/
.vscode
.idea
.pytest_cache/

# Nengo Bones
.ci/*.sh
docs/examples/*
!docs/examples/**/*.ipynb

# Nengo Bones
docs/examples/**/*.py
4 changes: 4 additions & 0 deletions .nengobones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,7 @@ docs_conf_py:
intersphinx_mapping:
click: https://click.palletsprojects.com/en/7.x
analytics_id: UA-41658423-2

gitignore:
extra:
- docs/examples/**/*.py
9 changes: 5 additions & 4 deletions nengo_bones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
from nengo_bones.config import load_config

all_templated_files = {
".travis.yml": "travis_yml",
".codecov.yml": "codecov_yml",
"docs/conf.py": "docs_conf_py",
"setup.cfg": "setup_cfg",
"setup.py": "setup_py",
".codecov.yml": "codecov_yml",
".gitignore": "gitignore",
".travis.yml": "travis_yml",
"CONTRIBUTING.rst": "contributing_rst",
"CONTRIBUTORS.rst": "contributors_rst",
"LICENSE.rst": "license_rst",
"MANIFEST.in": "manifest_in",
"setup.cfg": "setup_cfg",
"setup.py": "setup_py",
}
3 changes: 3 additions & 0 deletions nengo_bones/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ def validate_config(config):
for ci_config in config["ci_scripts"]:
validate_ci_config(ci_config)

if "gitignore" in config:
check_list(config["gitignore"], "extra")

# TODO: check that there aren't unused config options in yml


Expand Down
8 changes: 8 additions & 0 deletions nengo_bones/scripts/generate_bones.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,13 @@ def docs_conf_py(ctx):
template_file="docs_conf.py.template")


@main.command()
@click.pass_context
def gitignore(ctx):
"""Generate setup.cfg file."""

render_template(ctx, "gitignore", ".gitignore")


if __name__ == "__main__":
main(obj={}) # pragma: no cover pylint: disable=no-value-for-parameter
85 changes: 85 additions & 0 deletions nengo_bones/templates/.gitignore.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Automatically generated by nengo-bones, do not edit this file directly
# Version: {{ version }}

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.dist-info/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Testing / coverage
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
coverage.xml
*.cover
.pytest_cache/

# Sphinx
_build/
.doctrees

# Jupyter
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# OS related
.DS_Store
Thumbs.db
[Dd]esktop.ini

# Editor related
*~
*.bak
*.swp
.vscode
.idea

# Nengo Bones
.ci/*.sh

{% if extra %}
# {{ project_name }}
{% for extra_item in extra %}
{{ extra_item }}
{% endfor %}
{% endif %}