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

Commit

Permalink
Updated helpers. Pinning to Flake8 2.5.4 for now.
Browse files Browse the repository at this point in the history
Updating .gitignore and other helper files to the ones used in my other
projects.

Dropping PyPy3 support. Still based on Python 3.2 which now produces
deprecation warnings thanks to pip.

PyPI no longer produces download counters. Removing image.

Pinning all dependencies for tests/lints to prevent test failures caused
by API changes.
  • Loading branch information
Robpol86 committed Jul 30, 2016
1 parent b10527c commit 1de039e
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 57 deletions.
38 changes: 35 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
Expand All @@ -23,7 +23,6 @@ var/
*.egg-info/
.installed.cfg
*.egg
requirements*.txt

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -44,19 +43,52 @@ htmlcov/
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IntelliJ
# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Robpol86
*.rpm
.idea/
requirements*.txt
31 changes: 17 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Configure.
language: python

python: 3.5
sudo: false

addons:
apt:
sources:
- deadsnakes
packages:
- python3.5

install:
- pip install appveyor-artifacts coveralls tox

script:
- tox -e lint,py35,py34,py33,pypy3,pypy,py27,py26

# Run.
install: pip install appveyor-artifacts coveralls tox
script: tox -e lint,py35,py34,py33,pypy,py27,py26
after_success:
- mv .coverage .coverage.travis
- appveyor-artifacts -mi download
- coverage combine
- coveralls

# Deploy.
deploy:
provider: pypi
user: Robpol86
password:
secure:
"multi\
line\
encrypted"
on:
tags: true
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pip install tox # Install tox, which runs linting and tests.
tox # This runs all tests on your local machine. Make sure they pass.
```

If you don't have Python 2.6, 2.7, and 3.4 installed, you can manually run tests on one specific version by running
`tox -e lint,py27` (for Python 2.7) instead.
If you don't have Python 2.6, 2.7 or 3.4 installed you can manually run tests on one specific version by running
`tox -e lint,py35` (for Python 3.5) instead.

## Consistency and Style

Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Robpol86
Copyright (c) 2016 Robpol86

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ 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.

10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ flake8-pep257
This is just a simple flake8 plugin for the `pep257 <https://github.com/GreenSteam/pep257>`_ Python utility for
validating docstrings.

* Python 2.6, 2.7, PyPy, PyPy3, 3.3, 3.4, and 3.5 supported on Linux and OS X.
* Python 2.6, 2.7, PyPy, 3.3, 3.4, and 3.5 supported on Linux and OS X.
* Python 2.7, 3.3, 3.4, and 3.5 supported on Windows (both 32 and 64 bit versions of Python).

.. image:: https://img.shields.io/appveyor/ci/Robpol86/flake8-pep257/master.svg?style=flat-square&label=AppVeyor%20CI
Expand All @@ -24,10 +24,6 @@ validating docstrings.
:target: https://pypi.python.org/pypi/flake8-pep257
:alt: Latest Version

.. image:: https://img.shields.io/pypi/dm/flake8-pep257.svg?style=flat-square&label=PyPI%20Downloads
:target: https://pypi.python.org/pypi/flake8-pep257
:alt: Downloads

Quickstart
==========

Expand Down Expand Up @@ -57,6 +53,8 @@ Settings may be specified in ``tox.ini`` (under the ``[flake8]`` or ``[pep257]``
When specifying settings in ``tox.ini`` under the ``[flake8]`` section, use ``show-source`` instead of ``source`` and
``show-pep257`` instead of ``explain``.

.. changelog-section-start
Changelog
=========

Expand Down Expand Up @@ -90,3 +88,5 @@ Fixed
------------------

* Initial release.

.. changelog-section-end
13 changes: 5 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
init:
- set PATH=C:\Python35-x64;C:\Python35-x64\Scripts;%PATH%

# Configure.
artifacts:
- path: .coverage

build_script:
- pip install tox

test_script:
- tox -e lint,py35,py34,py33,py27,py35x64,py34x64,py33x64,py27x64
# Run.
init: set PATH=C:\Python35-x64;C:\Python35-x64\Scripts;%PATH%
build_script: pip install tox
test_script: tox -e lint,py35,py34,py33,py27,py35x64,py34x64,py33x64,py27x64
4 changes: 4 additions & 0 deletions flake8_pep257.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import pep8
import pkg_resources

__author__ = '@Robpol86'
__license__ = 'MIT'
__version__ = '1.0.5'


def load_file(filename):
"""Read file to memory.
Expand Down
27 changes: 15 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@

from setuptools import setup

NAME = 'flake8-pep257'
VERSION = '1.0.5'

def safe_read(path):
"""Try to read file or return empty string if failed.

:param str path: Relative file path to read.
def readme():
"""Try to read README.rst or return empty string if failed.
:return: File contents.
:rtype: str
"""
abspath, file_handle = os.path.join(os.path.abspath(os.path.dirname(__file__)), path), None
path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'README.rst'))
handle = None
url_prefix = 'https://raw.githubusercontent.com/Robpol86/{name}/v{version}/'.format(name=NAME, version=VERSION)
try:
file_handle = codecs.open(abspath, encoding='utf-8')
return file_handle.read(131072)
handle = codecs.open(path, encoding='utf-8')
return handle.read(131072).replace('.. image:: docs', '.. image:: {0}docs'.format(url_prefix))
except IOError:
return ''
finally:
getattr(file_handle, 'close', lambda: None)()
getattr(handle, 'close', lambda: None)()


setup(
Expand Down Expand Up @@ -53,10 +56,10 @@ def safe_read(path):
install_requires=['flake8', 'pep257'],
keywords='flake8 pep257 docstrings',
license='MIT',
long_description=safe_read('README.rst'),
name='flake8-pep257',
py_modules=['flake8_pep257'],
url='https://github.com/Robpol86/flake8-pep257',
version='1.0.5',
long_description=readme(),
name=NAME,
py_modules=[NAME.replace('-', '_')],
url='https://github.com/Robpol86/' + NAME,
version=VERSION,
zip_safe=True,
)
35 changes: 24 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[general]
author = @Robpol86
license = MIT
name = flake8_pep257
version = 1.0.5

[tox]
envlist = lint,py{34,27,26}

[testenv]
commands =
py.test --cov-append --cov-report term-missing --cov-report xml --cov flake8_pep257 --cov-config tox.ini \
py.test --cov-append --cov-report term-missing --cov-report xml --cov {[general]name} --cov-config tox.ini \
{posargs:tests}
deps =
pytest-cov
py26: subprocess32
flake8==2.5.4
pytest-cov==2.2.1
py26: subprocess32==3.2.7
usedevelop = True

[testenv:py35x64]
Expand All @@ -31,27 +38,33 @@ commands =
python setup.py check --strict
python setup.py check --strict -m
python setup.py check --strict -s
flake8
pylint --rcfile=tox.ini setup.py flake8_pep257
flake8 --application-import-names={[general]name},tests
pylint --rcfile=tox.ini setup.py {[general]name}
python -c "assert '{[general]author}' == __import__('{[general]name}').__author__"
python -c "assert '{[general]license}' == __import__('{[general]name}').__license__"
python -c "assert '{[general]version}' == __import__('{[general]name}').__version__"
python -c "assert 'author=\'{[general]author}\'' in open('setup.py').read(102400)"
python -c "assert 'license=\'{[general]license}\'' in open('setup.py').read(102400)"
python -c "assert 'VERSION = \'{[general]version}\'' in open('setup.py').read(102400)"
python -c "assert '\n{[general]version} - ' in open('README.rst').read(102400)"
deps =
coverage
flake8
coverage==4.0.3
flake8==2.5.4
flake8-import-order==0.5
pep8-naming
pylint
pep8-naming==0.3.3
pylint==1.5.4

[flake8]
application-import-names = flake8_pep257,tests
exclude = .tox/*,build/*,docs/*,env/*,get-pip.py
ignore = D203
import-order-style = google
max-line-length = 120
statistics = True

[pylint]
ignore = .tox/*,build/*,docs/*,env/*,get-pip.py
max-line-length = 120
reports = no
ignore = .tox/*,build/*,docs/*,env/*,get-pip.py

[run]
branch = True

0 comments on commit 1de039e

Please sign in to comment.