From e8ef4298787a0f7a18108dfa02d31aa4b937a32f Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 9 Jun 2020 02:12:56 +0300 Subject: [PATCH] Switched from setuptools to poetry --- .gitignore | 2 ++ MANIFEST.in | 3 --- Makefile | 29 +++++++++++++---------------- doc/Makefile | 4 ++-- poetry.lock | 17 +++++++++++++++++ pyproject.toml | 32 ++++++++++++++++++++++++++++++++ setup.py | 32 -------------------------------- tox.ini | 6 +++++- 8 files changed, 71 insertions(+), 54 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 poetry.lock create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index b515431..ea23e71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ *.egg-info/ *.pyc +*.swp .eggs/ .idea/ .tox/ __pycache__/ build/ +dist/ venv/ diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 2232104..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -recursive-include doc * -recursive-include tests *.py -include LICENSE CHANGES.md MANIFEST.in diff --git a/Makefile b/Makefile index 0f47306..1fe321d 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,24 @@ -PYTHON = /usr/bin/python -SETUP = $(PYTHON) setup.py -DESTDIR = / -PREFIX = /usr -INSTALL_OPTS = --root "$(DESTDIR)" --prefix "$(PREFIX)" +.PHONY: default install test doctest unittest clean poetry-install tox -.PHONY: default install test doctest unittest clean +default: poetry-install + poetry build -default: - $(SETUP) build - -install: - $(SETUP) install $(INSTALL_OPTS) +poetry-install: + poetry install test: unittest -doctest: +doctest: poetry-install make -C doc -unittest: - $(PYTHON) -m unittest discover funcparserlib.tests +unittest: poetry-install + poetry run python -m unittest discover + +tox: + poetry run python -m pip install tox + poetry run tox clean: - $(SETUP) clean - rm -fr build dist MANIFEST + rm -fr build dist *.egg-info .tox find . -name '*.pyc' | xargs rm -f find . -name __pycache__ | xargs rm -fr diff --git a/doc/Makefile b/doc/Makefile index bbf09fc..fb36f4c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ test: test-tutorial test-brackets test-tutorial: - python -c 'import doctest; doctest.testfile("Tutorial.md")' + poetry run python -c 'import doctest; doctest.testfile("Tutorial.md")' test-brackets: - python -c 'import doctest; doctest.testfile("Brackets.md")' + poetry run python -c 'import doctest; doctest.testfile("Brackets.md")' diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..8151613 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,17 @@ +[[package]] +category = "dev" +description = "Python 2 and 3 compatibility utilities" +name = "six" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +version = "1.15.0" + +[metadata] +content-hash = "373e8e5f022bb190189f3ea812c638a642bdff584070194aa682b79399031430" +python-versions = "~2.7 || ^3.5" + +[metadata.files] +six = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d2dfee2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[tool.poetry] +name = "funcparserlib" +version = "0.3.6" +description = "Recursive descent parsing library based on functional combinators" +authors = ["Andrey Vlasovskikh "] +license = "MIT" +readme = "README.md" +homepage = "https://github.com/vlasovskikh/funcparserlib" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", +] + +[tool.poetry.dependencies] +python = "~2.7 || ^3.5" + +[tool.poetry.dev-dependencies] +six = "^1.15.0" + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/setup.py b/setup.py deleted file mode 100644 index b46eef3..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -from setuptools import setup - - -setup( - name='funcparserlib', - version='0.3.6', - packages=['funcparserlib'], - author='Andrey Vlasovskikh', - author_email='andrey.vlasovskikh@gmail.com', - description='Recursive descent parsing library based on functional ' - 'combinators', - license='MIT', - url='https://github.com/vlasovskikh/funcparserlib', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers' - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", - tests_require=["six"], -) diff --git a/tox.ini b/tox.ini index 3ed8a64..b939fc5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,9 @@ [tox] +isolated_build = true envlist = py{27,35,36,37,38} [testenv] -commands = python setup.py test +deps = + six +commands = + python -m unittest discover