Skip to content

Commit

Permalink
Deploy using twine
Browse files Browse the repository at this point in the history
  • Loading branch information
maebert committed Sep 7, 2018
1 parent 54c531a commit f72268f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ docs/modules.rst

test.json
site/

.DS_Store
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ clean-test: ## remove test and coverage artifacts
lint: ## check style with flake8
flake8 shellcraft tests src

test: ## run tests quickly with the default Python
pytest
test:
pytest

test-all: ## run tests on every Python version with tox
tox
Expand All @@ -62,23 +62,21 @@ coverage: ## check code coverage quickly with the default Python
coverage html
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
docs:
mkdocs build --clean
$(BROWSER) site/index.html

servedocs: docs ## compile the docs watching for changes
servedocs:
mkdocs serve

release: clean ## package and upload a release
python setup.py sdist upload
python setup.py bdist_wheel upload
mkdocs gh-deploy

dist: clean ## builds source and wheel package
dist: clean lint test## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
ls -l dist

release: dist ## package and upload a release
twine upload dist/*

install: clean ## install the package to the active Python's site-packages
python setup.py install

Expand Down
3 changes: 2 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ flake8>=2.6.0
tox>=2.3.1
coverage>=4.1
pytest>=2.9.2
mkdocs==1.0.3
mkdocs>=1.0.3
twine>=1.11.0
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.7
current_version = 0.9.9
commit = False
allow_dirty = True
tag = False
Expand All @@ -12,7 +12,7 @@ replace = __version__ = '{new_version}'
universal = 1

[flake8]
exclude = docs
exclude = docs, *pb2.py
ignore = E501

[metadata]
Expand Down
2 changes: 1 addition & 1 deletion src/shellcraft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = 'Manuel Ebert'
__email__ = 'manuel@1450.me'
__version__ = '0.9.8'
__version__ = '0.9.9'
5 changes: 3 additions & 2 deletions src/shellcraft/_cli_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ def echo(s, *vals, **kwargs):
if not line.startswith(">"):
for l in textwrap.wrap(line, width=min(60, term_width - 2)):
if l.startswith("`"):
l = "\n " + l + "\n"
result += l + "\n"
result += "\n " + l + "\n"
else:
result += l + "\n"
result += "\n"
else:
# Format letter
Expand Down
2 changes: 1 addition & 1 deletion src/shellcraft/_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def _round(i):
r, g, b = map(_round, rgb)
return 16 + r * 36 + g * 6 + b


@property
def ansi(self):
"""Generate ANSI escape sequence for color."""
Expand Down Expand Up @@ -89,6 +88,7 @@ def __call__(self, text, ratio=.5):
mix = self._generate(ratio)
return mix.ansi + text + mix.clear


Color.yellow = Color('F5C065')
Color.green = Color('58BD86')
Color.blue = Color('798BDF')
Expand Down
9 changes: 7 additions & 2 deletions src/shellcraft/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import datetime
import os
import sys
import traceback

click.disable_unicode_literals_warning = True

Expand Down Expand Up @@ -37,7 +38,10 @@ def inner(**kwargs):
game.tutorial.cont()
game.save()
except Exception as e:
handle_exception(e)
if game.state.debug:
traceback.print_exc()
else:
handle_exception(e)
return inner


Expand Down Expand Up @@ -111,7 +115,6 @@ def mine(game, resource):
if resource not in game.state.resources_enabled:
raise ResourceNotAvailable(resource)


duration, quantity = game.mine(resource)
game.save()

Expand Down Expand Up @@ -179,6 +182,7 @@ def inventory(game):
echo(str(item))
# echo("${}$ ({:.0%})", item.name, item.condition / item.durability)


@cli.command(options_metavar='')
@click.pass_obj
def automata(game):
Expand All @@ -190,6 +194,7 @@ def automata(game):
echo(str(item))
# echo("${}$ ({:.0%})", item.name, item.condition / item.durability)


@cli.command(options_metavar='')
@click.argument("projects", nargs=-1, type=str, metavar="<project>")
@click.pass_obj
Expand Down
2 changes: 1 addition & 1 deletion src/shellcraft/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __bool__(self):
@property
def is_empty(self):
"""True if the proxy does not contain any items."""
return not self._filtered_items
return not list(self._filtered_items)

def __repr__(self):
"""String representation of item proxy."""
Expand Down
2 changes: 1 addition & 1 deletion src/shellcraft/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Exceptions."""

from __future__ import absolute_import, division, print_function, unicode_literals

import datetime
from shellcraft.grammar import VERBS


Expand Down

0 comments on commit f72268f

Please sign in to comment.