-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huntzhan
committed
Aug 11, 2016
0 parents
commit 80be5ea
Showing
18 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# vim | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
- pip install -e . | ||
|
||
script: | ||
- py.test | ||
|
||
# after_success: | ||
# - coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include README.md | ||
include requirements.txt | ||
recursive-include tests * | ||
recursive-include scripts * | ||
global-exclude __pycache__ | ||
global-exclude *.py[co] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Init: | ||
|
||
1. `./bash-scripts/pip-install-pkgs-of-requirements.sh` | ||
2. `python setup.py develop` | ||
|
||
Cleanup: | ||
|
||
1. `python setup.py develop --uninstall` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sys | ||
|
||
collect_ignore = [] | ||
if sys.version_info.major < 3: | ||
# controlling pytest testcase collection. | ||
# collect_ignore.append("tests/test_py3_annotation.py") | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import ( | ||
division, absolute_import, print_function, unicode_literals, | ||
) | ||
from builtins import * # noqa | ||
from future.builtins.disabled import * # noqa | ||
|
||
|
||
def entry_point(): | ||
print("entry_point") | ||
return 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import ( | ||
division, absolute_import, print_function, unicode_literals, | ||
) | ||
|
||
|
||
NAME = 'img2url' | ||
VERSION = '0.1.0' | ||
AUTHORS = [ | ||
'huntzhan', | ||
] | ||
EMAILS = [ | ||
'[email protected]', | ||
] | ||
LICENSE = '' | ||
URL = '' | ||
DESCRIPTION = 'upload image to github and return corresponding url.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
addopts = -x --flake8 --cov-report term-missing --cov=img2url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pytest>=2.7.2 | ||
# bug fix: a dependency of pytest-pep8 require setuptools-scm, | ||
# in the case that pip could not properly handle in offline environment. | ||
setuptools-scm | ||
wheel | ||
pytest-flake8 | ||
pytest-cov | ||
pytest-mock | ||
pytest-travis-fold | ||
coveralls | ||
|
||
future |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#!/usr/bin/env bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#!/usr/bin/env bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
PROJECT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) | ||
for line in $(cat "${PROJECT_DIR}/requirements.txt" | grep -v ^#) | ||
do | ||
pip install $line | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python setup.py register | ||
python setup.py sdist upload | ||
python setup.py bdist_wheel upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python setup.py register -r test | ||
python setup.py sdist upload -r test | ||
python setup.py bdist_wheel upload -r test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[metadata] | ||
description-file = README.md | ||
|
||
[bdist_wheel] | ||
universal = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from __future__ import ( | ||
division, absolute_import, print_function, unicode_literals, | ||
) | ||
|
||
import codecs | ||
import imp | ||
import os | ||
from setuptools import setup, find_packages | ||
|
||
# load metadata. | ||
metadata = imp.load_source( | ||
'metadata', | ||
os.path.join('img2url', 'metadata.py'), | ||
) | ||
|
||
|
||
def read(fname): | ||
file_path = os.path.join(os.path.dirname(__file__), fname) | ||
return codecs.open(file_path, encoding='utf-8').read() | ||
|
||
|
||
def load_requirements(fname): | ||
# only handles a simple subset of requirements format. | ||
pkgs = [] | ||
for line in read(fname).split(os.linesep): | ||
if not line or line.startswith('#'): | ||
continue | ||
pkgs.append(line) | ||
return pkgs | ||
|
||
|
||
setup( | ||
# informations. | ||
name=metadata.NAME, | ||
version=metadata.VERSION, | ||
author=metadata.AUTHORS[0], | ||
author_email=metadata.EMAILS[0], | ||
maintainer=metadata.AUTHORS[0], | ||
maintainer_email=metadata.EMAILS[0], | ||
license=metadata.LICENSE, | ||
url=metadata.URL, | ||
description=metadata.DESCRIPTION, | ||
long_description=read('README.md'), | ||
# https://pypi.python.org/pypi?:action=list_classifiers | ||
classifiers=[ | ||
'License :: OSI Approved :: MIT License', | ||
'Development Status :: 1 - Planning', | ||
'Intended Audience :: Developers', | ||
'Topic :: Software Development :: Libraries', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
], | ||
# critical configurations. | ||
packages=find_packages(), | ||
install_requires=load_requirements('requirements.txt'), | ||
entry_points={ | ||
'console_scripts': [ | ||
'img2url = img2url.main:entry_point' | ||
], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import ( | ||
division, absolute_import, print_function, unicode_literals, | ||
) | ||
from builtins import * # noqa | ||
from future.builtins.disabled import * # noqa | ||
|
||
# remove following code. | ||
from img2url.main import entry_point | ||
|
||
|
||
def test_entry_point(): | ||
assert 42 == entry_point() |