Skip to content

Commit 039f82a

Browse files
committed
first commit
1 parent 0cfae9b commit 039f82a

22 files changed

+592
-0
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 4
10+
max_line_length = 120
11+
12+
[*.sh]
13+
indent_style = space
14+
15+
[*.yml]
16+
indent_size = 2
17+
18+
[Makefile]
19+
end_of_line = lf
20+
charset = utf-8
21+
trim_trailing_whitespace = true
22+
insert_final_newline = true
23+
indent_style = tab

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export PIPENV_VENV_IN_PROJECT=./.venv/

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# Distribution / packaging
6+
env/
7+
.venv/
8+
.env/
9+
build/
10+
dist/
11+
eggs/
12+
sdist/
13+
target/
14+
*.egg-info/
15+
.installed.cfg
16+
*.egg
17+
18+
# Unit test / coverage reports
19+
.tox/
20+
.coverage
21+
.cache
22+
.pytest_cache
23+
24+
#Temporal files
25+
*~
26+
*#
27+
28+
#PyCharm Project
29+
.idea/
30+
31+
# MacOS
32+
.DS_Store
33+
34+
# Editors
35+
.vscode
36+
.ropeproject
37+
38+
*.sha
39+
*.log

.gitlab-ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
3+
stages:
4+
- test
5+
- tag
6+
- build
7+
- deploy
8+
9+
before_script:
10+
- export PIPENV_VENV_IN_PROJECT=~/.venv/
11+
- export PIPENV_NOSPIN=TRUE
12+
- scripts/setup.sh -d
13+
14+
after_script:
15+
- rm -rf ${PIPENV_VENV_IN_PROJECT}
16+
17+
lint_and_test:
18+
stage: test
19+
script:
20+
- make lint
21+
- make test
22+
23+
24+
deploy_dev:
25+
stage: deploy
26+
variables:
27+
APP_ENV: dev
28+
script:
29+
only:
30+
- develop
31+
- /^dev_.*$/
32+
33+
deploy_int:
34+
stage: deploy
35+
variables:
36+
APP_ENV: int
37+
script:
38+
only:
39+
- /^int_.*$/
40+
41+
deploy_qa:
42+
stage: deploy
43+
variables:
44+
APP_ENV: qa
45+
script:
46+
only:
47+
- /^qa_.*$/
48+
49+
deploy_prod:
50+
stage: deploy
51+
variables:
52+
APP_ENV: prod
53+
script:
54+
only:
55+
- /^prod_.*$/

.pylintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[MESSAGES CONTROL]
2+
disable=unused-argument,wrong-import-position,missing-docstring,old-style-class,ungrouped-imports,broad-except
3+
4+
[FORMAT]
5+
max-line-length = 120

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: python
2+
3+
matrix:
4+
include:
5+
- python: "3.5"
6+
- python: "3.6"
7+
8+
install:
9+
- pip install -U pipenv
10+
- pipenv run python setup.py install
11+
- pipenv install --dev
12+
13+
script:
14+
- pipenv run flake8 hello_python
15+
- pipenv run pytest -v
16+
- pipenv run pytest --cov=hello_python
17+
- pipenv run rstcheck README.md
18+
- pipenv run rstcheck CHANGELOG.md
19+
20+
after_success:
21+
- pipenv run coveralls
22+
- pipenv --rm

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.md
2+
include LICENSE

Makefile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
2+
project-name = hello_python
3+
4+
version-string := $(shell grep '__version__ = ' $(project-name)/version.py)
5+
version := $(subst __version__ = ,,$(version-string))
6+
7+
install:
8+
pipenv run python setup.py install
9+
pipenv install
10+
11+
develop:
12+
pipenv run python setup.py develop
13+
pipenv install --dev --skip-lock
14+
15+
cleanall: clean-build clean-pyc clean-env
16+
17+
clean: clean-build clean-pyc
18+
19+
clean-build:
20+
rm -fr build/
21+
rm -fr dist/
22+
rm -fr *.egg-info
23+
find . -name docker_target -exec rm -rf {} +
24+
25+
clean-env:
26+
pipenv --rm
27+
28+
clean-pyc:
29+
find . -name '*.pyc' -delete
30+
find . -name '*.pyo' -delete
31+
find . -name '*~' -delete
32+
find . -name '__pycache__' -exec rm -rf {} +
33+
find . -name '*.log*' -delete
34+
35+
lint:
36+
pipenv run flake8 $(project-name)
37+
38+
test:
39+
scripts/test.sh $(opts) -- -x -q
40+
41+
testall:
42+
pipenv run pytest
43+
44+
testloop:
45+
scripts/test.sh -m -- -x -q
46+
47+
release: clean
48+
pipenv run python setup.py sdist --formats gztar bdist_wheel
49+
50+
upload: release tag
51+
scripts/deploy.sh
52+
53+
tag:
54+
$(eval GIT_VERSION=`git rev-parse --short HEAD`)
55+
56+
@echo "Creating git tag v$(version)"
57+
@echo "Creating git tag $(GIT_VERSION)"
58+
59+
git tag v$(version)
60+
git tag $(GIT_VERSION)
61+
git push --tags
62+
63+
patch:
64+
pipenv run bumpversion patch
65+
66+
minor:
67+
pipenv run bumpversion minor
68+
69+
major:
70+
pipenv run bumpversion major
71+
72+
prodtag: clean
73+
@echo "Creating git tag prod_`date "+%Y_%m_%d_%H_%M"`"
74+
git tag prod_`date "+%Y_%m_%d_%H_%M"`
75+
git push --tags
76+
77+
qatag: clean
78+
@echo "Creating git tag qa_`date "+%Y_%m_%d_%H_%M"`"
79+
git tag qa_`date "+%Y_%m_%d_%H_%M"`
80+
git push --tags
81+
82+
devtag: clean
83+
@echo "Creating git tag dev_`date "+%Y_%m_%d_%H_%M"`"
84+
git tag dev_`date "+%Y_%m_%d_%H_%M"`
85+
git push --tags
86+
87+
inttag: clean
88+
@echo "Creating git tag int_`date "+%Y_%m_%d_%H_%M"`"
89+
git tag int_`date "+%Y_%m_%d_%H_%M"`
90+
git push --tags

Pipfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[packages]
9+
# list your dependencies here (arrow can be removed)
10+
arrow = "*"
11+
12+
13+
[dev-packages]
14+
15+
pytest-mock = "==1.6.3"
16+
pytest = "*"
17+
pytest-xdist = "*"
18+
pytest-cov = "*"
19+
pdbpp = "*"
20+
watchdog = "*"
21+
better_exceptions = "*"
22+
"flake8" = "*"
23+
mock = "*"
24+
bumpversion = "*"
25+
rstcheck = "*"

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# Python Hello World Project
3+
4+
5+
This is a Python project skeleton.
6+
Based on Makefile, pipenv, and pytest.
7+
8+
You need `pipenv` and `make` installed.
9+
10+
Replace all occurrences of `hello_python` for your project name.
11+
Rename the `hello_python` folder to your project name.
12+
13+
## Installation
14+
15+
```
16+
make install
17+
```
18+
19+
## Development
20+
21+
```
22+
make develop
23+
```
24+
25+
## Testing
26+
27+
```
28+
make test
29+
```
30+
31+
### Continuous test watch
32+
33+
```
34+
make testloop
35+
```

0 commit comments

Comments
 (0)