From 8246eeaaa30329e8ed74046c679d04a293c5eb87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Wed, 26 May 2021 19:42:53 +0200
Subject: [PATCH] report coverage

---
 .codeclimate.yml | 2 +-
 .coveragerc      | 4 +++-
 .gitattributes   | 2 ++
 Dockerfile       | 7 ++++---
 setup.py         | 2 +-
 tests/test.sh    | 4 ++++
 unittest.cfg     | 2 --
 7 files changed, 15 insertions(+), 8 deletions(-)
 create mode 100644 .gitattributes
 create mode 100644 tests/test.sh
 delete mode 100644 unittest.cfg

diff --git a/.codeclimate.yml b/.codeclimate.yml
index 7a04ba0..b5f183d 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -15,4 +15,4 @@ exclude_paths:
   - tests/**
 ratings:
   paths:
-    - minijson/**
+    - minijson.pyx
diff --git a/.coveragerc b/.coveragerc
index d5b54ce..947f627 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,3 +1,5 @@
 [run]
-omit=setup.py
+omit=
+    setup.py
+    docs/*
 plugins = Cython.Coverage
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6f9c276
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.sh eol=lf
+
diff --git a/Dockerfile b/Dockerfile
index 1d32eca..437d34a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,13 @@
 FROM smokserwis/build:python3
 
-RUN pip install snakehouse Cython satella pytest coverage pytest-cov
+RUN pip install Cython pytest coverage pytest-cov
 
 ENV DEBUG=1
 
 WORKDIR /tmp/compile
 ADD . /tmp/compile/
 
-RUN python setup.py install
+RUN python setup.py install && \
+    chmod ugo+x /tmp/compile/tests/test.sh
 
-CMD ["pytest", "--cov=./", "--cov-report=xml"]
+CMD ["/tmp/compile/tests/test.sh"]
diff --git a/setup.py b/setup.py
index 746a336..3c79f24 100644
--- a/setup.py
+++ b/setup.py
@@ -12,6 +12,7 @@ macros = []
 if 'DEBUG' in os.environ:
     print('Enabling debug mode')
     directive_defaults['linetrace'] = True
+    directive_defaults['profiling'] = True
     directive_defaults['binding'] = True
     macros = [('CYTHON_TRACE', '1')]
 
@@ -21,5 +22,4 @@ extensions = [Extension("minijson", ["minijson.pyx"],
 
 setup(version='1.7',
       ext_modules=cythonize(extensions),
-      python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*',
       )
diff --git a/tests/test.sh b/tests/test.sh
new file mode 100644
index 0000000..8b496fd
--- /dev/null
+++ b/tests/test.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+pytest --cov=./ --cov-report=xml
+coverage report
diff --git a/unittest.cfg b/unittest.cfg
deleted file mode 100644
index 84743c4..0000000
--- a/unittest.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[coverage]
-always-on = True
-- 
GitLab