Skip to content

Commit a6d7e40

Browse files
committed
Updated tox env and Dockerfile.
1 parent 032cb95 commit a6d7e40

File tree

10 files changed

+71
-18
lines changed

10 files changed

+71
-18
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ __pycache__/*
77
.tox/*
88
dist/*
99
build/*
10-
.coverage
10+
.coverage
11+
\#*\#
12+
*~
13+
*.\#*
14+
.ropeproject/*
15+
.python-version

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ matrix:
1818
- python: "2.7"
1919
env: UWSGI="2.0.14"
2020

21-
- python: "3.3"
22-
env: UWSGI="2.0.14"
21+
# - python: "3.3"
22+
# env: UWSGI="2.0.14"
2323

24-
- python: "3.4"
25-
env: UWSGI="2.0.14"
24+
# - python: "3.4"
25+
# env: UWSGI="2.0.14"
2626

27-
- python: "3.5"
28-
env: UWSGI="2.0.14"
27+
# - python: "3.5"
28+
# env: UWSGI="2.0.14"
2929

30-
- python: "3.6"
31-
env: UWSGI="2.0.14"
30+
# - python: "3.6"
31+
# env: UWSGI="2.0.14"

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,19 @@ publish: clean-pyc
3333
$(DOCKER_RUN_COMMAND) "twine upload dist/*"
3434
@echo ""
3535

36-
test:
36+
test: clean-conteainers
3737
@echo "Test application $(version)"
3838
$(DOCKER_RUN_COMMAND) "uwsgi --pyrun setup.py --pyargv test --sharedarea=100 --enable-threads"
3939
@echo ""
4040

41-
lint:
41+
tox: clean-containers
42+
@echo "Tox test application $(version)"
43+
$(DOCKER_RUN_COMMAND) "tox"
44+
@echo ""
45+
46+
lint: clean-containers
4247
@echo "Linting python files"
4348
$(DOCKER_RUN_COMMAND) "PYFLAKES_NODOCTEST=1 flake8 pyprometheus" || exit 1
4449
@echo ""
4550

46-
.PHONY: test publish lint help clean-pyc
51+
.PHONY: test publish lint help clean-pyc tox

ci/test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash -e
22

3-
43
uwsgi --pyrun setup.py --pyargv test --sharedarea=100 --enable-threads

pyprometheus/compat.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
"""
4+
pyprometheus.compat
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Prometheus instrumentation library for Python applications
8+
9+
:copyright: (c) 2017 by Alexandr Lispython.
10+
:license: , see LICENSE for more details.
11+
:github: http://github.com/Lispython/pyprometheus
12+
"""
13+
14+
import sys
15+
16+
# Useful for very coarse version differentiation.
17+
PY2 = sys.version_info[0] == 2
18+
PY3 = sys.version_info[0] == 3
19+
PY34 = sys.version_info[0:2] >= (3, 4)

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ omit =
2525
fabfile.py
2626
setup.py
2727
.eggs/*
28+
.tox/*
2829

2930
[coverage:report]
3031
# Regexes for lines to exclude from consideration

tests_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
flake8==3.2.1
22
tox==2.3.2
3+
#tox-pyenv==2.3.2
34

45
pytest==3.0.6
56
pytest-cov==2.4.0

tools/Dockerfile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,31 @@ RUN apt-get update && apt-get install -y \
1212

1313
COPY tests_requirements.txt /tests_requirements.txt
1414

15+
# Install pyenv for tox
16+
RUN git clone https://github.com/yyuu/pyenv.git ~/.pyenv
17+
ENV HOME /root
18+
ENV PYENV_ROOT $HOME/.pyenv
19+
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
20+
21+
RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
22+
RUN echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
23+
RUN echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
24+
25+
RUN exec $SHELL
26+
27+
RUN pyenv install 3.2 && \
28+
pyenv install 3.3.0 && \
29+
pyenv install 3.4.0 && \
30+
pyenv install 3.5.0 && \
31+
pyenv install 3.6.0 && \
32+
pyenv install 3.7-dev && \
33+
pyenv install pypy-4.0.1
34+
35+
RUN pyenv local 3.2 3.3.0 3.4.0 3.5.0 3.6.0 3.7-dev pypy-4.0.1
1536

1637
RUN pip install -U pip setuptools wheel==0.30.0a0 pyparsing==2.1.10 twine
1738
RUN pip install -U plop gprof2dot ipython
1839

19-
2040
RUN pip install -U -r /tests_requirements.txt
2141

2242

tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ clean-containers:
33

44
build-images:
55
@echo "Build docker images"
6-
docker-compose -f tools/compose-config.yml build --force-rm
6+
docker-compose -f tools/compose-config.yml build # --force-rm
77

88

99
run-cmd:

tox.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, py33, py34, py35
7+
envlist = py27#, py33, py34, py35
88

99
[testenv]
10+
deps = -rtests_requirements.txt
11+
1012
commands =
11-
pip install -e .[tests]
12-
python setup.py test
13+
pyenv local
14+
#pip install -e .[tests]
15+
uwsgi --pyrun setup.py --pyargv test --sharedarea=100 --enable-threads

0 commit comments

Comments
 (0)