Skip to content

Commit

Permalink
Merge pull request #21 from samueldg/py38
Browse files Browse the repository at this point in the history
Release 0.5.0: +py38, -py27, -py34
  • Loading branch information
samueldg committed Nov 24, 2019
2 parents d28cb58 + 7a470e9 commit 2dec8a3
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 67 deletions.
22 changes: 0 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
Expand All @@ -24,33 +21,14 @@ var/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
junit-*.xml

# virtualenv
venv/
.venv/
ENV/

# Mac OS
.DS_Store

# Sublime Text
*.sublime-build
*.sublime-project
*.sublime-workspace
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
- "3.7"
- "3.8"
install:
- pip install tox-travis coveralls
script:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Change Log
This document tracks changes to `clippings <https://pypi.python.org/pypi/clippings>`_ between releases.


`0.5.0`_ (2019-11-24)
---------------------

* [dist] Drop support for Python 2.7.
* [dist] Drop support for Python 3.4.
* [dist] Add support for Python 3.8, and include in CI.

`0.4.0`_ (2018-01-08)
---------------------

Expand Down Expand Up @@ -64,3 +71,4 @@ This document tracks changes to `clippings <https://pypi.python.org/pypi/clippin
.. _`0.2.1`: https://github.com/samueldg/clippings/compare/0.2.0...0.2.1
.. _`0.3.0`: https://github.com/samueldg/clippings/compare/0.2.1...0.3.0
.. _`0.4.0`: https://github.com/samueldg/clippings/compare/0.3.0...0.4.0
.. _`0.5.0`: https://github.com/samueldg/clippings/compare/0.4.0...0.5.0
2 changes: 0 additions & 2 deletions clippings/parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Parser for Amazon Kindle clippings file"""
from __future__ import print_function

import argparse
import json
import re
Expand Down
24 changes: 11 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import re
import sys

from setuptools import setup

from clippings import __version__

with open('clippings/__init__.py') as f:
# Not importing the file in setup.py!
VERSION = re.search(r"__version__ = '(?P<version>.*?)'", f.read()).group('version')

requirements = [
'python-dateutil==2.7.5',
]

if sys.version_info[0] == 2:
requirements.append('mock==2.0.0')

REQUIREMENTS = [
'python-dateutil~=2.7',
]

setup(
name='clippings',
version=__version__,
version=VERSION,
description='Amazon Kindle clippings parser',
long_description=(open('README.rst').read()),
url='http://github.com/samueldg/clippings/',
download_url = 'https://github.com/samueldg/clippings/tarball/' + __version__,
install_requires=requirements,
download_url = 'https://github.com/samueldg/clippings/tarball/' + VERSION,
install_requires=REQUIREMENTS,
license='MIT',
author='Samuel Dion-Girardeau',
author_email='samuel.diongirardeau@gmail.com',
Expand All @@ -39,13 +39,11 @@
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
Expand Down
6 changes: 1 addition & 5 deletions tests/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
import os.path
import sys
import unittest

try:
import unittest.mock as mock
except ImportError:
import mock
from unittest import mock

from clippings.parser import Clipping
from clippings.parser import Document
Expand Down
19 changes: 3 additions & 16 deletions tests/utils/context.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import sys

from contextlib import contextmanager

try:
# Python 2
from StringIO import StringIO
except ImportError:
# Python 3
from io import StringIO

try:
# Python 3
import unittest.mock as mock
except ImportError:
# Python 2
import mock
from io import StringIO
from unittest.mock import patch


@contextmanager
Expand All @@ -28,7 +15,7 @@ def cli_args(arg_list):
python -m clippings.parser test.txt -o dict
"""
mock_argv = ['clippings.py'] + arg_list
with mock.patch.object(sys, 'argv', mock_argv):
with patch.object(sys, 'argv', mock_argv):
yield


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36,py37
envlist = py35,py36,py37,py38

[testenv]
deps =
Expand All @@ -8,4 +8,4 @@ deps =
coverage
coveralls
commands =
py.test --cov clippings --cov-report term-missing
pytest --cov clippings --cov-report term-missing

0 comments on commit 2dec8a3

Please sign in to comment.