diff --git a/.replit b/.replit new file mode 100644 index 0000000..4d3ef30 --- /dev/null +++ b/.replit @@ -0,0 +1,2 @@ +language = "python3" +run = "python setup.py install ; legit" diff --git a/.travis.yml b/.travis.yml index a4ce484..44bf4a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python dist: xenial python: - 2.7 - - 3.4 - 3.5 - 3.6 - 3.7 diff --git a/HISTORY.rst b/HISTORY.rst index dfadadc..0a36f67 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,10 @@ History ------- +1.2.0 ++++++ +* Officially drop support for Python 3.4 + 1.1.0 +++++ diff --git a/README.rst b/README.rst index 68681e7..f0982f8 100644 --- a/README.rst +++ b/README.rst @@ -58,6 +58,9 @@ The Installation .. image:: https://img.shields.io/coveralls/github/frostming/legit.svg :target: https://coveralls.io/r/frostming/legit/ +.. image:: https://repl.it/badge/github/frostming/legit + :target: https://repl.it/github/frostming/legit + From `PyPI `_ with the Python package manager:: diff --git a/legit/cli.py b/legit/cli.py index 5f3c7ba..ade4925 100644 --- a/legit/cli.py +++ b/legit/cli.py @@ -320,7 +320,7 @@ def do_edit_settings(fake): if fake: click.echo(crayons.red('Faked! >>> edit {}'.format(path))) else: - click.edit(path) + click.edit(filename=path) def handle_abort(aborted, type=None): diff --git a/legit/core.py b/legit/core.py index 21db024..837d103 100644 --- a/legit/core.py +++ b/legit/core.py @@ -10,6 +10,6 @@ from . import bootstrap del bootstrap -__version__ = '1.1.0' +__version__ = '1.2.0' __author__ = 'Kenneth Reitz' __license__ = 'BSD' diff --git a/legit/utils.py b/legit/utils.py index 81de96d..615b0b4 100644 --- a/legit/utils.py +++ b/legit/utils.py @@ -121,7 +121,7 @@ def black(s, **kwargs): if legit_settings.allow_black_foreground: return crayons.black(s, **kwargs) else: - return s.encode('utf-8') + return s def git_version(): diff --git a/reqs.txt b/reqs.txt deleted file mode 100644 index 1734c4a..0000000 --- a/reqs.txt +++ /dev/null @@ -1,5 +0,0 @@ -click==6.7 -clint==0.5.1 -crayons==0.1.2 -GitPython==2.1.8 -six==1.11.0 diff --git a/setup.py b/setup.py index f54f6eb..9915ecc 100644 --- a/setup.py +++ b/setup.py @@ -5,27 +5,53 @@ import sys import re from codecs import open # To use a consistent encoding +from shutil import rmtree -from setuptools import setup # Always prefer setuptools over distutils +from setuptools import setup, Command # Always prefer setuptools over distutils APP_NAME = "legit" with open("legit/core.py") as f: VERSION = re.findall(r'^__version__ *= *[\'"](.+?)[\'"]', f.read(), flags=re.M)[0] +settings = dict() -# Grab requirements. -with open("reqs.txt") as f: - required = f.readlines() +class UploadCommand(Command): + """Support setup.py upload.""" -settings = dict() + description = 'Build and publish the package.' + user_options = [] + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) -# Publish Helper. -if sys.argv[-1] == "publish": - os.system("python setup.py sdist bdist_wheel upload") - sys.exit() + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds...') + rmtree('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 -a {0} -m "v{0}"'.format(VERSION)) + os.system('git push --tags') + + sys.exit() if sys.argv[-1] == "build_manpage": @@ -46,8 +72,15 @@ author_email="me@kennethreitz.com", url="https://github.com/frostming/legit", packages=["legit"], - install_requires=required, + install_requires=[ + 'click', + 'clint', + 'crayons', + 'GitPython', + 'six' + ], license="BSD", + python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -57,12 +90,12 @@ "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", ], entry_points={"console_scripts": ["legit = legit.cli:cli"]}, + cmdclass={"publish": UploadCommand} )