Skip to content

Commit

Permalink
Drop support for Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
srstevenson committed Nov 28, 2017
1 parent 59362b4 commit 4a3d511
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
install:
- pip install flake8 flake8-builtins flake8-docstrings flake8-import-order mypy pylint
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ xdg
``xdg`` is a tiny Python module which provides the variables defined by the
`XDG Base Directory Specification`_, to save you from duplicating the same
snippet of logic in every Python utility you write that deals with user cache,
configuration, or data files. It has no external dependencies and supports
Python 2 and 3.
configuration, or data files. It has no external dependencies.

.. _`XDG Base Directory Specification`: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Expand Down
16 changes: 5 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
"""Setup module for xdg."""

import os.path
from pathlib import Path

from setuptools import setup


def source_root_dir():
"""Return the path to the root of the source distribution."""
return os.path.abspath(os.path.dirname(__file__))


def read_long_description():
"""Read from README.rst file in root of source directory."""
readme = os.path.join(source_root_dir(), 'README.rst')
with open(readme) as fin:
return fin.read()
root = Path(__file__).resolve().parent
readme = root / 'README.rst'
return readme.read_text()


setup(
Expand All @@ -32,8 +27,7 @@ def read_long_description():
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Operating System :: Unix',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
keywords='xdg base directory specification',
py_modules=['xdg'],
Expand Down
2 changes: 1 addition & 1 deletion xdg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'XDG_DATA_DIRS', 'XDG_DATA_HOME', 'XDG_RUNTIME_DIR']


def _getenv(variable, default):
def _getenv(variable: str, default: str) -> str:
"""Get an environment variable.
Parameters
Expand Down

0 comments on commit 4a3d511

Please sign in to comment.