Skip to content

Commit

Permalink
Merge pull request #280 from jayvdb/dogfood
Browse files Browse the repository at this point in the history
Dogfood
  • Loading branch information
chfw authored Jul 8, 2019
2 parents 98d9b0b + 0d81242 commit e6b131f
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .moban.cd/moban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ dependencies:
- giturlparse>=0.9.1
description: Yet another jinja2 cli command for static text generation
scm_host: github.com
lint: sh lint.sh
lint_command: make lint install_test format install update
2 changes: 1 addition & 1 deletion .moban.d/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
{%block platform_block%}
{%endblock%}

{%block morefiles%} 'CONTRIBUTORS.rst',{%endblock%}
{%block morefiles%} "CONTRIBUTORS.rst",{%endblock%}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ stages:
python: 3.6
stage: lint
install: pip install flake8
script: sh lint.sh
script: make lint install_test format install update

jobs:
include:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
all: test

install:
pip install .

install_test:
pip install -r tests/requirements.txt

update:
moban -m mobanfile
git diff --exit-code

test:
bash test.sh

lint:
bash lint.sh

format:
isort -y $(find moban -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
black -l 79 moban
Expand Down
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flake8 . --exclude=.moban.d,docs --ignore=E203,E121,E123,E126,E226,E24,E704,W503,W504
flake8 --max-line-length=88 --exclude=.moban.d,docs --ignore=W503,W504
3 changes: 1 addition & 2 deletions moban/reporter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import moban.constants as constants

import crayons
import moban.constants as constants

MESSAGE_TEMPLATING = "Templating {0} to {1}"
MESSAGE_UP_TO_DATE = "Everything is up to date!"
Expand Down
45 changes: 28 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,22 @@
VERSION = "0.4.5"
EMAIL = "[email protected]"
LICENSE = "MIT"
ENTRY_POINTS = {"console_scripts": ["moban = moban.main:main"]}
DESCRIPTION = "Yet another jinja2 cli command for static text generation"
ENTRY_POINTS = {
"console_scripts": [
"moban = moban.main:main"
],
}
DESCRIPTION = (
"Yet another jinja2 cli command for static text generation"
)
URL = "https://github.com/moremoban/moban"
DOWNLOAD_URL = "%s/archive/0.4.5.tar.gz" % URL
FILES = ["README.rst", "CONTRIBUTORS.rst", "CHANGELOG.rst"]
KEYWORDS = ["python", "jinja2", "moban"]
KEYWORDS = [
"python",
"jinja2",
"moban",
]

CLASSIFIERS = [
"Topic :: Software Development :: Libraries",
Expand All @@ -49,8 +59,11 @@
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",

"Programming Language :: Python :: 3.7",

"Programming Language :: Python :: 3.8",

]

INSTALL_REQUIRES = [
Expand All @@ -66,19 +79,16 @@


PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"])
EXTRAS_REQUIRE = {}
EXTRAS_REQUIRE = {
}
# You do not need to read beyond this line
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(
sys.executable
)
GS_COMMAND = "gs moban v0.4.5 " + "Find 0.4.5 in changelog for more details"
NO_GS_MESSAGE = (
"Automatic github release is disabled. "
+ "Please install gease to enable it."
)
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
GS_COMMAND = ("gs moban v0.4.5 " +
"Find 0.4.5 in changelog for more details")
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
"Please install gease to enable it.")
UPLOAD_FAILED_MSG = (
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND
)
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
HERE = os.path.abspath(os.path.dirname(__file__))


Expand Down Expand Up @@ -121,7 +131,9 @@ def run(self):
sys.exit()


SETUP_COMMANDS.update({"publish": PublishCommand})
SETUP_COMMANDS.update({
"publish": PublishCommand
})


def has_gease():
Expand All @@ -132,7 +144,6 @@ def has_gease():
"""
try:
import gease # noqa

return True
except ImportError:
return False
Expand Down Expand Up @@ -201,5 +212,5 @@ def filter_out_test_code(file_handle):
zip_safe=False,
entry_points=ENTRY_POINTS,
classifiers=CLASSIFIERS,
cmdclass=SETUP_COMMANDS,
cmdclass=SETUP_COMMANDS
)
8 changes: 7 additions & 1 deletion test.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
pip freeze

nosetests --with-coverage --cover-package=moban --cover-package=tests && flake8 . --exclude=docs,.moban.d --ignore=E203,E121,E123,E126,E226,E24,E704,W503,W504
nosetests --with-coverage --cover-package=moban --cover-package=tests || goto :error

flake8 --max-line-length=88 --exclude=docs,.moban.d --ignore=W503,W504 || goto :error

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

0 comments on commit e6b131f

Please sign in to comment.