From 9f96774558fa7ec1a3c5eb9d01f2b5e0ebd942f4 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 19 Jan 2020 20:48:50 -0600 Subject: Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..82358df --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at eugenetriguba@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq -- cgit v1.2.3 From facae7acbdc7686b056489d5089336876cc5c47e Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:21:20 -0600 Subject: Bump down python version --- .travis.yml | 17 +++++++---------- CHANGELOG.md | 14 ++++++++++++-- README.md | 2 +- pyproject.toml | 4 ++-- tox.ini | 9 +++++---- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21aebf9..603bc53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,10 @@ language: python +os: linux -stages: - - test +python: + - "3.6" + - "3.7" + - "3.8" -matrix: - include: - - stage: test - python: 3.8 - install: pip install --upgrade pip tox poetry codecov - script: tox - env: - TOXENV: py38 \ No newline at end of file +install: pip install --upgrade pip tox-travis poetry codecov +script: tox \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b9f3bbd..9df2ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +Changed + + - Bumped down python version requirement to 3.6. + ## 0.5.0 - 2020-01-19 - - Add support for retrieving entire sections as a `dict` with `get()`. +Added + + - Support for retrieving entire sections as a `dict` with `get()`. ## 0.4.0 - 2020-01-19 - - Add `reset()` and `save()` methods to `ConfigFile`. This allows you to reset your +Added + + - `reset()` and `save()` methods to `ConfigFile`. This allows you to reset your configuration file to an "original state," given the original config file path. However, say you have a `config/config.json` file. Then it will automatically try to look for `config/config.original.json` if no file path is specified. The `save()` diff --git a/README.md b/README.md index 708ad83..cf81e5d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > Manage and manipulate your configuration files -[![Python 3.8.0|](https://img.shields.io/badge/python-3.8.0-blue.svg)](https://www.python.org/downloads/release/python-380/) +![Python Verisons](https://img.shields.io/pypi/pyversions/config-file.svg) [![Version](https://img.shields.io/pypi/v/config-file)](https://pypi.org/project/config-file/) [![Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://pypi.org/project/black/) [![Build Status](https://travis-ci.com/eugenetriguba/config_file.svg?branch=master)](https://travis-ci.com/eugenetriguba/config_file) diff --git a/pyproject.toml b/pyproject.toml index 2f38381..19aac32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,13 +11,13 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.6" toml = "^0.10.0" pyyaml = "^5.2" diff --git a/tox.ini b/tox.ini index d94f733..eb607cf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,13 @@ [tox] isolated_build = true -envlist = py38 +envlist = py{36, 37, 38} +recreate = True [testenv] -passenv = CI TRAVIS TRAVIS_* -deps = codecov +passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_* +deps = codecov>=1.4.0 whitelist_externals = poetry commands = poetry install -v poetry run pytest --cov=config_file/ tests/ - codecov \ No newline at end of file + codecov -e TOXENV \ No newline at end of file -- cgit v1.2.3 From 499e5aedd5c35b8f1624c0761e720dacdd385058 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:32:00 -0600 Subject: Install poetry via curl in travic ci and update lock file --- .travis.yml | 5 ++++- poetry.lock | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 603bc53..507c5e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,8 @@ python: - "3.7" - "3.8" -install: pip install --upgrade pip tox-travis poetry codecov +install: + - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + - source $HOME/.poetry/env + - pip install --upgrade pip tox-travis codecov script: tox \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 64dd310..a31acfd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -174,6 +174,31 @@ version = "1.4.10" [package.extras] license = ["editdistance"] +[[package]] +category = "dev" +description = "Read metadata from Python packages" +marker = "python_version < \"3.8\"" +name = "importlib-metadata" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +version = "1.4.0" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "rst.linker"] +testing = ["packaging", "importlib-resources"] + +[[package]] +category = "dev" +description = "Read resources from Python packages" +marker = "python_version < \"3.7\"" +name = "importlib-resources" +optional = false +python-versions = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3" +version = "1.0.2" + [[package]] category = "dev" description = "A Python utility / library to sort Python imports." @@ -220,6 +245,11 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "0.13.1" +[package.dependencies] +[package.dependencies.importlib-metadata] +python = "<3.8" +version = ">=0.12" + [package.extras] dev = ["pre-commit", "tox"] @@ -241,6 +271,14 @@ six = "*" toml = "*" virtualenv = ">=15.2" +[package.dependencies.importlib-metadata] +python = "<3.8" +version = "*" + +[package.dependencies.importlib-resources] +python = "<3.7" +version = "*" + [[package]] category = "dev" description = "library with cross-python path, ini-parsing, io, code, log facilities" @@ -386,9 +424,24 @@ version = "16.7.9" docs = ["sphinx (>=1.8.0,<2)", "towncrier (>=18.5.0)", "sphinx-rtd-theme (>=0.4.2,<1)"] testing = ["pytest (>=4.0.0,<5)", "coverage (>=4.5.0,<5)", "pytest-timeout (>=1.3.0,<2)", "six (>=1.10.0,<2)", "pytest-xdist", "pytest-localserver", "pypiserver", "mock", "xonsh"] +[[package]] +category = "dev" +description = "Backport of pathlib-compatible object wrapper for zip files" +marker = "python_version < \"3.8\"" +name = "zipp" +optional = false +python-versions = ">=3.6" +version = "2.0.1" + +[package.dependencies] +more-itertools = "*" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] + [metadata] -content-hash = "ddf19a9d0619bc0bf76ebb1425acbcab5058f59f1f29f36e1f24748006db6ed3" -python-versions = "^3.8" +content-hash = "b85256d1b940200e79b69f7af58bd0c8137a2942f8ff6772b5ac60dcf7555441" +python-versions = "^3.6" [metadata.files] appdirs = [ @@ -486,6 +539,14 @@ identify = [ {file = "identify-1.4.10-py2.py3-none-any.whl", hash = "sha256:418f3b2313ac0b531139311a6b426854e9cbdfcfb6175447a5039aa6291d8b30"}, {file = "identify-1.4.10.tar.gz", hash = "sha256:8ad99ed1f3a965612dcb881435bf58abcfbeb05e230bb8c352b51e8eac103360"}, ] +importlib-metadata = [ + {file = "importlib_metadata-1.4.0-py2.py3-none-any.whl", hash = "sha256:bdd9b7c397c273bcc9a11d6629a38487cd07154fa255a467bf704cd2c258e359"}, + {file = "importlib_metadata-1.4.0.tar.gz", hash = "sha256:f17c015735e1a88296994c0697ecea7e11db24290941983b08c9feb30921e6d8"}, +] +importlib-resources = [ + {file = "importlib_resources-1.0.2-py2.py3-none-any.whl", hash = "sha256:6e2783b2538bd5a14678284a3962b0660c715e5a0f10243fd5e00a4b5974f50b"}, + {file = "importlib_resources-1.0.2.tar.gz", hash = "sha256:d3279fd0f6f847cced9f7acc19bd3e5df54d34f93a2e7bb5f238f81545787078"}, +] isort = [ {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, {file = "isort-4.3.21.tar.gz", hash = "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"}, @@ -572,3 +633,7 @@ virtualenv = [ {file = "virtualenv-16.7.9-py2.py3-none-any.whl", hash = "sha256:55059a7a676e4e19498f1aad09b8313a38fcc0cdbe4fdddc0e9b06946d21b4bb"}, {file = "virtualenv-16.7.9.tar.gz", hash = "sha256:0d62c70883c0342d59c11d0ddac0d954d0431321a41ab20851facf2b222598f3"}, ] +zipp = [ + {file = "zipp-2.0.1-py3-none-any.whl", hash = "sha256:e013e7800f60ec4dde789ebf4e9f7a54236e4bbf5df2a1a4e20ce9e1d9609d67"}, + {file = "zipp-2.0.1.tar.gz", hash = "sha256:b338014b9bc7102ca69e0fb96ed07215a8954d2989bc5d83658494ab2ba634af"}, +] -- cgit v1.2.3 From 2f90fe4ea40d47ff44c60c82cc887574c4e02b28 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:38:26 -0600 Subject: Remove using of `missing_ok` This is to be compatible with python 3.6 & 3.7 --- config_file/config_file.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config_file/config_file.py b/config_file/config_file.py index b090ace..5827d08 100644 --- a/config_file/config_file.py +++ b/config_file/config_file.py @@ -118,7 +118,11 @@ class ConfigFile: if not Path(original_file_path).exists(): raise OSError(f"The {original_file_path} file to reset to does not exist.") - Path(self.path).expanduser().unlink(missing_ok=True) + try: + Path(self.path).expanduser().unlink() + except OSError: + pass + copyfile(original_file_path, self.path) self.contents = self.__read_config_file() -- cgit v1.2.3 From 7fccdb3d36d202c141301a5f40fbb193f98ec1cb Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:41:46 -0600 Subject: Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9df2ae4..03bde2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Changed - - Bumped down python version requirement to 3.6. + - Bumped down python version requirement to 3.6 and now test 3.6, 3.7, and 3.8 on CI. ## 0.5.0 - 2020-01-19 -- cgit v1.2.3 From 6c99e193247760335aeab1f8958de2dcf7a037ac Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:41:55 -0600 Subject: =?UTF-8?q?Bump=20version:=200.5.0=20=E2=86=92=200.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- CHANGELOG.md | 2 +- config_file/__init__.py | 2 +- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index cb0cd7f..d359899 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.5.0 +current_version = 0.6.0 commit = True tag = True diff --git a/CHANGELOG.md b/CHANGELOG.md index 03bde2c..0005a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 0.6.0 - 2020-01-24 Changed diff --git a/config_file/__init__.py b/config_file/__init__.py index 22164c1..5917edd 100644 --- a/config_file/__init__.py +++ b/config_file/__init__.py @@ -1,7 +1,7 @@ from config_file.config_file import ConfigFile from config_file.parsers.base_parser import BaseParser, ParsingError -__version__ = "0.5.0" +__version__ = "0.6.0" __all__ = [ "ConfigFile", diff --git a/pyproject.toml b/pyproject.toml index 19aac32..21d60b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "config_file" -version = "0.5.0" +version = "0.6.0" description = "Manage your configuration files." authors = ["Eugene Triguba "] readme = "README.md" -- cgit v1.2.3