Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Mar 17, 2017
2 parents 35afe40 + 7e6c58f commit 1b788b3
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .pylintrc
@@ -0,0 +1,4 @@
[MESSAGES CONTROL]
# import-error and no-name-in-module are false positives for six.moves, pylint
# really hates that. If it's really broken, we'll pick it up in tests.
disable=locally-disabled,import-error,no-name-in-module,invalid-name,missing-docstring,wrong-import-order
35 changes: 23 additions & 12 deletions .travis.yml
@@ -1,23 +1,34 @@
language: python
python: 3.5 # 3.5 requires manual download, so it needs to be selected
cache: pip

env:
- TOXENV=py27
- TOXENV=py34
- TOXENV=py35
- TOXENV=coverage
python:
- '2.7'
- '3.3'
- '3.4'
- '3.5'
- '3.6'

# Allowed to fail
- '3.7-dev'
- 'nightly'

install: pip install tox
script: tox

script:
- 'tox'

matrix:
fast_finish: true
allow_failures:
- python: '3.7-dev'
- python: 'nightly'
include:
# One-off runs
- python: '3.6'
env: TOXENV=coverage
- python: '3.5' # 3.6 after https://github.com/PyCQA/pylint/issues/1113
env: TOXENV=pylint

# This is required to enable container based Travis CI infrastructure.
# See http://docs.travis-ci.com/user/migrating-from-legacy/
sudo: false

notifications:
email:
on_success: never
on_failure: always
26 changes: 16 additions & 10 deletions README.rst
@@ -1,13 +1,17 @@
|travis| |coveralls|
|travis| |coveralls| |libraries|

.. |travis| image:: https://travis-ci.org/cdown/tzupdate.svg?branch=develop
.. |travis| image:: https://img.shields.io/travis/cdown/tzupdate/develop.svg?label=tests
:target: https://travis-ci.org/cdown/tzupdate
:alt: Test status
:alt: Tests

.. |coveralls| image:: https://coveralls.io/repos/cdown/tzupdate/badge.svg?branch=develop&service=github
.. |coveralls| image:: https://img.shields.io/coveralls/cdown/tzupdate/develop.svg?label=test%20coverage
:target: https://coveralls.io/github/cdown/tzupdate?branch=develop
:alt: Coverage

.. |libraries| image:: https://img.shields.io/librariesio/github/cdown/tzupdate.svg?label=dependencies
:target: https://libraries.io/github/cdown/tzupdate
:alt: Dependencies

tzupdate is a fully automated utility to set the system time using geolocation.

Usage
Expand All @@ -23,27 +27,29 @@ to pass an IP address to use, instead of geolocating you.
$ sudo tzupdate
Set system timezone to Europe/London.


Installation
------------

To install the latest stable version from PyPi:

.. code::
pip install -U tzupdate
$ pip install -U tzupdate
To install the latest development version directly from GitHub:

.. code::
pip install -U git+https://github.com/cdown/tzupdate.git@develop
$ pip install -U git+https://github.com/cdown/tzupdate.git@develop
Testing
-------

.. code::
tox -e quick
.. _Tox: https://tox.readthedocs.org
$ pip install tox
$ tox
..........
----------------------------------------------------------------------
Ran 10 tests in 4.088s
OK
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -11,7 +11,7 @@

setup(
name='tzupdate',
version='1.1.0',
version='1.2.0',
description='Set the system timezone based on IP geolocation',
long_description=README,
url='https://github.com/cdown/tzupdate',
Expand Down
33 changes: 22 additions & 11 deletions tox.ini
@@ -1,22 +1,33 @@
[tox]
envlist = py27,py34,py35
envlist = system

[testenv]
deps=
basepython = python
deps =
-rrequirements.txt
-rtests/requirements.txt
commands=
nosetests
commands =
nosetests -v

[testenv:system]

[testenv:coverage]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
basepython=python3.5
deps=
-rtests/requirements.txt
deps =
{[testenv]deps}
coveralls
commands=
nosetests --with-coverage --cover-package=tzupdate
commands =
coverage erase
nosetests -v --with-coverage --cover-branches --cover-package=tzupdate
coveralls

[testenv:quick]
basepython=python
[testenv:pylint]
skipsdist = True
deps =
{[testenv]deps}
pylint
commands =
pylint tzupdate.py

[testenv:windows]
basepython = {env:PYTHON:}\python.exe
6 changes: 3 additions & 3 deletions tzupdate.py
Expand Up @@ -35,7 +35,7 @@
'GeoIPService', ['url', 'tz_keys', 'error_key'],
)

SERVICES = set([
SERVICES = frozenset([
GeoIPService(
'http://ip-api.com/json/{ip}', ('timezone',), 'message',
),
Expand Down Expand Up @@ -220,7 +220,7 @@ def main(argv=None, services=SERVICES):
t.terminate()

if args.print_only:
print('Detected timezone is %s.' % timezone)
print(timezone)
else:
link_localtime(timezone, args.zoneinfo_path, args.localtime_path)
write_debian_timezone(timezone, args.debian_timezone_path)
Expand Down Expand Up @@ -248,7 +248,7 @@ class DirectoryTraversalError(TimezoneUpdateException):

class TimezoneAcquisitionError(TimezoneUpdateException):
'''
Raised when IP-API raises an internal error.
Raised when a timezone API raises an internal error.
'''


Expand Down

0 comments on commit 1b788b3

Please sign in to comment.