Skip to content

Commit

Permalink
Prevent installation on Python 2 (Fixes #244)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Jun 2, 2018
1 parent 16ee535 commit 651f9ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ The format mostly follows [Keep a Changelog](http://keepachangelog.com/en/1.0.0/

### Changed
- Moved ChangeLog file to CHANGELOG.md and using Keep a Changelog format.
- Force version check in `setup.py`, to exclude Python 2 (Fixes #244)

### Removed
- Old ChangeLog entries
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Expand Up @@ -4,18 +4,23 @@

import os
import re
import sys

main_py = open(os.path.join('lib', 'urlwatch', '__init__.py')).read()
m = dict(re.findall("\n__([a-z]+)__ = '([^']+)'", main_py))
docs = re.findall('"""(.*?)"""', main_py, re.DOTALL)

if sys.version_info < (3, 3):
sys.exit('urlwatch requires Python 3.3 or newer')

m['name'] = 'urlwatch'
m['author'], m['author_email'] = re.match(r'(.*) <(.*)>', m['author']).groups()
m['description'], m['long_description'] = docs[0].strip().split('\n\n', 1)
m['install_requires'] = ['minidb', 'PyYAML', 'requests', 'keyring', 'pycodestyle', 'appdirs']
m['scripts'] = ['urlwatch']
m['package_dir'] = {'': 'lib'}
m['packages'] = ['urlwatch']
m['python_requires'] = '>3.3.0'
m['data_files'] = [
('share/man/man1', ['share/man/man1/urlwatch.1']),
('share/urlwatch/examples', [
Expand Down

0 comments on commit 651f9ae

Please sign in to comment.