Skip to content

Commit

Permalink
infra: use poetry in CI, drop old pythons
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kulyov <[email protected]>
  • Loading branch information
pkulev committed Feb 25, 2020
1 parent e798334 commit 1c7a12f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 102 deletions.
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ sudo: false
dist: xenial
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"

addons:
apt:
packages:
- curl
- make

cache:
pip: true
directories:
- "$HOME/.cache/pypoetry"

install:
- make ci-install
- pip install --upgrade pip
- curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py > get-poetry.py
- python get-poetry.py -y
- source $HOME/.poetry/env
- poetry install

script:
- make ci-test
- poetry run pytest --cov=./xoinvader --cov-report=xml -s -v xoinvader/tests

after_success:
- codecov
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

29 changes: 6 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
DOCPATH = ./docs
PYVERSION ?= 3
VENV ?= .venv
VENV_CMD = virtualenv --python=python$(PYVERSION)
PYTHON ?= $(VENV)/bin/python$(PYVERSION)
PYTEST = $(VENV)/bin/py.test
COV_FMT ?= html
PIP ?= $(VENV)/bin/pip
RM = rm -f
Expand All @@ -12,45 +7,33 @@ all: help

clean:
$(RM) -r *~ ./xoinvader/*~ ./xoinvader/tests/*~ ./xoinvader/*.pyc ./xoinvader/tests/*.pyc ./dist ./build
$(RM) -r $(VENV) *.egg-info
$(RM) -r *.egg-info
$(RM) -r ./htmlcov ./docs/build/

install:
$(PIP) install .

devel:
$(VENV_CMD) $(VENV)
$(PIP) install -r requirements.txt
$(PIP) install -r dev-requirements.txt
$(PIP) install -e .

# CI isolates virtualenvs itself, we don't have to think about it
ci-install:
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install .

ci-test:
py.test --cov=./xoinvader --cov-report=xml --strict -v
poetry install

help:
@printf "USAGE: make [params]\n"

lint:
@printf "Warnings are disabled. To full check use 'make lint-full'\n"
@$(PYTEST) --pylint -m pylint -vvvv $(PYTEST_ARGS) --pylint-error-types CREF
poetry run pytest --pylint -m pylint -vvvv $(PYTEST_ARGS) --pylint-error-types CREF

lint-full:
@$(PYTEST) --pylint -m pylint -vvvv $(PYTEST_ARGS) --pylint-error-types CREWF
poetry run pytest --pylint -m pylint -vvvv $(PYTEST_ARGS) --pylint-error-types CREWF

test:
@$(PYTEST) --cov=./xoinvader --cov-report=$(COV_FMT) --strict -v $(PYTEST_ARGS)
poetry run pytest --cov=./xoinvader --cov-report=$(COV_FMT) --strict -v $(PYTEST_ARGS)

view_cov: test
@xdg-open ./htmlcov/index.html

docs:
$(MAKE) -C $(DOCPATH) -f Makefile html SPHINXBUILD="$(CURDIR)/$(VENV)/bin/sphinx-build"
poetry run $(MAKE) -C $(DOCPATH) -f Makefile html SPHINXBUILD=sphinx-build

view_docs: docs
@xdg-open $(DOCPATH)/build/html/index.html
Expand Down
9 changes: 0 additions & 9 deletions dev-requirements.txt

This file was deleted.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "xoinvader"
version = "0.1.2"
version = "0.1.3"
description = "(not so) small python curses space game"
authors = ["Pavel Kulyov <[email protected]>"]
license = "MIT"
Expand All @@ -15,8 +15,8 @@ keywords = ["curses", "space", "game"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Environment :: X11 Applications",
"Intended Audience :: Developers",
"Environment :: X11 Applications",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
Expand All @@ -33,7 +33,7 @@ classifiers = [
xoigame = "xoinvader.game:main"

[tool.poetry.dependencies]
python = "~2.7 || ^3.4"
python = "^3.6"
tornado = "^4"
pygame = "*"
six = "*"
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

54 changes: 0 additions & 54 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion xoinvader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .utils import setup_logger


__version__ = "0.1.2"
__version__ = "0.1.3"


class XOInitializationError(Exception):
Expand Down

0 comments on commit 1c7a12f

Please sign in to comment.