diff options
author | Jan Willhaus <mail@janwillhaus.de> | 2019-05-19 09:37:36 +0200 |
---|---|---|
committer | Jan Willhaus <mail@janwillhaus.de> | 2019-05-19 18:38:59 +0200 |
commit | 4e9aabe2d633cacd307a59ceac49b43cee8f0de8 (patch) | |
tree | bfae6cdae40de5f3b9b777ee205788699c0de7e5 | |
parent | bf0639aa4da5696c270b8d5ef0c15ff0536563a5 (diff) | |
download | warlock-4e9aabe2d633cacd307a59ceac49b43cee8f0de8.tar.gz |
Replace setuptools with poetry for packaging/deps
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | .travis.yml | 19 | ||||
-rw-r--r-- | MANIFEST.in | 4 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | pyproject.toml | 49 | ||||
-rw-r--r-- | requirements.txt | 3 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | setup.py | 62 |
8 files changed, 64 insertions, 80 deletions
@@ -9,4 +9,5 @@ warlock.egg-info/ .pytest_cache/ .python-version htmlcov/ -.vscode/
\ No newline at end of file +.vscode/ +poetry.lock diff --git a/.travis.yml b/.travis.yml index 080ccdb..394e719 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,24 @@ python: 3.7 cache: pip env: -- TEST_CMD="pytest" + - TEST_CMD="poetry run pytest" install: - - pip install pytest pytest-cov - - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]]; then - pip install pytest pytest-cov coveralls; fi + - | + if [[ "$TEST_CMD" == pytest* ]]; then + pip install poetry + poetry --no-interaction install + fi + - if [[ "$TEST_CMD" == pytest* ]] && [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then + pip install coveralls; fi - if [[ $TEST_CMD == black* ]]; then pip install black; fi - if [[ $TEST_CMD == flake8* ]]; then pip install flake8 flake8-bugbear flake8-todo; fi - - pip install -r requirements.txt script: -- $TEST_CMD + - $TEST_CMD after_success: - - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]]; + - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]]; then coveralls; fi matrix: @@ -38,4 +41,4 @@ matrix: - name: "pytest-py3.6" python: 3.6 - name: "pytest-py3.7" - python: 3.7
\ No newline at end of file + python: 3.7 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 4a54693..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include LICENSE.txt -include README.md -include requirements.txt -include setup.py @@ -6,6 +6,7 @@ [![Build Status](https://travis-ci.org/bcwaldon/warlock.svg?branch=master)][ci-builds] [![Coverage Status](https://coveralls.io/repos/github/bcwaldon/warlock/badge.svg?branch=master)][coveralls] +[![Package management: poetry](https://img.shields.io/badge/deps-poetry-blueviolet.svg)][poetry] ## Installation @@ -74,4 +75,5 @@ pip install warlock [pip]: https://pip.pypa.io/en/stable/ [ci-builds]: https://travis-ci.org/bcwaldon/warlock [coveralls]: https://coveralls.io/github/bcwaldon/warlock?branch=master +[poetry]: https://poetry.eustace.io/docs/ [pypistats]: https://pypistats.org/packages/warlock diff --git a/pyproject.toml b/pyproject.toml index 745ff5b..b3e7fee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[tool.poetry] +name = "warlock" +version = "1.3.1" +description = "Python object model built on JSON schema and JSON patch." +readme = "README.md" +authors = ["Brian Waldon <bcwaldon@gmail.com>"] +maintainers = ["Jan Willhaus <mail@janwillhaus.de>"] +homepage = "http://github.com/bcwaldon/warlock" +repository = "http://github.com/bcwaldon/warlock" +license = "Apache-2.0" +keywords=["JSON schema", "JSON patch", "model validation"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Software Development :: Libraries :: Python Modules", +] +packages = [ + { include = "warlock" }, +] +include = [ + "README.md", + "LICENSE" +] + +[tool.poetry.dependencies] +python = "~2.7 || ^3.4" +jsonschema = ">=0.7,<4" +jsonpatch = ">=0.10,<2" +six = "*" + +[tool.poetry.dev-dependencies] +pytest = "^4.0" +pytest-cov = "^2.7" + [tool.black] line-length = 88 include = '\.pyi?$' @@ -9,3 +54,7 @@ exclude = ''' | __pycache__ )/ ''' + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 53fee05..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -jsonschema>=0.7,<4 -jsonpatch>=0.10,<2 -six diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2a9acf1..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index a6369c1..0000000 --- a/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2012 Brian Waldon -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import setuptools -import os - - -def parse_requirements(): - fap = open("requirements.txt", "r") - raw_req = fap.read() - fap.close() - return raw_req.split("\n") - - -def read(fname): - with open(os.path.join(os.path.dirname(__file__), fname), "r") as fp: - return fp.read() - - -setuptools.setup( - name="warlock", - version="1.3.1", - description="Python object model built on JSON schema and JSON patch.", - long_description=read("README.md"), - long_description_content_type="text/markdown", - keywords=["JSON schema", "JSON patch", "model validation"], - author="Brian Waldon", - author_email="bcwaldon@gmail.com", - maintainer="Jan Willhaus", - maintainer_email="mail@janwillhaus.de", - url="http://github.com/bcwaldon/warlock", - packages=["warlock"], - install_requires=parse_requirements(), - license="Apache-2.0", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Operating System :: MacOS :: MacOS X", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -) |