Skip to content

Commit 6a78427

Browse files
committed
Updated setup.py and Travis config
1 parent 322010d commit 6a78427

File tree

6 files changed

+43
-10
lines changed

6 files changed

+43
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var/
3131
*.egg-info/
3232
.installed.cfg
3333
*.egg
34+
.eggs/
3435

3536
# PyInstaller
3637
# Usually these files are written by a python script from a template

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ sudo: false
33

44
python:
55
- 3.4
6+
- 3.5
67

78
install:
8-
- pip install .
9-
- pip install coverage python-coveralls
9+
- python3 setup.py build install
10+
- pip install python-coveralls
1011

1112
script:
12-
nosetests --with-coverage --cover-package=pycaching
13+
python3 setup.py lint test
1314

1415
after_success:
15-
coveralls
16+
coveralls

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
===============================================================================
2-
API
2+
API reference
33
===============================================================================
44

55
Here you can find an overview of all avaliable classes and methods.

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
requests>=2.8
2+
beautifulsoup4>=4.4
3+
geopy>=1.11

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[nosetests]
2+
verbosity = 2
3+
detailed-errors = 1
4+
5+
[flake8]
6+
max-line-length = 120
7+
exclude = dist,docs,build,*.egg,.git,__pycache__

setup.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
from setuptools import setup
55
from setuptools.command.test import test as TestCommand
6+
from setuptools import Command
67

78

89
# see http://fgimian.github.io/blog/2014/04/27/running-nose-tests-with-plugins-using-the-python-setuptools-test-command
@@ -19,9 +20,29 @@ def run_tests(self):
1920
nose.run_exit(argv=["nosetests", "--with-coverage", "--cover-package=pycaching"])
2021

2122

23+
class LintCommand(Command):
24+
user_options = []
25+
26+
def initialize_options(self):
27+
pass
28+
29+
def finalize_options(self):
30+
pass
31+
32+
def run(self):
33+
import flake8.main
34+
import sys
35+
sys.argv = []
36+
flake8.main.main()
37+
38+
2239
root = os.path.dirname(__file__) or "."
23-
f = open(os.path.join(root, "README.rst"))
24-
long_description = f.read()
40+
41+
with open(os.path.join(root, "README.rst")) as f:
42+
long_description = f.read()
43+
44+
with open(os.path.join(root, "requirements.txt")) as f:
45+
requirements = list(filter(None, (row.strip() for row in f)))
2546

2647
info = {
2748
"name": "pycaching",
@@ -35,9 +56,9 @@ def run_tests(self):
3556
"description": "Geocaching.com site crawler. Provides tools for searching, fetching caches and geocoding.",
3657
"long_description": long_description,
3758
"keywords": ["geocaching", "crawler", "geocache", "cache", "search", "geocode", "travelbug"],
38-
"install_requires": ["requests >= 2.8", "beautifulsoup4 >= 4.4", "geopy >= 1.11"],
39-
"setup_requires": ["nose >= 1.3", "flake8 >= 2.4.0", "coverage >= 3.7"],
40-
"cmdclass": {"test": NoseTestCommand},
59+
"install_requires": requirements,
60+
"setup_requires": ["nose", "flake8", "coverage"],
61+
"cmdclass": {"test": NoseTestCommand, "lint": LintCommand},
4162
}
4263

4364
setup(**info)

0 commit comments

Comments
 (0)