Skip to content

Commit

Permalink
Layout update (#5)
Browse files Browse the repository at this point in the history
* Deleted old layout

* New layout in place
  • Loading branch information
bachya authored Aug 19, 2018
1 parent 88bd2d9 commit 427e619
Show file tree
Hide file tree
Showing 16 changed files with 162 additions and 87 deletions.
39 changes: 2 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
*.py[cod]

test.py

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject
.mypy_cache
Pipfile.lock
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 William Scanlon
Copyright (c) 2016 William Scanlon, 2018 Aaron Bach

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
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
init:
pip install --upgrade pip pipenv
pipenv lock
pipenv install --dev
lint:
pipenv run flake8 simplisafe-python
pipenv run pydocstyle simplisafe-python
publish:
python setup.py sdist bdist_wheel
pipenv run twine upload dist/*
rm -rf dist/ build/ .egg simplisafe-python.egg-info/
16 changes: 16 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true


[dev-packages]

"flake8" = "*"
pydocstyle = "*"
tox = "*"
twine = "*"

[packages]

requests = "*"
13 changes: 0 additions & 13 deletions pylintrc

This file was deleted.

19 changes: 0 additions & 19 deletions script/lint

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

130 changes: 130 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Define publication options."""

# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine

import io
import os
import sys
from shutil import rmtree

from setuptools import find_packages, setup, Command # type: ignore

# Package meta-data.
NAME = 'simplisafe-python'
DESCRIPTION = 'A unofficial Python 3 library for SimpliSafe alarm systems'
URL = 'https://github.com/w1ll1am23/simplisafe-python'
EMAIL = ''
AUTHOR = 'William Scanlon'
REQUIRES_PYTHON = '>=3.5.0'
VERSION = None

# What packages are required for this module to be executed?
REQUIRED = [ # type: ignore
'requests>=2.0'
]

# The rest you shouldn't have to touch too much :)
# ------------------------------------------------
# Except, perhaps the License and Trove Classifiers!
# If you do change the License, remember to change the Trove Classifier for
# that!

HERE = os.path.abspath(os.path.dirname(__file__))

# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
with io.open(os.path.join(HERE, 'README.rst'), encoding='utf-8') as f:
LONG_DESC = '\n' + f.read()

# Load the package's __version__.py module as a dictionary.
ABOUT = {} # type: ignore
if not VERSION:
with open(os.path.join(HERE, NAME, '__version__.py')) as f:
exec(f.read(), ABOUT) # pylint: disable=exec-used
else:
ABOUT['__version__'] = VERSION


class UploadCommand(Command):
"""Support setup.py upload."""

description = 'Build and publish the package.'
user_options = [] # type: ignore

@staticmethod
def status(string):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(string))

def initialize_options(self):
"""Add options for initialization."""
pass

def finalize_options(self):
"""Add options for finalization."""
pass

def run(self):
"""Run."""
try:
self.status('Removing previous builds…')
rmtree(os.path.join(HERE, 'dist'))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution…')
os.system('{0} setup.py sdist bdist_wheel --universal'.format(
sys.executable))

self.status('Uploading the package to PyPi via Twine…')
os.system('twine upload dist/*')

self.status('Pushing git tags…')
os.system('git tag v{0}'.format(ABOUT['__version__']))
os.system('git push --tags')

sys.exit()


# Where the magic happens:
setup(
name=NAME,
version=ABOUT['__version__'],
description=DESCRIPTION,
long_description=LONG_DESC,
long_description_content_type='text/markdown',
author=AUTHOR,
# author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=find_packages(exclude=('tests',)),
# If your package is a single module, use this instead of 'packages':
# py_modules=['mypackage'],

# entry_points={
# 'console_scripts': ['mycli=mymodule:cli'],
# },
install_requires=REQUIRED,
include_package_data=True,
license='MIT',
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
# $ setup.py publish support.
cmdclass={
'upload': UploadCommand,
},
)
File renamed without changes.
2 changes: 2 additions & 0 deletions simplipy/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Define a version constant."""
__version__ = '2.0.2'
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions src/setup.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
2 changes: 0 additions & 2 deletions tox.ini

This file was deleted.

0 comments on commit 427e619

Please sign in to comment.