Skip to content

Commit

Permalink
Update repository structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk135 committed Nov 2, 2016
1 parent cc85ae5 commit e340807
Show file tree
Hide file tree
Showing 29 changed files with 5,317 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -4,7 +4,7 @@ install:
- pip install cython
- make cythonize
script:
- tox -v
- tox
language: python
python:
- 3.5
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -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
Expand Down
19 changes: 11 additions & 8 deletions Makefile
@@ -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 =

Expand All @@ -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
Expand All @@ -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

Expand Down
16 changes: 10 additions & 6 deletions setup.py
Expand Up @@ -15,7 +15,7 @@
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:
Expand All @@ -34,15 +34,19 @@
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']),
],
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -6,5 +6,3 @@ class Error(Exception):
All dependency injector errors extend this error class.
"""

print(__file__, __name__)

0 comments on commit e340807

Please sign in to comment.