Update repository structure

This commit is contained in:
Roman Mogilatov 2016-11-02 22:58:30 +02:00
parent cc85ae5a8f
commit e3408075de
29 changed files with 5317 additions and 22 deletions

View File

@ -2,7 +2,7 @@
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore=utils,test
ignore=utils,tests
[MESSAGES CONTROL]

View File

@ -4,7 +4,7 @@ install:
- pip install cython
- make cythonize
script:
- tox -v
- tox
language: python
python:
- 3.5

View File

@ -1,4 +1,4 @@
recursive-include dependency_injector *.py *.pyx *.pxd *.c
recursive-include src/dependency_injector *.py *.pyx *.pxd *.c
include README.rst
include CONTRIBUTORS.rst
include LICENSE.rst

View File

@ -1,6 +1,6 @@
VERSION := $(shell python setup.py --version)
CYTHON_SRC := $(shell find dependency_injector -name '*.pyx')
CYTHON_SRC := $(shell find src/dependency_injector -name '*.pyx')
CYTHON_DIRECTIVES =
@ -12,11 +12,11 @@ endif
clean:
# Clean sources
find dependency_injector -name '*.py[cod]' -delete
find dependency_injector -name '__pycache__' -delete
find dependency_injector -name '*.c' -delete
find dependency_injector -name '*.so' -delete
find dependency_injector -name '*.html' -delete
find src -name '*.py[cod]' -delete
find src -name '__pycache__' -delete
find src -name '*.c' -delete
find src -name '*.so' -delete
find src -name '*.html' -delete
# Clean tests
find tests -name '*.py[co]' -delete
find tests -name '__pycache__' -delete
@ -29,16 +29,19 @@ cythonize:
cython -a $(CYTHON_DIRECTIVES) $(CYTHON_SRC)
# Move all Cython html reports
mkdir -p reports/cython/
find dependency_injector -name '*.html' -exec mv {} reports/cython/ \;
find src -name '*.html' -exec mv {} reports/cython/ \;
build: clean cythonize
# Compile C extensions
python setup.py build_ext --inplace
install: clean cythonize
python setup.py install
test:
# Unit tests with coverage report
coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover tests
coverage run --rcfile=./.coveragerc -m unittest2 discover tests/unit
coverage report --rcfile=./.coveragerc
coverage html --rcfile=./.coveragerc

View File

@ -15,7 +15,7 @@ with open('requirements.txt') as version:
requirements = version.readlines()
# Getting version:
with open('dependency_injector/__init__.py') as init_file:
with open('src/dependency_injector/__init__.py') as init_file:
version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
# Defining macros:
@ -34,15 +34,19 @@ setup(name='dependency-injector',
maintainer='Roman Mogilatov',
maintainer_email='rmogilatov@gmail.com',
url='https://github.com/ets-labs/python-dependency-injector',
bugtrack_url='https://github.com/ets-labs/python-dependency-injector' +
'/issues',
download_url='https://pypi.python.org/pypi/dependency_injector',
install_requires=requirements,
packages=['dependency_injector',
'dependency_injector.providers'],
packages=[
'dependency_injector',
'dependency_injector.providers',
],
package_dir={
'dependency_injector': 'src/dependency_injector',
'dependency_injector.providers': 'src/dependency_injector/providers',
},
ext_modules=[
Extension('dependency_injector.injections',
['dependency_injector/injections.c'],
['src/dependency_injector/injections.c'],
define_macros=defined_macros,
extra_compile_args=['-O2']),
],

View File

@ -6,5 +6,3 @@ class Error(Exception):
All dependency injector errors extend this error class.
"""
print(__file__, __name__)

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -6,7 +6,7 @@ envlist=
deps=
unittest2
commands=
unit2 discover tests
unit2 discover tests/unit
[testenv:coveralls]
basepython=python3.5
@ -17,9 +17,8 @@ deps=
coverage
coveralls
commands=
{envpython} setup.py build_ext --inplace
coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover tests
coverage run --rcfile=./.coveragerc -m unittest2 discover tests/unit
coveralls
[testenv:pylint]