Skip to content

Commit

Permalink
Switched from setuptools to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasovskikh committed Jun 8, 2020
1 parent 5191cd8 commit e8ef429
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
*.egg-info/
*.pyc
*.swp
.eggs/
.idea/
.tox/
__pycache__/
build/
dist/
venv/
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -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")'
17 changes: 17 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.poetry]
name = "funcparserlib"
version = "0.3.6"
description = "Recursive descent parsing library based on functional combinators"
authors = ["Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>"]
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"
32 changes: 0 additions & 32 deletions setup.py

This file was deleted.

6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e8ef429

Please sign in to comment.