Skip to content

Commit de8482b

Browse files
author
Jan Schaffranek
committed
Added a lot of config files
1 parent 3facce5 commit de8482b

23 files changed

+253
-154
lines changed

.coveragerc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[report]
2+
# Regexes for lines to exclude from consideration
3+
exclude_lines =
4+
# Have to re-enable the standard pragma
5+
pragma: no cover
6+
7+
# Don't complain about missing debug-only code:
8+
def __repr__
9+
if self\.debug
10+
11+
# Don't complain if tests don't hit defensive assertion code:
12+
raise AssertionError
13+
raise NotImplementedError
14+
15+
# Don't complain if non-runnable code isn't run:
16+
if 0:
17+
if __name__ == .__main__.:
18+
19+
[paths]
20+
source =
21+
fastvector/
22+
tests/
23+
24+
[coverage:run]
25+
omit =
26+
setup.py
27+

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- mode: conf-unix; -*-
2+
3+
# EditorConfig is awesome: http://EditorConfig.org
4+
5+
# top-most EditorConfig file
6+
root = true
7+
# defaults
8+
[*]
9+
insert_final_newline = true
10+
11+
# 4 space indentation
12+
[*.{ini,py,py.tpl,rst}]
13+
indent_style = space
14+
indent_size = 4
15+
16+
# 4-width tabbed indentation
17+
[*.{sh,bat.tpl,Makefile.tpl}]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
# and travis does its own thing
22+
[.travis.yml]
23+
indent_style = space
24+
indent_size = 2

.gitignore

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
################################
2+
########### FOLDERS ############
3+
################################
4+
# directories
5+
source/
6+
.vscode/
7+
8+
################################
9+
########### PYTHON ############
10+
################################
111
# Byte-compiled / optimized / DLL files
212
__pycache__/
313
*.py[cod]
414
*$py.class
5-
615
# C extensions
716
*.so
8-
917
# Distribution / packaging
1018
.Python
1119
build/
@@ -26,17 +34,14 @@ share/python-wheels/
2634
.installed.cfg
2735
*.egg
2836
MANIFEST
29-
3037
# PyInstaller
3138
# Usually these files are written by a python script from a template
3239
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3340
*.manifest
3441
*.spec
35-
3642
# Installer logs
3743
pip-log.txt
3844
pip-delete-this-directory.txt
39-
4045
# Unit test / coverage reports
4146
htmlcov/
4247
.tox/
@@ -50,57 +55,44 @@ coverage.xml
5055
*.py,cover
5156
.hypothesis/
5257
.pytest_cache/
53-
5458
# Translations
5559
*.mo
5660
*.pot
57-
5861
# Django stuff:
5962
*.log
6063
local_settings.py
6164
db.sqlite3
6265
db.sqlite3-journal
63-
6466
# Flask stuff:
6567
instance/
6668
.webassets-cache
67-
6869
# Scrapy stuff:
6970
.scrapy
70-
7171
# Sphinx documentation
7272
documentation/_build/
73-
7473
# PyBuilder
7574
target/
76-
7775
# Jupyter Notebook
7876
.ipynb_checkpoints
79-
8077
# IPython
8178
profile_default/
8279
ipython_config.py
83-
8480
# pyenv
8581
.python-version
86-
8782
# pipenv
8883
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
8984
# However, in case of collaboration, if having platform-specific dependencies or dependencies
9085
# having no cross-platform support, pipenv may install dependencies that don't work, or not
9186
# install all needed dependencies.
9287
#Pipfile.lock
93-
9488
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
9589
__pypackages__/
96-
9790
# Celery stuff
9891
celerybeat-schedule
9992
celerybeat.pid
10093

10194
# SageMath parsed files
10295
*.sage.py
103-
10496
# Environments
10597
.env
10698
.venv
@@ -109,21 +101,27 @@ venv/
109101
ENV/
110102
env.bak/
111103
venv.bak/
112-
113104
# Spyder project settings
114105
.spyderproject
115106
.spyproject
116-
117107
# Rope project settings
118108
.ropeproject
119-
120109
# mkdocs documentation
121110
/site
122-
123111
# mypy
124112
.mypy_cache/
125113
.dmypy.json
126114
dmypy.json
127-
128115
# Pyre type checker
129116
.pyre/
117+
118+
################################
119+
########### VS CODE ############
120+
################################
121+
.vscode/*
122+
!.vscode/settings.json
123+
!.vscode/tasks.json
124+
!.vscode/launch.json
125+
!.vscode/extensions.json
126+
*.code-workspace
127+
.history/

.isort.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[settings]
2+
line_length = 120
3+
indent = ' '
4+
skip = .tox, .venv, build, dist
5+
known_standard_library = StringIO, __builtin__
6+
known_setuptools = setuptools, pkg_resources
7+
known_test = pytest
8+
known_first_party = fastvector
9+
sections = FUTURE, STDLIB,SETUPTOOLS, TEST, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
10+
default_section = THIRDPARTY
11+
multi_line_output = 3
12+
include_trailing_comma = True
13+
force_grid_wrap = 0
14+
use_parentheses = True

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: python
2+
python:
3+
- "3.7"
4+
sudo: false
5+
# command to install dependencies
6+
install:
7+
- pip install -r requirements.txt
8+
# command to run tests
9+
script:
10+
- make test code-style code-lint
11+
after_success:
12+
- coveralls

Makefile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
SRC_APP=app
2+
SRC_CORE=fastvector
3+
SRC_TEST=tests
4+
SRC_DOC=documentation
5+
6+
ifeq ($(OS), Windows_NT)
7+
PYTHON=python
8+
PIP=pip
9+
RM=del /Q
10+
FixPath=$(subst /,\,$1)
11+
else
12+
PYTHON=python3
13+
PIP=pip3
14+
RM=rm -f
15+
FixPath=$1
16+
endif
17+
18+
help:
19+
@echo "Some available commands:"
20+
@echo " * run - Run code."
21+
@echo " * test - Run unit tests and test coverage."
22+
@echo " * doc - Document code (pydoc)."
23+
@echo " * clean - Cleanup (e.g. pyc files)."
24+
@echo " * code-pylint - Check code pylint."
25+
@echo " * code-flake8 - Check code flake8."
26+
@echo " * code-mypy - Check code mypy"
27+
@echo " * code-lint - Check code lints (pylint, flake8, mypy)."
28+
@echo " * code-isort - Sort the import statements."
29+
@echo " * code-autopep8 - Auto format the code for pep8."
30+
@echo " * code-format - Format code (isort, autopep8)."
31+
@echo " * deps-install - Install dependencies (see requirements.txt)."
32+
@echo " * deps-dev-install - Install dev. dependencies (see requirements-dev.txt)."
33+
34+
run:
35+
@$(PYTHON) $(SRC_APP)/main.py
36+
37+
test:
38+
@coverage run --source . -m $(SRC_TEST).test_vector
39+
@coverage report
40+
41+
doc:
42+
@build_docs.bat
43+
44+
clean:
45+
@$(RM) $(call FixPath,$(SRC_CORE)/*.pyc)
46+
@$(RM) $(call FixPath,$(SRC_CORE)/__pycache__)
47+
@$(RM) $(call FixPath,$(SRC_TEST)/*.pyc)
48+
@$(RM) $(call FixPath,$(SRC_TEST)/__pycache__)
49+
50+
code-pylint:
51+
@pylint $(SRC_CORE)
52+
53+
code-mypy:
54+
@mypy $(SRC_CORE)
55+
56+
code-lint: code-pylint code-mypy
57+
58+
code-isort:
59+
cd $(SRC_CORE)
60+
@isort --recursive .
61+
cd $(SRC_TEST)
62+
@isort --recursive .
63+
64+
code-pep8:
65+
@autopep8 -i -r $(SRC_CORE)
66+
67+
code-format: code-isort code-pep8
68+
69+
deps-install:
70+
@$(PIP) install -r requirements.txt
71+
72+
deps-dev-install:
73+
@$(PIP) install -r requirements-dev.txt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This is a template for Python projects. What you get:
2020
``` text
2121
├── setup.py
2222
└── documentation
23+
│   └── Makefile
2324
├── fastvector
2425
│   └── __init__.py
2526
│   └── vector.py

app/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from fastvector import VectorND
2+
3+
4+
def main():
5+
print("Hello world!")
6+
vec = VectorND(1, 2, 3)
7+
print(vec)
8+
9+
if __name__ == "__main__":
10+
main()
File renamed without changes.

build_docs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cd documentation
2+
sphinx-apidoc -o source/ ../fastvector/
3+
make html
4+
cd ..

0 commit comments

Comments
 (0)