Repository: pimutils/todoman
Pull request #317 (2018-07-17 17:32:36)

Run tests with Python 3.7
Now that Python 3.7 stable is finally out, let's officially support this.


Patch:
diff --git a/.travis.yml b/.travis.yml
index d9521aa..bc2bf57 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,6 @@ python:
   - 3.6
   - 3.4
   - 3.5
-  - 3.7-dev
   - pypy3.3-5.2-alpha1
 
 env:
@@ -32,6 +31,9 @@ after_script:
 
 jobs:
   include:
+    - python: 3.7
+      dist: xenial
+      sudo: true
     - env: TOXENV=flake8
       python: 3.6
     - env: TOXENV=docs
@@ -63,4 +65,3 @@ jobs:
 matrix:
   allow_failures:
     - python: pypy3.3-5.2-alpha1
-    - python: 3.7-dev
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6e8959d..e5b0f27 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,10 @@ Changelog
 This file contains a brief summary of new features and dependency changes or
 releases, in reverse chronological order.
 
+v3.4.1
+------
+* Support Python 3.7.
+
 v3.4.0
 ------
 
diff --git a/docs/source/install.rst b/docs/source/install.rst
index 51ac84f..a64b9dd 100644
--- a/docs/source/install.rst
+++ b/docs/source/install.rst
@@ -1,32 +1,15 @@
 Installing
 ==========
 
-Distribution packages
----------------------
-
 If todoman is packaged for your OS/distribution, using your system's
-standard package manager is probably the easiest way to install todoman.
-
-ArchLinux
-~~~~~~~~~
-
-todoman is packaged in the community_ repository, and can be installed using::
-
-    pacman -S todoman
-
-.. _community: https://www.archlinux.org/packages/community/any/todoman/
-
-macOS
-~~~~~
-
-todoman is packaged in homebrew_, an can be installed using::
+standard package manager is probably the easiest way to install todoman:
 
-    brew install todoman
+- ArchLinux (AUR_)
 
-.. _homebrew: https://formulae.brew.sh/formula/todoman
+.. _AUR: https://aur.archlinux.org/packages/todoman/
 
-Installation via PIP
---------------------
+Install via PIP
+---------------
 
 Since *todoman* is written in python, you can use python's package managers,
 *pip* by executing::
diff --git a/setup.py b/setup.py
index c52b916..042d64e 100644
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,7 @@ setup(
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Office/Business :: Scheduling',
         'Topic :: Utilities',
diff --git a/todoman/formatters.py b/todoman/formatters.py
index 9ba4c95..93b7bda 100644
--- a/todoman/formatters.py
+++ b/todoman/formatters.py
@@ -17,7 +17,7 @@ def rgb_to_ansi(colour):
     if not colour or not colour.startswith('#'):
         return
 
-    r, g, b = colour[1:3], colour[3:5], colour[5:7]
+    r, g, b = colour[1:3], colour[3:5], colour[5:8]
 
     if not len(r) == len(g) == len(b) == 2:
         return


Test patch:
diff --git a/tests/test_formatter.py b/tests/test_formatter.py
index a7de521..ad7a046 100644
--- a/tests/test_formatter.py
+++ b/tests/test_formatter.py
@@ -141,6 +141,6 @@ def test_formatting_parsing_consitency(default_formatter):
 def test_rgb_to_ansi():
     assert rgb_to_ansi(None) is None
     assert rgb_to_ansi('#8ab6d') is None
-    assert rgb_to_ansi('#8ab6d2f') == '\x1b[38;2;138;182;210m'
+    assert rgb_to_ansi('#8ab6d2f') is None
     assert rgb_to_ansi('red') is None
     assert rgb_to_ansi('#8ab6d2') == '\x1b[38;2;138;182;210m'