Skip to content

Commit

Permalink
OPT official python3.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattias Sluis committed Aug 15, 2017
1 parent 191e42c commit 754057d
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM kpndigital/tox:latest
FROM kpndigital/tox:py27_py35

WORKDIR /app

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This Makefile requires the following commands to be available:
# * virtualenv
# * python2.7
# * python3.6
# * docker
# * docker-compose

Expand Down Expand Up @@ -30,7 +29,7 @@ clean: pyclean docsclean
@rm -rf venv

venv:
@virtualenv -p python2.7 venv
@python3.6 -m venv venv
@$(PIP) install -U "pip>=7.0" -q
@$(PIP) install -r $(DEPS)

Expand Down
Binary file removed docs/_plantuml/plantuml.jar
Binary file not shown.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinxcontrib.plantuml',
]

plantuml_jar_path = os.path.abspath('./_plantuml/plantuml.jar')
Expand Down
1 change: 0 additions & 1 deletion requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pytest-cov

# docs
sphinx
sphinxcontrib-plantuml
165 changes: 162 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,173 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP'],
'description': 'Python package to ease the configuration of packages',
'include_package_data': True,
'install_requires': ['pkgversion'],
'long_description': "pkgsettings\n===========\n\n.. image:: https://secure.travis-ci.org/kpn-digital/py-pkgsettings.svg?branch=master\n :target: http://travis-ci.org/kpn-digital/py-pkgsettings?branch=master\n\n.. image:: https://img.shields.io/codecov/c/github/kpn-digital/py-pkgsettings/master.svg\n :target: http://codecov.io/github/kpn-digital/py-pkgsettings?branch=master\n\n.. image:: https://img.shields.io/pypi/v/pkgsettings.svg\n :target: https://pypi.python.org/pypi/pkgsettings\n\n.. image:: https://readthedocs.org/projects/py-pkgsettings/badge/?version=latest\n :target: http://py-pkgsettings.readthedocs.org/en/latest/?badge=latest\n\n\nGoal\n----\n\nThe goal of this package is to offer an easy, generic and extendable way\nof configuring a package.\n\nInstallation\n------------\n.. start_installation\n\n.. code-block:: bash\n\n $ pip install pkgsettings\n\n.. end_installation\n\nUsage\n-----\n.. start_usage\n.. code-block:: python\n\n from pkgsettings import Settings\n\n # Create the settings object for your package to use\n settings = Settings()\n\n # Now lets defined the default settings\n settings.configure(hello='World', debug=False)\n\nBy calling the configure you actually inject a ``layer`` of settings.\nWhen requesting a setting it will go through all layers until it finds the\nrequested key.\n\nNow if someone starts using your package it can easily modify the active\nsettings of your package by calling the configure again.\n\n.. code-block:: python\n\n from my_awesome_package.conf import settings\n\n # Lets change the configuration here\n settings.configure(debug=True)\n\n\nNow from within your package you can work with the settings like so:\n\n.. code-block:: python\n\n from conf import settings\n\n print(settings.debug) # This will print: True\n print(settings.hello) # This will print: World\n\nIt is also possible to pass an object instead of kwargs.\nThe settings object will call ``getattr(ur_object, key)``\nAn example below:\n\n.. code-block:: python\n\n class MySettings(object):\n def __init__(self):\n self.debug = True\n\n settings = Settings()\n settings.configure(MySettings())\n print(settings.debug) # This will print: True\n\nMore advanced usage\n-------------------\n\nThe settings object can also be used as context manager:\n\n.. code-block:: python\n\n with settings(debug=True):\n print(settings.debug) # This will print: True\n\n print(settings.debug) # This will print: False\n\nAdditionally you can also use this as a decorator:\n\n.. code-block:: python\n\n @settings(debug=True)\n def go()\n print(settings.debug) # This will print: True\n\n go()\n\n print(settings.debug) # This will print: False\n\n\n.. end_usage\n",
'install_requires': [],
'long_description': 'pkgsettings\n'
'===========\n'
'\n'
'.. image:: '
'https://secure.travis-ci.org/kpn-digital/py-pkgsettings.svg?branch=master\n'
' :target: '
'http://travis-ci.org/kpn-digital/py-pkgsettings?branch=master\n'
'\n'
'.. image:: '
'https://img.shields.io/codecov/c/github/kpn-digital/py-pkgsettings/master.svg\n'
' :target: '
'http://codecov.io/github/kpn-digital/py-pkgsettings?branch=master\n'
'\n'
'.. image:: '
'https://img.shields.io/pypi/v/pkgsettings.svg\n'
' :target: https://pypi.python.org/pypi/pkgsettings\n'
'\n'
'.. image:: '
'https://readthedocs.org/projects/py-pkgsettings/badge/?version=latest\n'
' :target: '
'http://py-pkgsettings.readthedocs.org/en/latest/?badge=latest\n'
'\n'
'\n'
'Goal\n'
'----\n'
'\n'
'The goal of this package is to offer an easy, generic '
'and extendable way\n'
'of configuring a package.\n'
'\n'
'Installation\n'
'------------\n'
'.. start_installation\n'
'\n'
'.. code-block:: bash\n'
'\n'
' $ pip install pkgsettings\n'
'\n'
'.. end_installation\n'
'\n'
'Usage\n'
'-----\n'
'.. start_usage\n'
'.. code-block:: python\n'
'\n'
' from pkgsettings import Settings\n'
'\n'
' # Create the settings object for your package to '
'use\n'
' settings = Settings()\n'
'\n'
" # Now let's define the default settings\n"
" settings.configure(hello='World', debug=False)\n"
'\n'
'By calling the configure you actually inject a ``layer`` '
'of settings.\n'
'When requesting a setting it will go through all layers '
'until it finds the\n'
'requested key.\n'
'\n'
'Now if someone starts using your package it can easily '
'modify the active\n'
'settings of your package by calling the configure '
'again.\n'
'\n'
'.. code-block:: python\n'
'\n'
' from my_awesome_package.conf import settings\n'
'\n'
' # Lets change the configuration here\n'
' settings.configure(debug=True)\n'
'\n'
'\n'
'Now from within your package you can work with the '
'settings like so:\n'
'\n'
'.. code-block:: python\n'
'\n'
' from conf import settings\n'
'\n'
' print(settings.debug) # This will print: True\n'
' print(settings.hello) # This will print: World\n'
'\n'
'It is also possible to pass an object instead of '
'kwargs.\n'
'The settings object will call ``getattr(ur_object, '
'key)``\n'
'An example below:\n'
'\n'
'.. code-block:: python\n'
'\n'
' class MySettings(object):\n'
' def __init__(self):\n'
' self.debug = True\n'
'\n'
' settings = Settings()\n'
' settings.configure(MySettings())\n'
' print(settings.debug) # This will print: True\n'
'\n'
'More advanced usage\n'
'-------------------\n'
'\n'
'The settings object can also be used as context '
'manager:\n'
'\n'
'.. code-block:: python\n'
'\n'
' with settings(debug=True):\n'
' print(settings.debug) # This will print: True\n'
'\n'
' print(settings.debug) # This will print: False\n'
'\n'
'Additionally you can also use this as a decorator:\n'
'\n'
'.. code-block:: python\n'
'\n'
' @settings(debug=True)\n'
' def go()\n'
' print(settings.debug) # This will print: True\n'
'\n'
' go()\n'
'\n'
' print(settings.debug) # This will print: False\n'
'\n'
'Prefixed Settings\n'
'-----------------\n'
'\n'
'If a group of settings share a common prefix, you can '
'make\n'
'use of the ``PrefixedSettings`` class and pass the '
'desired\n'
'prefix as an argument, together with the main settings '
'instance.\n'
'All attributes will be automatically prefixed when '
'accessed.\n'
'\n'
'.. code-block:: python\n'
'\n'
' from pkgsettings import PrefixedSettings, Settings\n'
'\n'
' # First create the settings object for your package '
'to use\n'
' settings = Settings()\n'
'\n'
' # Suppose some of your settings are all prefixed '
"with 'FOO'\n"
" settings.configure(FOO_a='a', FOO_b='b', c='c', "
'debug=False)\n'
'\n'
' # Create a PrefixedSettings instance with the '
'desired prefix\n'
" foo_settings = PrefixedSettings(settings, 'FOO_')\n"
'\n'
' foo_settings.a # This will print: a\n'
' foo_settings.b # This will print: b\n'
'\n'
' foo_settings.c # This will raise an AttributeError\n'
'\n'
'.. end_usage\n',
'name': 'pkgsettings',
'packages': ['pkgsettings'],
'tests_require': ['tox'],
'url': 'https://github.com/kpn-digital/py-pkgsettings.git',
'version': '0.10.1',
'version': '0.12.0',
'zip_safe': False})
1 change: 1 addition & 0 deletions setup_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP',
]
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
addopts=--tb=short

[tox]
envlist = py27,py35,isort-check,isort-fix,lint,docs
envlist = isort-check,isort-fix,lint,py27,py35,py36,docs
skipsdist = true

[testenv]
Expand Down

0 comments on commit 754057d

Please sign in to comment.