summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml63
-rw-r--r--CHANGELOG.md2
-rw-r--r--MANIFEST.in4
-rw-r--r--README.md5
-rw-r--r--pyproject.toml45
-rw-r--r--requirements.txt3
-rw-r--r--setup.cfg2
-rw-r--r--setup.py65
9 files changed, 85 insertions, 107 deletions
diff --git a/.gitignore b/.gitignore
index 68f4009..8e9ca56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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 cf4765e..5eafa8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,41 +1,40 @@
-dist: xenial
language: python
-python: 3.7
-cache: pip
+python: 3.6
+cache:
+ pip: true
+ directories:
+ - "$HOME/.cache/pypoetry"
-env:
-- TEST_CMD="pytest"
+stages:
+ - linting
+ - test
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 == black* ]]; then pip install black; fi
- - if [[ $TEST_CMD == flake8* ]]; then pip install flake8 flake8-bugbear flake8-todo; fi
+ - curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python - -y
+ - source $HOME/.poetry/env
+ - poetry --no-interaction install -v
script:
-- python setup.py develop
-- $TEST_CMD
+ - pytest
-after_success:
- - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]] && [[ "$TEST_CMD" == pytest* ]];
- then coveralls; fi
-
-matrix:
+jobs:
include:
- - name: "black"
- env:
- - TEST_CMD="black --check --verbose ."
- - name: "flake8"
- env:
- - TEST_CMD="flake8 warlock"
- - name: "pytest-py2.7"
- python: 2.7
- - name: "pytest-py3.4"
- python: 3.4
- - name: "pytest-py3.5"
- python: 3.5
- - name: "pytest-py3.6"
- python: 3.6
- - name: "pytest-py3.7"
+ - python: 2.7
+ - python: 3.4
+ - python: 3.5
+ - python: 3.6
+ - python: 3.7
+ dist: xenial
+ before_script:
+ - pip install coveralls
+ after_success:
+ - coveralls
+
+ - stage: linting
python: 3.7
+ dist: xenial
+ install:
+ - pip install -U black flake8 flake8-bugbear flake8-todo
+ script:
+ - black --check --verbose .
+ - flake8 warlock
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19e8631..ad1b033 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ 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
+- Replace setuptools with poetry for packaging and dependency management
## [1.3.3] - 2019-05-20
### Fixed
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index b6975e2..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,4 +0,0 @@
-include LICENSE
-include README.md
-include requirements.txt
-include setup.py
diff --git a/README.md b/README.md
index 4edb851..9f9c515 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,10 @@
[![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]
+![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/bcwaldon/warlock/latest/master.svg)
+
+[![Package management: poetry](https://img.shields.io/badge/deps-poetry-blueviolet.svg)][poetry]
+[![Code Style Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black/)
## Installation
@@ -74,4 +78,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..cbae1a3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,44 @@
+[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" },
+]
+
+[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 +50,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 4a1db4a..0000000
--- a/setup.py
+++ /dev/null
@@ -1,65 +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 io
-import os
-
-
-def parse_requirements():
- fap = io.open("requirements.txt", "r", encoding="utf-8")
- raw_req = fap.read()
- fap.close()
- return raw_req.split("\n")
-
-
-def read(fname):
- with io.open(
- os.path.join(os.path.dirname(__file__), fname), "r", encoding="utf-8"
- ) as fp:
- return fp.read()
-
-
-setuptools.setup(
- name="warlock",
- version="1.3.3",
- 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",
- ],
-)