Skip to content
This repository has been archived by the owner on Dec 25, 2019. It is now read-only.

Commit

Permalink
Prepare a PyPi ready release
Browse files Browse the repository at this point in the history
  • Loading branch information
NyanKiyoshi committed Sep 16, 2018
1 parent 4f243be commit 42d01a8
Show file tree
Hide file tree
Showing 10 changed files with 235 additions and 56 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 NyanKiyoshi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
105 changes: 105 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.PHONY: build

MODULE:=texrrow

all: ensure-pip dev style checks dists test

ensure-pip:
pip install --user --upgrade pipenv pip
pip --version
pipenv --version

ensure-pip-ci:
pip install --upgrade pipenv pip
pip --version
pipenv --version

dev:
pipenv install --dev
pipenv run pip install -e .

dev-ci:
pipenv install --dev --skip-lock
pipenv run pip install -e .

dev-py2:
pipenv install --dev --two
pipenv run pip install -e .

style: isort autopep8 yapf

isort:
pipenv run isort -y

autopep8:
pipenv run autopep8 --in-place --recursive setup.py $(MODULE)

yapf:
pipenv run yapf --style .yapf --recursive -i $(MODULE)

checks: flake8 pylint

flake8:
pipenv run python setup.py flake8

pylint:
pipenv run pylint --rcfile=.pylintrc --output-format=colorized $(MODULE)

sc: style checks
sct: style checks test

build: dists

test:
pipenv run pytest $(MODULE)

test-verbose:
pipenv run pytest -s $(MODULE)

test-coverage:
pipenv run py.test -v --cov $(MODULE) --cov-report term-missing

dists: requirements sdist bdist wheels

requirements:
pipenv run pipenv_to_requirements -f

release: requirements

sdist: requirements
pipenv run python setup.py sdist

bdist: requirements
pipenv run python setup.py bdist

wheels: requirements
pipenv run python setup.py bdist_wheel

pypi-publish: build release
pipenv run twine upload --repository pypi dist/*.whl

pypi-test-publish: build release
pipenv run twine upload --repository testpypi dist/*.whl

update:
pipenv update

githook: style

push: githook
@git push origin --tags

clean:
pipenv --rm

prepare-release: requirements

# aliases to gracefully handle typos on poor dev's terminal
check: checks
devel: dev
develop: dev
dist: dists
install: install-system
pypi: pypi-publish
styles: style
wheel: wheels
5 changes: 4 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name = "pypi"
flask = "*"
flask-wtf = "*"
flask-babel = "*"
flask-bootstrap-4-alpha = {ref = "fork", git = "https://github.com/NyanKiyoshi/flask-bootstrap-4-alpha"}
keyboard = "*"
six = "*"
"flask-bootstrap-4-alpha" = "*"

[dev-packages]
pytest = "*"
Expand All @@ -21,3 +21,6 @@ mock = "*"

[requires]
python_version = "3"

[pipenv]
allow_prereleases = true
81 changes: 46 additions & 35 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 23 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,26 @@
# `Pipfile.lock` and then regenerate `requirements*.txt`.
################################################################################

blinker
coverage
flask-debugtoolbar
mock
pipenv-to-requirements
pytest
atomicwrites==1.2.1
attrs==18.2.0
blinker==1.4
certifi==2018.8.24
click==6.7
coverage==5.0a2
flask-debugtoolbar==0.10.1
flask==1.0.2
itsdangerous==0.24
jinja2==2.10
markupsafe==1.0
mock==2.0.0
more-itertools==4.3.0
pbr==4.2.0
pipenv-to-requirements==0.5.1
pipenv==2018.7.1
pluggy==0.7.1
py==1.6.0
pytest==3.8.0
six==1.11.0
virtualenv-clone==0.3.0
virtualenv==16.0.0
werkzeug==0.14.1
22 changes: 16 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
# `Pipfile.lock` and then regenerate `requirements*.txt`.
################################################################################

flask
flask-babel
flask-bootstrap-4-alpha
flask-wtf
keyboard
six
babel==2.6.0
click==6.7
dominate==2.3.1
flask-babel==0.11.2
flask-bootstrap-4-alpha==4.0.0b3.dev2
flask-wtf==0.14.2
flask==1.0.2
itsdangerous==0.24
jinja2==2.10
keyboard==0.13.2
markupsafe==1.0
pytz==2018.5
six==1.11.0
visitor==0.1.3
werkzeug==0.14.1
wtforms==2.2.1
19 changes: 14 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,39 @@
long_description = ''


requirements = []
if isfile('requirements.txt'):
with open('requirements.txt') as fp:
requirements = fp.readlines()


setup(
name='texarrow',
name='texrrow',
version='0.0.0',
author='NyanKiyoshi',
author_email='[email protected]',
description=(
'A simple python web-server to remotely control a LaTeX presentation '
'from a mobile phone to give dynamic and powerful speeches.'),
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/NyanKiyoshi/texrrow/',
license='MIT',
maintainer='NyanKiyoshi',
entry_points={
'console_scripts': [
'texrrow=texrrow.__main__:main']},
packages=find_packages(exclude=['tests']),
include_package_data=True,
data_files=[
('', ['README.md', 'LICENSE'])],
('', ['README.md', 'LICENSE', 'requirements.txt'])],
keywords=[],
extras_require={
'mysql': ['flask-mysqldb']},
install_requires=requirements,
classifiers=[
'Development Status :: 1 - Planning',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux'
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: BSD',
'Operating System :: POSIX :: BSD :: BSD/OS',
'Operating System :: POSIX :: BSD :: FreeBSD',
Expand Down
3 changes: 3 additions & 0 deletions texrrow/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def main():
from .application import create_app
create_app().run()
3 changes: 2 additions & 1 deletion texrrow/core/utils/environ.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from six import raise_from
from os import environ

from six import raise_from

E_INVALID_BOOL = '%r is an invalid boolean value.'


Expand Down
3 changes: 1 addition & 2 deletions texrrow/sendkeys/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from flask import Blueprint, Response, current_app

import keyboard
from flask import Blueprint, Response, current_app

sendkeys_bp = Blueprint(
url_prefix='/sendkeys', name='sendkeys', import_name=__name__)
Expand Down

0 comments on commit 42d01a8

Please sign in to comment.